|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.CenterLayout
Layout that maintains a single component in the absolute center of the parent container.
This class is based on code posted by sapex to a Java Developer Connection forum on 21 June 2000. The JDC forums are available by following the link below.
| Field Summary | |
private Component |
c
The component to be maintained by this layout. |
| Constructor Summary | |
CenterLayout()
Constructs a new center layout. |
|
| Method Summary | |
void |
addLayoutComponent(Component component,
Object constraints)
Adds the given component to the layout by replacing the currently contained component with the given component. |
void |
addLayoutComponent(String name,
Component component)
Adds the given component to the layout. |
float |
getLayoutAlignmentX(Container target)
Returns the layout alignment along the x-axis. |
float |
getLayoutAlignmentY(Container target)
Returns the layout alignment along the y-axis. |
void |
invalidateLayout(Container target)
Invalidates the layout. |
void |
layoutContainer(Container parent)
Lays out the parent container by setting the bounds of the component it contains. |
Dimension |
maximumLayoutSize(Container parent)
Returns the maximum size for the parent container given the maximum size of the contained component. |
Dimension |
minimumLayoutSize(Container parent)
Returns the minimum size for the parent container given the minimum size of the contained component. |
Dimension |
preferredLayoutSize(Container parent)
Returns the preferred size for the parent container given the preferred size of the contained component. |
void |
removeLayoutComponent(Component component)
Removes the 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 |
private Component c
| Constructor Detail |
public CenterLayout()
| Method Detail |
public void addLayoutComponent(String name,
Component component)
addLayoutComponent in interface LayoutManagername - the name for this component (ignored)component - the component to be maintained
by this layout.addLayoutComponent(Component, Object)
public void addLayoutComponent(Component component,
Object constraints)
addLayoutComponent in interface LayoutManager2component - the component to be maintained
by this layout.constraints - the constraints affecting
this component in the layout (ignored)addLayoutComponent(String, Component)public void removeLayoutComponent(Component component)
removeLayoutComponent in interface LayoutManagercomponent - the component to remove
from this layoutpublic Dimension minimumLayoutSize(Container parent)
Dimension
with zero width and height.
minimumLayoutSize in interface LayoutManagerparent - the parent container using this layoutpublic Dimension preferredLayoutSize(Container parent)
Dimension
with zero width and height.
preferredLayoutSize in interface LayoutManagerparent - the parent container using this layoutpublic Dimension maximumLayoutSize(Container parent)
Dimension
with the maximum possible width and height.
maximumLayoutSize in interface LayoutManager2parent - the parent container using this layoutpublic void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerparent - the parent container using this layoutpublic float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2target - the target container for this layoutpublic float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2target - the target container for this layoutpublic void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2target - the target container for this layout
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||