|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.forms.util.LayoutStyle
public abstract class LayoutStyle
An abstract class that describes a layout and design style guide. It provides constants used to lay out panels consistently.
This class is work in progress and the API may change without notice.
Therefore it is recommended to not write custom subclasses
for production code.
A future version of this class will likely collaborate with a class
LogicalSize
or StyledSize
.
MacLayoutStyle
,
WindowsLayoutStyle
,
FormFactory
,
Borders
Field Summary | |
---|---|
private static LayoutStyle |
current
Holds the current layout style. |
Constructor Summary | |
---|---|
LayoutStyle()
|
Method Summary | |
---|---|
abstract ConstantSize |
getButtonBarPad()
Returns a pad used to separate a button bar from a component. |
static LayoutStyle |
getCurrent()
Returns the current LayoutStyle . |
abstract Size |
getDefaultButtonHeight()
Returns this style's default button height. |
abstract Size |
getDefaultButtonWidth()
Returns this style's default button width. |
abstract ConstantSize |
getDialogMarginX()
Returns this style's horizontal margin for general dialogs. |
abstract ConstantSize |
getDialogMarginY()
Returns this style's vertical margin for general dialogs. |
abstract ConstantSize |
getLabelComponentPadX()
Returns a gap used to separate a label and associated control. |
abstract ConstantSize |
getLinePad()
Returns a narrow vertical pad used to separate lines. |
abstract ConstantSize |
getNarrowLinePad()
Returns a narrow vertical pad used to separate lines. |
abstract ConstantSize |
getParagraphPad()
Returns a pad used to separate paragraphs. |
abstract ConstantSize |
getRelatedComponentsPadX()
Returns a horizontal gap used to separate related controls. |
abstract ConstantSize |
getRelatedComponentsPadY()
Returns a vertical gap used to separate related controls. |
private static java.lang.String |
getSystemProperty(java.lang.String key)
Tries to look up the System property for the given key. |
abstract ConstantSize |
getTabbedDialogMarginX()
Returns this style's horizontal margin for dialogs that consist of a tabbed pane. |
abstract ConstantSize |
getTabbedDialogMarginY()
Returns this style's vertical margin for dialogs that consist of a tabbed pane. |
abstract ConstantSize |
getUnrelatedComponentsPadX()
Returns a horizontal gap used to separate unrelated controls. |
abstract ConstantSize |
getUnrelatedComponentsPadY()
Returns a vertical gap used to separate unrelated controls. |
private static LayoutStyle |
initialLayoutStyle()
Computes and returns the initial LayoutStyle . |
abstract boolean |
isLeftToRightButtonOrder()
Checks and answers whether buttons are typically ordered from left to right or from right to left. |
private static boolean |
isOSMac()
Checks and answers whether Java runs on a Mac by requesting the system property os.name. |
static void |
setCurrent(LayoutStyle newLayoutStyle)
Set a new LayoutStyle . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static LayoutStyle current
Constructor Detail |
---|
public LayoutStyle()
Method Detail |
---|
private static LayoutStyle initialLayoutStyle()
LayoutStyle
.
Checks the OS name and returns MacLayoutStyle
on Mac OS X and WindowLayoutStyle
on all other platforms.
private static boolean isOSMac()
private static java.lang.String getSystemProperty(java.lang.String key)
null
.
key
- the name of the system property
public static LayoutStyle getCurrent()
LayoutStyle
.
LayoutStyle
public static void setCurrent(LayoutStyle newLayoutStyle)
LayoutStyle
.
newLayoutStyle
- the style to be setpublic abstract Size getDefaultButtonWidth()
getDefaultButtonHeight()
public abstract Size getDefaultButtonHeight()
getDefaultButtonWidth()
public abstract ConstantSize getDialogMarginX()
getDialogMarginY()
,
getTabbedDialogMarginX()
public abstract ConstantSize getDialogMarginY()
getDialogMarginX()
,
getTabbedDialogMarginY()
public abstract ConstantSize getTabbedDialogMarginX()
getTabbedDialogMarginY()
,
getDialogMarginX()
public abstract ConstantSize getTabbedDialogMarginY()
getTabbedDialogMarginX()
,
getDialogMarginY()
public abstract ConstantSize getLabelComponentPadX()
getRelatedComponentsPadX()
,
getUnrelatedComponentsPadX()
public abstract ConstantSize getRelatedComponentsPadX()
getLabelComponentPadX()
,
getRelatedComponentsPadY()
,
getUnrelatedComponentsPadX()
public abstract ConstantSize getRelatedComponentsPadY()
getRelatedComponentsPadX()
,
getUnrelatedComponentsPadY()
public abstract ConstantSize getUnrelatedComponentsPadX()
getLabelComponentPadX()
,
getUnrelatedComponentsPadY()
,
getRelatedComponentsPadX()
public abstract ConstantSize getUnrelatedComponentsPadY()
getUnrelatedComponentsPadX()
,
getRelatedComponentsPadY()
public abstract ConstantSize getNarrowLinePad()
getLinePad()
,
getParagraphPad()
public abstract ConstantSize getLinePad()
getNarrowLinePad()
,
getParagraphPad()
public abstract ConstantSize getParagraphPad()
getNarrowLinePad()
,
getLinePad()
public abstract ConstantSize getButtonBarPad()
getRelatedComponentsPadY()
,
getUnrelatedComponentsPadY()
public abstract boolean isLeftToRightButtonOrder()
For example the Windows style guide recommends to layout out OK, Cancel, Apply from left to right, where the Mac Aqua style guide recommends to layout out these buttons from right to left.
Although most button sequences shall honor this order some buttons require a left to right order. For example Back, Next or Move Left, Move Right.
ButtonBarBuilder
,
ButtonBarFactory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |