public class FixedCenterLayout extends Object implements LayoutManager2, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Component |
center |
protected Component |
east |
protected int |
hgap |
protected Component |
west |
| Constructor and Description |
|---|
FixedCenterLayout()
Constructs a new layout with no gap between components.
|
FixedCenterLayout(int hgap)
Constructs a layout with the specified gaps between components.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
Adds the specified component to the layout.
|
void |
addLayoutComponent(String name,
Component comp)
We are forced to support it by
LayoutManager. |
int |
getHgap()
Returns the horizontal gap between components.
|
float |
getLayoutAlignmentX(Container parent)
Returns the alignment along the x axis.
|
float |
getLayoutAlignmentY(Container parent)
Returns the alignment along the y axis.
|
void |
invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager
has cached information it should be discarded.
|
void |
layoutContainer(Container target)
Lays out the target argument using this layout.
|
Dimension |
maximumLayoutSize(Container target)
Determines the maximum size of the target.
|
Dimension |
minimumLayoutSize(Container target)
Determines the minimum size of the target.
|
Dimension |
preferredLayoutSize(Container target)
Determines the preferred size of the target.
|
void |
removeLayoutComponent(Component component)
Removes the specified component from this layout.
|
void |
setHgap(int hgap)
Sets the horizontal gap between components.
|
String |
toString()
Returns a string representation of the state of this layout.
|
protected int hgap
protected Component west
protected Component east
protected Component center
public FixedCenterLayout()
public FixedCenterLayout(int hgap)
hgap - numberpublic int getHgap()
public void setHgap(int hgap)
hgap - numberpublic void addLayoutComponent(Component comp, Object constraints)
addLayoutComponent in interface LayoutManager2comp - componentconstraints - objectpublic void addLayoutComponent(String name, Component comp)
LayoutManager.addLayoutComponent in interface LayoutManagername - stringcomp - componentpublic void removeLayoutComponent(Component component)
removeLayoutComponent in interface LayoutManagercomponent - componentpublic Dimension minimumLayoutSize(Container target)
minimumLayoutSize in interface LayoutManagertarget - containerpublic Dimension preferredLayoutSize(Container target)
preferredLayoutSize in interface LayoutManagertarget - containerpublic Dimension maximumLayoutSize(Container target)
maximumLayoutSize in interface LayoutManager2target - containerpublic float getLayoutAlignmentX(Container parent)
getLayoutAlignmentX in interface LayoutManager2parent - containerpublic float getLayoutAlignmentY(Container parent)
getLayoutAlignmentY in interface LayoutManager2parent - containerpublic void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2target - containerpublic void layoutContainer(Container target)
layoutContainer in interface LayoutManagertarget - containerCopyright © 2018. All rights reserved.