|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.miginfocom.layout.PlatformDefaults
public final class PlatformDefaults
Currently handles Windows and Mac OS X spacing.
Field Summary | |
---|---|
static int |
MAC_OSX
|
static int |
WINDOWS_XP
|
Method Summary | |
---|---|
static java.lang.String |
getButtonOrder()
Returns the order for the typical buttons in a standard button bar. |
static int |
getCurrentPlatform()
Returns the platform that the JRE is running on currently. |
static UnitValue |
getDialogInsets(int side)
Returns the default dialog inset depending of the current platform. |
static InCellGapProvider |
getGapProvider()
Returns the current gap privider or null if none is set and "related" should always be used. |
static BoundSize |
getGridGapX()
Returns the platform recommended inter-cell gap in the horizontal (x) dimension.. |
static BoundSize |
getGridGapY()
Returns the platform recommended inter-cell gap in the vertical (x) dimension.. |
static float |
getLabelAlignPercentage()
Returns the percentage used for alignment for labels (0 is left, 50 is center and 100 is right). |
static UnitValue |
getMinimumButtonWidth()
Returns the recommended minimum button width depending on the current set platform. |
static int |
getModCount()
Returns how many times the defaults has been changed. |
static UnitValue |
getPanelInsets(int side)
Returns the default panel inset depending of the current platform. |
static int |
getPlatform()
Returns the current platform |
static UnitValue |
getUnitValueX(java.lang.String unit)
Returns the unit value associated with the unit. |
static UnitValue |
getUnitValueY(java.lang.String unit)
Returns the unit value associated with the unit. |
void |
invalidate()
Tells all layout manager instances to revalidate and recalculated everything. |
static void |
setButtonOrder(java.lang.String order)
Sets the order for the typical buttons in a standard button bar. |
static void |
setDialogInsets(UnitValue top,
UnitValue left,
UnitValue bottom,
UnitValue right)
Sets the default insets for a dialog. |
static void |
setGapProvider(InCellGapProvider provider)
Sets the current gap privider or null if none is set and "related" should always be used. |
static void |
setGridCellGap(UnitValue x,
UnitValue y)
Sets gap between two cells in the grid. |
static void |
setIndentGap(UnitValue x,
UnitValue y)
Sets gap value for components that are "intended". |
static void |
setMinimumButtonWidth(UnitValue width)
Sets the recommended minimum button width. |
static void |
setPanelInsets(UnitValue top,
UnitValue left,
UnitValue bottom,
UnitValue right)
Sets the default insets for a dialog. |
static void |
setParagraphGap(UnitValue x,
UnitValue y)
Sets paragraph gap value for components. |
static void |
setPlatform(int plaf)
Set the defaults to the default for the platform |
static void |
setRelatedGap(UnitValue x,
UnitValue y)
Sets gap value for components that are "related". |
static void |
setUnitValue(java.lang.String[] unitStrings,
UnitValue x,
UnitValue y)
Sets the unit value assiciated with a unit string. |
static void |
setUnrelatedGap(UnitValue x,
UnitValue y)
Sets gap value for components that are "unrelated". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WINDOWS_XP
public static final int MAC_OSX
Method Detail |
---|
public static int getCurrentPlatform()
MAC_OSX
or WINDOWS_XP
.public static void setPlatform(int plaf)
plaf
- The platform. PlatformDefaults.WINDOWS
or PlatformDefaults.MAC_OSX
public static int getPlatform()
PlatformDefaults.WINDOWS
or PlatformDefaults.MAC_OSX
public static void setRelatedGap(UnitValue x, UnitValue y)
x
- The value that will be transformed to pixels. If null
the current value will not change.y
- The value that will be transformed to pixels. If null
the current value will not change.public static void setUnrelatedGap(UnitValue x, UnitValue y)
x
- The value that will be transformed to pixels. If null
the current value will not change.y
- The value that will be transformed to pixels. If null
the current value will not change.public static void setParagraphGap(UnitValue x, UnitValue y)
x
- The value that will be transformed to pixels. If null
the current value will not change.y
- The value that will be transformed to pixels. If null
the current value will not change.public static void setIndentGap(UnitValue x, UnitValue y)
x
- The value that will be transformed to pixels. If null
the current value will not change.y
- The value that will be transformed to pixels. If null
the current value will not change.public static void setGridCellGap(UnitValue x, UnitValue y)
x
- The value that will be transformed to pixels. If null
the current value will not change.y
- The value that will be transformed to pixels. If null
the current value will not change.public static void setMinimumButtonWidth(UnitValue width)
width
- The recommended minimum button width.public static UnitValue getMinimumButtonWidth()
public static UnitValue getUnitValueX(java.lang.String unit)
unit
- The unit string.
null
for unrecognized units.public static UnitValue getUnitValueY(java.lang.String unit)
unit
- The unit string.
null
for unrecognized units.public static final void setUnitValue(java.lang.String[] unitStrings, UnitValue x, UnitValue y)
unitStrings
- The unit strings. E.g. "mu", "myunit". Will be converted to lower case and trimmed. Not null
.x
- The value for the horizontal dimension. If null
the value is not changed.y
- The value for the vertical dimension. Might be same object as for x
. If null
the value is not changed.public static final java.lang.String getButtonOrder()
setButtonOrder(String)
public static final void setButtonOrder(java.lang.String order)
Letter in upper case will get the minimum button width that the getMinimumButtonWidth()
specifies
and letters in lower case will get the width the corrent look&feel specifies.
Gaps will never be added to before the first component or after the last component. However, '+' (push) will be applied before and after as well, but with a minimum size of 0 if first/last so there will not be a gap before or after.
If gaps are explicitly set on buttons they will never be reduced, but they may be increased.
These are the characters that can be used:
'L'
- Buttons with this style tag will staticall end up on the left end of the bar.
'R'
- Buttons with this style tag will staticall end up on the right end of the bar.
'H'
- A tag for the "help" button that normally is supposed to be on the right.
'E'
- A tag for the "help2" button that normally is supposed to be on the left.
'Y'
- A tag for the "yes" button.
'N'
- A tag for the "no" button.
'X'
- A tag for the "next >" or "forward >" button.
'B'
- A tag for the "< back>" or "< previous" button.
'I'
- A tag for the "finish".
'A'
- A tag for the "apply" button.
'C'
- A tag for the "cancel" or "close" button.
'O'
- A tag for the "ok" or "done" button.
'U'
- All Uncategorized, Other, or "Unknown" buttons. Tag will be "other".
'+'
- A glue push gap that will take as much space as it can and at least an "unrelated" gap. (Platform dependant)
'_'
- (underscore) An "unrelated" gap. (Platform dependant)
Even though the style tags are normally applied to buttons this works with all components.
The normal style for MAC OS X is "L_HE+U+FBI_NYCOA_R"
and for Windows is "L_E+U+FBI_YNOCAH_R"
order
- The new button order for the current platform.public static BoundSize getGridGapX()
public static BoundSize getGridGapY()
public static UnitValue getDialogInsets(int side)
side
- top == 0, left == 1, bottom = 2, right = 3.
null
.public static void setDialogInsets(UnitValue top, UnitValue left, UnitValue bottom, UnitValue right)
top
- The top inset. May be null
.left
- The left inset. May be null
.bottom
- The bottom inset. May be null
.right
- The right inset. May be null
.public static UnitValue getPanelInsets(int side)
side
- top == 0, left == 1, bottom = 2, right = 3.
null
.public static void setPanelInsets(UnitValue top, UnitValue left, UnitValue bottom, UnitValue right)
top
- The top inset. May be null
.left
- The left inset. May be null
.bottom
- The bottom inset. May be null
.right
- The right inset. May be null
.public static float getLabelAlignPercentage()
public static InCellGapProvider getGapProvider()
null
if none is set and "related" should always be used.
null
if none is set and "related" should always be used.public static void setGapProvider(InCellGapProvider provider)
null
if none is set and "related" should always be used.
provider
- The current gap privider or null
if none is set and "related" should always be used.public static int getModCount()
public void invalidate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |