|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.layout.Baseline
Convenience class that can be used to determine the baseline of a
particular component. The static method getBaseline
uses the
following algorithm to determine the baseline:
getBaseline(JComponent,int,int)
method, invoke it.
UIManager
property of the name
Baseline.instance
, forward the call to that Baseline.
This class is primarily useful for JREs prior to 1.6. In 1.6 API for this was added directly to Component, JComponent and the appropriate ComponentUIs. When run on a JRE of 1.6 or greater this will directly call into the getBaseline method of Component.
Constructor Summary | |
protected |
Baseline()
Creates an instance of Baseline. |
Method Summary | |
static int |
getBaseline(javax.swing.JComponent component)
Returns the baseline for the specified component, or -1 if the baseline can not be determined. |
static int |
getBaseline(javax.swing.JComponent component,
int width,
int height)
Returns the baseline for the specified component, or a value less than 0 if the baseline can not be determined. |
int |
getComponentBaseline(javax.swing.JComponent component,
int width,
int height)
Returns the baseline for the specified component, or -1 if the baseline can not be determined. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Baseline()
A custom look and feel that wants to provide Baseline
support should put the instance in the defaults returned
from getDefaults
. If you want to override the
baseline suport for a look and feel place the instance in the defaults
returned from UIManager.getLookAndFeelDefaults(). Tthis will ensure
that if the look and feel changes the appropriate baseline can be used.
Method Detail |
public static int getBaseline(javax.swing.JComponent component)
component
- JComponent to calculate baseline for
public static int getBaseline(javax.swing.JComponent component, int width, int height)
component
- JComponent to calculate baseline forwidth
- Width of the component to determine baseline for.height
- Height of the component to determine baseline for.
public int getComponentBaseline(javax.swing.JComponent component, int width, int height)
component
- JComponent to calculate baseline forwidth
- Width of the component to determine baseline for.height
- Height of the component to determine baseline for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |