LayoutStyle that returns 6 for related
components, otherwise 12. This class also provides helper methods for
subclasses.
| Modifier and Type | Field and Description |
|---|---|
| private static final DefaultLayoutStyle |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| protected int | |
| protected int | Returns: offset - border/margin around the component.First component source, JComponent Second component target, int Position doing layout along. position, int Ideal offset, not including border/margin offset)For some look and feels check boxes and radio buttons typically don't paint the border, yet they have padding for a border. |
| protected int | Returns: offset - border/margin around the component.Component source, int Position doing layout along. position, int Ideal offset, not including border/margin offset)For some look and feels check boxes and radio buttons typically don't paint the border, yet they have padding for a border. |
| public int | getButtonGap(JComponent c, int position)
If |
| public int | getContainerGap(JComponent component, int position, Container parent)
Implements abstract javax. Returns the amount of space to place between the component and specified edge of its parent. |
| private Icon | |
| protected int | getIndent(JComponent c, int position)
Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton. |
| private int | |
| private int | |
| public static LayoutStyle | |
| public int | getPreferredGap(JComponent component1, JComponent component2, LayoutStyle.
Implements abstract javax. Returns the amount of space to use between two components. |
| protected boolean | isLabelAndNonlabel(JComponent c1, JComponent c2, int position)
Returns true if the classes identify a JLabel and a non-JLabel along the horizontal axis. |
| private boolean | |
| private boolean |
| INSTANCE | back to summary |
|---|---|
| private static final DefaultLayoutStyle INSTANCE | |
| DefaultLayoutStyle | back to summary |
|---|---|
| public DefaultLayoutStyle() | |
| checkPosition | back to summary |
|---|---|
| private void checkPosition(int position) | |
| flipDirection | back to summary |
|---|---|
| protected int flipDirection(int position) | |
| getButtonGap | back to summary |
|---|---|
| protected int getButtonGap(JComponent source, JComponent target, int position, int offset) For some look and feels check boxes and radio buttons typically don't paint the border, yet they have padding for a border. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
| |
| getButtonGap | back to summary |
|---|---|
| protected int getButtonGap(JComponent source, int position, int offset) For some look and feels check boxes and radio buttons typically don't paint the border, yet they have padding for a border. Look and feel guidelines generally don't include this space. Use this method to subtract this space from the specified components.
| |
| getButtonGap | back to summary |
|---|---|
| public int getButtonGap(JComponent c, int position) If | |
| getContainerGap | back to summary |
|---|---|
| public int getContainerGap(JComponent component, int position, Container parent) Implements abstract javax. Doc from javax. Returns the amount of space to place between the component and specified edge of its parent.
| |
| getIcon | back to summary |
|---|---|
| private Icon getIcon(AbstractButton button) | |
| getIndent | back to summary |
|---|---|
| protected int getIndent(JComponent c, int position) Returns the amount to indent the specified component if it's a JCheckBox or JRadioButton. If the component is not a JCheckBox or JRadioButton, 0 will be returned. | |
| getInset | back to summary |
|---|---|
| private int getInset(JComponent c, int position) | |
| getInset | back to summary |
|---|---|
| private int getInset(Insets insets, int position) | |
| getInstance | back to summary |
|---|---|
| public static LayoutStyle getInstance() Hides javax. Doc from javax. Returns the shared instance of | |
| getPreferredGap | back to summary |
|---|---|
| public int getPreferredGap(JComponent component1, JComponent component2, LayoutStyle. Implements abstract javax. Doc from javax. Returns the amount of space to use between two components.
The return value indicates the distance to place
int gap = getPreferredGap(component1, component2,
ComponentPlacement.RELATED,
SwingConstants.NORTH, parent);
The type parameter indicates the relation between
the two components. If the two components will be contained in
the same parent and are showing similar logically related
items, use RELATED. If the two components will be
contained in the same parent but show logically unrelated items
use UNRELATED. Some look and feels may not
distinguish between the RELATED and
UNRELATED types.
The return value is not intended to take into account the
current size and position of
| |
| isLabelAndNonlabel | back to summary |
|---|---|
| protected boolean isLabelAndNonlabel(JComponent c1, JComponent c2, int position) Returns true if the classes identify a JLabel and a non-JLabel along the horizontal axis. | |
| isLeftAligned | back to summary |
|---|---|
| private boolean isLeftAligned(AbstractButton button, int position) | |
| isRightAligned | back to summary |
|---|---|
| private boolean isRightAligned(AbstractButton button, int position) | |