|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.PingOO.DLAI.lib.PWidget.FormLayout
A layout manager modeled after the HTML <TABLE> tag.
Components are added to a specified row and column, and can span multiple rows.
Column widths are calculated in layoutComponents(), and adjustments for compacting forms can be made with mode parameters.
Basic Design:
Separate interleaved objects called FormRowLayout and FormColumnLayout manage the horizontal and vertical layout settings, respectively.
The objects do not speak to each other.
RowLeader and ColumnLeader sit here in FormLayout and have access to all Rows and all Columns, respectively ; they are responsible for coordinating addition of new Rows and Columns, which are organized as linked lists.
A floating point scheme is used to deal with extra space.
See the HTML documentation for details about the interface and behavior.
| Inner Class Summary | |
private class |
FormLayout.ColumnLeader
oversees and coordinates FormColumnLayout`s |
protected static class |
FormLayout.ExtendedVector
|
private class |
FormLayout.RowLeader
Oversees and coordinates FormRowLayouts. |
| Field Summary | |
static int |
DEFAULT
Specifies default alignment for the associated component (used in the FormLayout.add() methods). |
static int |
FREE_FIELD
Special alignment: the associated field will not align with other fields in this column (used in certain FormLayout.add() methods). |
static int |
FREE_LABEL
Special alignment: the associated label will not align with other labels in this column (used in certain FormLayout.add() methods). |
static int |
LABEL_ON_TOP
Special alignment: the label and field will appear in subsequent columns, starting with the one specified (used in certain FormLayout.add() methods). |
private FormLayout.ColumnLeader |
m_ColumnLeader
|
private FormLayout.ExtendedVector |
m_Columns
|
private java.awt.Container |
m_container
|
private int |
m_externalHGap
|
private int |
m_externalVGap
|
private int |
m_hgap
|
private double |
m_pct
|
private FormLayout.RowLeader |
m_RowLeader
|
private int |
m_vgap
|
| Constructor Summary | |
FormLayout()
Creates a new layout. |
|
FormLayout(int internalHGap,
int internalVGap,
int externalHGap,
int externalVGap)
Creates a layout with most specific gap access available. |
|
| Method Summary | |
void |
add(java.awt.Component label,
java.awt.Component field,
int row,
int column)
Adds label and field with alignment respective to the other labels and fields in column. |
void |
add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
double fillRightPct)
Addq label and field with alignment respective to the other labels and fields in column, and will stretch as far as preferredSize.width * fillRightPct to right justify. |
void |
add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
int mode)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode. |
void |
add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
int mode,
double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and will stretch as far as preferredSize.width * fillRightPct to right justify. |
void |
add(java.awt.Component component,
int row,
int column)
Adds a component that will align with the labels in column. |
void |
add(java.awt.Component component,
int row,
int column,
double fillRightPct)
Adds a component that will align with the labels in column, and will stretch as far as preferredSize.width * fillRightPct to right justify. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Terminated ancestor method. |
void |
addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column)
Adds label and field with alignment respective to the other labels and fields in column. and span from startRow to endRow. |
void |
addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side. |
void |
addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
int mode)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and span from startRow to endRow. |
void |
addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
int mode,
double fillRightPct)
Adds label and field with alignment respective to the other labels and fields in column, subject to the specified mode, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side. |
void |
addMultiRow(java.awt.Component component,
int startRow,
int endRow,
int column)
Adds a component that will align with the labels in column, and span from startRow to endRow. |
void |
addMultiRow(java.awt.Component component,
int startRow,
int endRow,
int column,
double fillRightPct)
Adds a component that will align with the labels in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side. |
protected int |
getBottomInset()
Returns the bottom inset. |
protected FormColumnLayout |
getColumn(int column)
Returns the FormColumnLayout for "column"; create it if it doesn't exist |
double |
getDefaultFillRightPct()
Returns the default value. |
int |
getExternalHGap()
Returns the external horizontal gap. |
int |
getExternalVGap()
Returns the external vertical gap. |
int |
getInternalHGap()
Returns the internal horizontal gap. |
int |
getInternalVGap()
Returns the internal vertical gap. |
protected int |
getLeftInset()
Returns the left inset. |
protected int |
getRightInset()
Returns the right inset. |
protected int |
getTopInset()
Returns the top inset. |
private void |
init()
Initializes datas. |
void |
layoutContainer(java.awt.Container parent)
Lays out the container in the specified panel. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(java.awt.Component component)
Removes the specified component from the layout. |
void |
setDefaultFillRightPct(double fillRightPct)
All subsequent add() calls that do not specify fillRightPct will use this fillRightPct. |
void |
setExternalHGap(int gap)
Sets the external horizontal gap. |
void |
setExternalVGap(int gap)
Sets the external vertical gap. |
void |
setInternalHGap(int gap)
Sets the internal horizontal gap. |
void |
setInternalVGap(int gap)
Sets the internal vertical gap. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private int m_hgap
private int m_vgap
private int m_externalHGap
private int m_externalVGap
private double m_pct
private FormLayout.ExtendedVector m_Columns
private FormLayout.ColumnLeader m_ColumnLeader
private FormLayout.RowLeader m_RowLeader
private java.awt.Container m_container
public static final int DEFAULT
FormLayout.add() methods).public static final int FREE_LABEL
FormLayout.add() methods).public static final int FREE_FIELD
FormLayout.add() methods).public static final int LABEL_ON_TOP
FormLayout.add() methods).| Constructor Detail |
public FormLayout()
public FormLayout(int internalHGap,
int internalVGap,
int externalHGap,
int externalVGap)
internalHGap - internalVGap - externalHGap - externalVGap - | Method Detail |
protected int getLeftInset()
protected int getRightInset()
protected int getTopInset()
protected int getBottomInset()
public int getInternalHGap()
public int getInternalVGap()
public int getExternalHGap()
public int getExternalVGap()
public void setInternalVGap(int gap)
gap - The internal vertical gap.public void setInternalHGap(int gap)
gap - The internal horizontal gap.public void setExternalVGap(int gap)
gap - The external vertical gap.public void setExternalHGap(int gap)
gap - The external horizontal gap.private void init()
public void layoutContainer(java.awt.Container parent)
parent - The component which needs to be laid out.public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
parent - The component to be laid outpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
parent - The component to be laid out.public void removeLayoutComponent(java.awt.Component component)
comp - The component ot be removed.
public void add(java.awt.Component component,
int row,
int column)
component that will align with the labels in column.component - The component to be added.row - The row where to put the component.column - The column where to put the component.
public void add(java.awt.Component label,
java.awt.Component field,
int row,
int column)
label and field with alignment respective to the other labels and fields in column.label - The label to be associated with the field.field - The field to be associated with the label.row - The row where to put the components.colum - The column where to put the components.
public void add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
int mode)
label and field with alignment respective to the other labels and fields in column, subject to the specified mode.label - The label to be associated with the field.field - The field to be associated with the label.row - The row where to put the components.colum - The column where to put the components.mode - The mode used.
public void addMultiRow(java.awt.Component component,
int startRow,
int endRow,
int column)
component that will align with the labels in column, and span from startRow to endRow.component - The component to be added.startRow - The first row where to add the component.endRow - The last row where to add the component.column - The column where to add the component.
public void addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column)
label and field with alignment respective to the other labels and fields in column. and span from startRow to endRow.label - The label to be associated with the field.field - The field to be associated with the label.startRow - The first row where to add the components.endRow - The last row where to add the components.column - The column where to add the components.
public void addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
int mode)
label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and span from startRow to endRow.label - The label to be associated with the field.field - The field to be associated with the label.startRow - The first row where to add the components.endRow - The last row where to add the components.column - The column where to add the components.mode - The mode to use.
public void add(java.awt.Component component,
int row,
int column,
double fillRightPct)
component that will align with the labels in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.component - The component to be added.row - The row where to insert this component.column - The column where to insert this component.fillRightPct -
public void add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
double fillRightPct)
label and field with alignment respective to the other labels and fields in column, and will stretch as far as preferredSize.width * fillRightPct to right justify.label - The label to be associated with the field.field - The field to be associated with the label.row - The row where to insert this component.column - The column where to insert this component.fillRightPct -
public void add(java.awt.Component label,
java.awt.Component field,
int row,
int column,
int mode,
double fillRightPct)
label and field with alignment respective to the other labels and fields in column, subject to the specified mode, and will stretch as far as preferredSize.width * fillRightPct to right justify.label - The label to be associated with the field.field - The field to be associated with the label.row - The row where to insert this component.column - The column where to insert this component.mode - The mode to use.fillRightPct -
public void addMultiRow(java.awt.Component component,
int startRow,
int endRow,
int column,
double fillRightPct)
component that will align with the labels in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.component - The component to be added.startRow - The first row where to add the components.endRow - The last row where to add the components.column - The column where to insert this component.fillRightPct -
public void addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
double fillRightPct)
label and field with alignment respective to the other labels and fields in column, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.label - The label to be associated with the field.field - The field to be associated with the label.startRow - The first row where to add the components.endRow - The last row where to add the components.column - The column where to insert this component.fillRightPct -
public void addMultiRow(java.awt.Component label,
java.awt.Component field,
int startRow,
int endRow,
int column,
int mode,
double fillRightPct)
label and field with alignment respective to the other labels and fields in column, subject to the specified mode, will span from startRow to endRow, and will stretch as far as preferredSize.width * fillRightPct to reach the right side.label - The label to be associated with the field.field - The field to be associated with the label.startRow - The first row where to add the components.endRow - The last row where to add the components.column - The column where to insert this component.mode - the mode to use.fillRightPct - public void setDefaultFillRightPct(double fillRightPct)
add() calls that do not specify fillRightPct will use this fillRightPct.fillRightPct - public double getDefaultFillRightPct()
protected FormColumnLayout getColumn(int column)
public void addLayoutComponent(java.lang.String name,
java.awt.Component comp)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||