|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.darwinsys.swingui.layout.ColumnLayout
public class ColumnLayout
ColumnLayout, a Single-Column Layout Manager for AWT/Swing. Sort of a cross between BoxLayout and GridLayout(0, x). Displays components in a single row or column based on the alignment given to the constructor, with optional padding.
There is a utility method for adding space between the previous and next components, which (like Menu.addSeparator()) adds a fixed-size non-visible component between two added components.
Note: The current version of ColumnLayout doesn't resize.
Nested Class Summary | |
---|---|
protected static class |
ColumnLayout.Spacer
Class to represent a spacer, like Menubar.separator. |
Field Summary | |
---|---|
protected int |
alignment
The alignment for this ColumnLayout |
protected int |
hPadding
The X padding for this ColumnLayout |
protected int |
minh
The minimum height of each component |
protected int |
minw
The minimum width of each component |
protected int |
vPadding
The Y padding for this ColumnLayout |
static int |
X_AXIS
Constant for X AXIS (horizontal column) alignment |
static int |
Y_AXIS
Constant for Y AXIS (vertical column) alignment |
Constructor Summary | |
---|---|
ColumnLayout(int dirn)
Construct a ColumnLayout given only an alignment. |
|
ColumnLayout(int dirn,
int pad)
Construct a ColumnLayout given an alignment and a padding amount. |
|
ColumnLayout(int dirn,
int hpad,
int vpad)
Construct a ColumnLayout given an alignment and h,v padding amounts. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component c)
Called by AWT when the user uses the form add(name, Component). |
void |
addSpacer(java.awt.Container target)
Utility method to add a "spacer" |
protected java.awt.Dimension |
doLayout(java.awt.Container target)
Used internally: compute the layout and the maximal preferred width & height TODO XXX NEED TO SCALE BY TARGSIZE? |
void |
layoutContainer(java.awt.Container target)
Called by AWT to lay out the components in the target Container at its current size. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Called from AWT to calculate the minimum size dimensions for the target panel given the components in it. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Called by AWT to compute the preferred size for the target panel given our list of the components that it contains. |
void |
removeLayoutComponent(java.awt.Component c)
Called by AWT to remove a given component from the layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int X_AXIS
public static final int Y_AXIS
protected final int alignment
protected final int hPadding
protected final int vPadding
protected int minw
protected int minh
Constructor Detail |
---|
public ColumnLayout(int dirn)
public ColumnLayout(int dirn, int pad)
public ColumnLayout(int dirn, int hpad, int vpad)
Method Detail |
---|
public void addLayoutComponent(java.lang.String name, java.awt.Component c)
addLayoutComponent
in interface java.awt.LayoutManager
name
- String with location for component cc
- Component to be added.public void layoutContainer(java.awt.Container target)
layoutContainer
in interface java.awt.LayoutManager
target
- Container whose components are to be laid out.protected java.awt.Dimension doLayout(java.awt.Container target)
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
target
- Container to calculate forpublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
target
- Container to calculate forpublic void addSpacer(java.awt.Container target)
public void removeLayoutComponent(java.awt.Component c)
removeLayoutComponent
in interface java.awt.LayoutManager
c
- Component to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |