|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EntryLayout
A simple layout manager, for Entry areas like:
Login: _______________ Password: _______________Basically two (or more) columns of different, but constant, widths.
Construct instances by passing an array of the column width percentages (as doubles, fractions from 0.1 to 0.9, so 40%,60% would be {0.4, 0.6}). The length of this array uniquely determines the number of columns. Columns are forced to be the relevant widths. As with GridLayout, the number of items added must be an even multiple of the number of columns. If not, exceptions may be thrown!
Field Summary | |
protected int |
COLUMNS
The number of columns. |
protected int |
hpad
The actual padding |
protected static int |
HPAD
The default padding |
protected boolean |
validWidths
True if the list of widths was valid. |
protected int |
vpad
The actual padding |
protected static int |
VPAD
The default padding |
protected double[] |
widthPercentages
The array of widths, as decimal fractions (0.4 == 40%, etc.). |
Constructor Summary | |
EntryLayout(double[] widths)
Construct an EntryLayout with widths and with default padding amounts. |
|
EntryLayout(double[] widths,
int h,
int v)
Construct an EntryLayout with widths and padding specified. |
Method Summary | |
void |
addLayoutComponent(String name,
Component comp)
Adds the specified component with the specified constraint to the layout. |
protected Dimension |
computelayoutSize(Container parent,
int hpad,
int vpad)
Compute the size of the whole mess. |
void |
layoutContainer(Container parent)
Lays out the container in the specified panel. |
Dimension |
minimumLayoutSize(Container parent)
Find the minimum Dimension for the specified container given the components therein. |
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected final double[] widthPercentages
protected final int COLUMNS
protected static final int HPAD
protected static final int VPAD
protected final int hpad
protected final int vpad
protected boolean validWidths
Constructor Detail |
public EntryLayout(double[] widths, int h, int v)
widths
- Array of doubles specifying column widths.h
- Horizontal padding between itemsv
- Vertical padding between itemspublic EntryLayout(double[] widths)
widths
- Array of doubles specifying column widths.Method Detail |
public void addLayoutComponent(String name, Component comp)
public void removeLayoutComponent(Component comp)
public void layoutContainer(Container parent)
public Dimension preferredLayoutSize(Container parent)
public Dimension minimumLayoutSize(Container parent)
protected Dimension computelayoutSize(Container parent, int hpad, int vpad)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |