|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bounce.FormLayout
public class FormLayout
A Layout manager that can be used to layout 2 columns of components.
The alignment and fill type of the columns can be set by using the
FormConstraint class.
A couple of predefined FormConstraint objects have been defined:
| Field Summary | |
|---|---|
static FormConstraints |
FULL
A constraint that allows the component to use the total width of the form. |
static FormConstraints |
FULL_FILL
A constraint that allows the component to use the total width of the form and resizes the component to fill the whole width. |
static FormConstraints |
LEFT
A constraint that adds the component to the left side of the form. |
static FormConstraints |
RIGHT
A constraint that adds the component to the right side of the form. |
static FormConstraints |
RIGHT_FILL
A constraint that adds the component to the right side of the form and resizes the component to fill the whole available width. |
| Constructor Summary | |
|---|---|
FormLayout()
Constructs a default FormLayout without any horizontal or vertical gaps. |
|
FormLayout(int hGap,
int vGap)
Constructs a FormLayout with the specified horizontal and vertical gap. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(java.awt.Component component,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Not used, components cannot be added without a constraint. |
int |
getHgap()
Returns the horizontal gap between the left column and the right column. |
float |
getLayoutAlignmentX(java.awt.Container target)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(java.awt.Container target)
Returns the alignment along the y axis. |
int |
getVgap()
Returns the vertical gap between the rows. |
void |
invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(java.awt.Container parent)
Lays out the components on the specified container. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum size of this component. |
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 container given the components in the specified parent container. |
void |
removeLayoutComponent(java.awt.Component component)
Removes the specified component and constraints from the layout. |
void |
setConstraints(java.awt.Component component,
java.lang.Object constraint)
Adds the specified component to the layout, using the specified constraint object. |
void |
setHgap(int hGap)
Sets the horizontal gap between the left column and the right column. |
void |
setVgap(int vGap)
Returns the vertical gap between the rows. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final FormConstraints LEFT
public static final FormConstraints RIGHT
public static final FormConstraints RIGHT_FILL
public static final FormConstraints FULL
public static final FormConstraints FULL_FILL
| Constructor Detail |
|---|
public FormLayout()
public FormLayout(int hGap,
int vGap)
hGap - the horizontal gap between the left and right components.vGap - the vertical gap between the rows.| Method Detail |
|---|
public int getHgap()
public void setHgap(int hGap)
hGap - the horizontal gap between the columnspublic int getVgap()
public void setVgap(int vGap)
vGap - the vertical gap between the rows
public void setConstraints(java.awt.Component component,
java.lang.Object constraint)
component - the component added to the parent container.constraint - the constraint for the added component.public void removeLayoutComponent(java.awt.Component component)
removeLayoutComponent in interface java.awt.LayoutManagercomponent - the component to be removedpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize in interface java.awt.LayoutManagerparent - the component to be laid out.
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize in interface java.awt.LayoutManagerparent - the component to be laid out
public void layoutContainer(java.awt.Container parent)
layoutContainer in interface java.awt.LayoutManagerparent - the component which needs to be laid out
public void addLayoutComponent(java.awt.Component component,
java.lang.Object constraints)
addLayoutComponent in interface java.awt.LayoutManager2component - the component to be addedconstraints - where/how the component is added to the layout.public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize in interface java.awt.LayoutManager2target - the component to be laid out
Component.getMinimumSize(),
Component.getPreferredSize()public float getLayoutAlignmentX(java.awt.Container target)
getLayoutAlignmentX in interface java.awt.LayoutManager2target - the container to calculate X alignment for.
public float getLayoutAlignmentY(java.awt.Container target)
getLayoutAlignmentY in interface java.awt.LayoutManager2target - the container to calculate Y alignment for.
public void invalidateLayout(java.awt.Container target)
invalidateLayout in interface java.awt.LayoutManager2target - the container.
public void addLayoutComponent(java.lang.String name,
java.awt.Component comp)
addLayoutComponent in interface java.awt.LayoutManagername - the component name.comp - the component.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||