public final class GuiStackLayout
extends java.lang.Object
implements java.io.Serializable, java.awt.LayoutManager
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.
By default, a component is centered in both directions. The available space
along the orientation is divided between the filled components. A common
idiom is to build a complicated panel out of, say, a vertical stack of
horizontal stacks (both using GuiStackLayout). In that case, it would usually
be good to add the horizontal panels using the tag "Wide Flush", so that
spacing comes out evenly.
Much of what can be done with GridBagLayout can be achieved by combining a set of subpanels using GuiStackLayout, but typically more concisely. On the other hand, with GuiStackLayout there is less compile time checking of the layout.
Compare jv.object.PsStackLayoutfor a much
lighter implementation.
PsStackLayout,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
HORIZONTAL
Deprecated.
The orientation constant for horizontal layouts.
|
static int |
VERTICAL
Deprecated.
The orientation constant for vertical layouts.
|
| Constructor and Description |
|---|
GuiStackLayout()
Deprecated.
Create a horizontal StackLayout.
|
GuiStackLayout(int orientation)
Deprecated.
Create a StackLayout with the given orientation.
|
GuiStackLayout(int orientation,
int margin)
Deprecated.
Create a StackLayout with the given orientation and space between
components.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLayoutComponent(java.lang.String tag,
java.awt.Component comp)
Deprecated.
Add the specified component to the layout, parsing the layout tag.
|
void |
layoutContainer(java.awt.Container parent)
Deprecated.
Lays out the specified container.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Deprecated.
Calculate the minimum size dimensions for the specififed container.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Deprecated.
Calculate the preferred size dimensions for the specififed container.
|
void |
removeLayoutComponent(java.awt.Component comp)
Deprecated.
Remove the specified component from the layout.
|
public static final int HORIZONTAL
public static final int VERTICAL
public GuiStackLayout()
public GuiStackLayout(int orientation)
public GuiStackLayout(int orientation,
int margin)
public void addLayoutComponent(java.lang.String tag,
java.awt.Component comp)
addLayoutComponent in interface java.awt.LayoutManagerpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent in interface java.awt.LayoutManagerpublic java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize in interface java.awt.LayoutManagerpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize in interface java.awt.LayoutManagerpublic void layoutContainer(java.awt.Container parent)
layoutContainer in interface java.awt.LayoutManager"