| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
**************************************************************************
StackLayout is a LayoutManager that arranges components in a vertical
(or horizontal) strip aligning them at right, left or centered, and/or
filling them to take up any extra vertical or horizontal space.
Arrangement tags are provided by using the add(tag,component) form to
add components to the container.
The tag consists of one or more of the following, with the two forms applying
to horizontal or vertical dimension.
Positioning:
"Center" : centered horizontally & vertically (the default)
"Left" or "Top" : pushed at the left|top edge.
"Right" or "Bottom" : pushed against the right|top edge
Sizing:
"Wide" or "Tall" : filled to use available space.
"Wide*#" or "Tall*#" : filled but weighted by the number #.
"Fill" (or "Fill*#") : filled in both directions.
"Width=#" or "Height=#" : given explicit width|height
Margins:
"Flush" : margins are not added around this component.
"FlushV" : margins are not added to top and bottom edges of this component.
"FlushH" : margins are not added to left and right edges of this component.
"FlushTop" : margins are not added to top edge of this component.
"FlushBottom" : margins are not added to bottom edge of this component.
"FlushLeft" : margins are not added to left edge of this component.
"FlushRight" : margins are not added to right edge of this component.
Much of what can be done with GridBagLayout can be achieved by combining
a set of subpanels using StackLayout, but typically more concisely.
On the other hand, with StackLayout there is less compile time checking
of the layout.
| Field Summary | |
(package private) final static int | ABS |
(package private) final static int | BACK |
(package private) final static int | CENTER |
(package private) Hashtable | codeTable |
(package private) int[] | defaultCode |
(package private) final static int | FILL |
(package private) final static int | FLUSH |
(package private) final static int | FLUSHLEFT |
(package private) final static int | FLUSHRIGHT |
(package private) final static int | FRONT |
final static int | HORIZONTALThe orientation constant for horizontal layouts. |
(package private) int | margin |
(package private) int | orientation |
(package private) final static int | POSMASK |
(package private) final static int | SIZEMASK |
final static int | VERTICALThe orientation constant for vertical layouts. |
| Constructor Summary | |
StackLayout()Create a horizontal StackLayout. | |
StackLayout(int orientation)Create a StackLayout with the given orientation. | |
StackLayout(int orientation, int margin)Create a StackLayout with the given orientation and space between components. | |
| Method Summary | |
void | addLayoutComponent(String tag, Component comp)Add the specified component to the layout, parsing the layout tag. |
(package private) Dimension | computeLayoutSize(Container parent, boolean preferred) |
(package private) int | countDigits(String tag, int i) |
(package private) int[] | getCode(Component comp) |
void | layoutContainer(Container parent)Lays out the specified container. |
Dimension | minimumLayoutSize(Container parent)Calculate the minimum size dimensions for the specififed container. |
(package private) int | parseArg(String tag, int i, int n) |
Dimension | preferredLayoutSize(Container parent)Calculate the preferred size dimensions for the specififed container. |
void | removeLayoutComponent(Component comp)Remove the specified component from the layout. |
(package private) boolean | stretches(Component comp) |
| Field Detail |
final static int ABS
final static int BACK
final static int CENTER
Hashtable codeTable
int[] defaultCode
final static int FILL
final static int FLUSH
final static int FLUSHLEFT
final static int FLUSHRIGHT
final static int FRONT
public final static int HORIZONTAL
int margin
int orientation
final static int POSMASK
final static int SIZEMASK
public final static int VERTICAL
| Constructor Detail |
public StackLayout()
public StackLayout(int orientation)
public StackLayout(int orientation, int margin)
| Method Detail |
public void addLayoutComponent(String tag, Component comp)
Dimension computeLayoutSize(Container parent, boolean preferred)
int countDigits(String tag, int i)
int[] getCode(Component comp)
public void layoutContainer(Container parent)
public Dimension minimumLayoutSize(Container parent)
int parseArg(String tag, int i, int n)
public Dimension preferredLayoutSize(Container parent)
public void removeLayoutComponent(Component comp)
boolean stretches(Component comp)
| Association Links |
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||