public abstract class AbstractLayout extends Object implements LayoutManager2, Serializable
The GNU General Public License for details.
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected int |
hgap
horizontal gap
|
private static long |
serialVersionUID
Serialization ID
|
protected int |
vgap
vertical gap
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractLayout()
Defaults the horizontal and vertical gaps to 0
|
protected |
AbstractLayout(int hgap,
int vgap)
Constructor that specifies the horizontal and vertical gaps
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
Add the specified component from the layout.
|
void |
addLayoutComponent(String name,
Component comp)
Adds the specified component with the specified name to the layout.
|
int |
getHgap()
Get 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.
|
int |
getVgap()
Get the vertical gap between components.
|
void |
invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached
information it should be discarded.
|
Dimension |
maximumLayoutSize(Container target)
Returns the maximum dimensions for this layout given the component in the
specified target container.
|
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
void |
setHgap(int gap)
Set the horizontal gap between components.
|
void |
setVgap(int gap)
Set the vertical gap between components.
|
String |
toString()
Return a string representation of the layout manager
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
layoutContainer, minimumLayoutSize, preferredLayoutSize
protected int hgap
protected int vgap
private static final long serialVersionUID
protected AbstractLayout()
protected AbstractLayout(int hgap, int vgap)
public final int getHgap()
public final int getVgap()
public final void setHgap(int gap)
gap
- The horizontal gap to be setpublic final void setVgap(int gap)
gap
- The vertical gap to be setpublic Dimension maximumLayoutSize(Container target)
maximumLayoutSize
in interface LayoutManager2
target
- The component which needs to be laid outpublic float getLayoutAlignmentX(Container parent)
getLayoutAlignmentX
in interface LayoutManager2
public float getLayoutAlignmentY(Container parent)
getLayoutAlignmentY
in interface LayoutManager2
public void invalidateLayout(Container target)
invalidateLayout
in interface LayoutManager2
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
name
- The name of the componentcomp
- The component to be addedpublic void addLayoutComponent(Component comp, Object constraints)
addLayoutComponent
in interface LayoutManager2
comp
- The component to be addedconstraints
- The constraints to apply when laying out.public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
comp
- the component to be removed