|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bounce.CenterLayout
public class CenterLayout
A Layout manager that can be used to layout 3 components, one component in the center that does not resize, and a component on either side that take up the rest of the available space. The orientation can be Vertical or Horizontal.
| Field Summary | |
|---|---|
static java.lang.String |
BOTTOM
A constraint that adds the component to the right/bottom. |
static java.lang.String |
CENTER
A constraint that adds the component to the center. |
static int |
HORIZONTAL
Sets the layout orientation to horizontal. |
static java.lang.String |
LEFT
A constraint that adds the component to the left/top. |
static java.lang.String |
RIGHT
A constraint that adds the component to the right/bottom. |
static java.lang.String |
TOP
A constraint that adds the component to the left/top. |
static int |
VERTICAL
Sets the layout orientation to vertical. |
| Constructor Summary | |
|---|---|
CenterLayout()
Constructs a default CenterLayout without a gap and with a horizontal orientation. |
|
CenterLayout(int orientation)
Constructs a CenterLayout with the orientation supplied and with no gap between the components. |
|
CenterLayout(int orientation,
int gap)
Constructs a CenterLayout with the gap and orientation supplied. |
|
| 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 |
getGap()
Returns the gap between the components. |
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 |
getOrientation()
Returns the orientation of the layout manager. |
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 |
setGap(int gap)
Sets the gap between the components. |
void |
setOrientation(int orientation)
Sets the orientation of the layout manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CENTER
public static final java.lang.String TOP
public static final java.lang.String LEFT
public static final java.lang.String BOTTOM
public static final java.lang.String RIGHT
public static final int HORIZONTAL
public static final int VERTICAL
| Constructor Detail |
|---|
public CenterLayout()
public CenterLayout(int orientation)
orientation - the orientation of the components.
public CenterLayout(int orientation,
int gap)
orientation - the orientation of the components.gap - the space between the components.| Method Detail |
|---|
public int getGap()
public void setGap(int gap)
gap - the gap.public int getOrientation()
public void setOrientation(int orientation)
orientation - the orientation.
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 container to calculate the maximum size for.
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 | |||||||||