|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.lw.LwBorderLayout
The class implements layout manager interface. The layout divides container area
into five parts: North
, South
, East
,
West
, and Center
. To add a component to a container
with the border layout, use one of constants of this layout manager as the constraints,
for example:
... LwContainer c = new LwPanel(); c.setLwLayout(new LwBorderLayout()); c.add(LwBorderLayout.SOUTH, new LwButton("South")); ...The image below shows how the five buttons have been laid out with the border layout manager inside the container:
Field Summary | |
static java.lang.Object |
CENTER
The center layout constraint (middle of container). |
static java.lang.Object |
EAST
The east layout constraint (left side of container). |
static java.lang.Object |
NORTH
The north layout constraint (top of container). |
static java.lang.Object |
SOUTH
The south layout constraint (bottom of container). |
static java.lang.Object |
WEST
The west layout constraint (right side of container). |
Constructor Summary | |
LwBorderLayout()
Constructs a new border layout with no gaps between components. |
|
LwBorderLayout(int hgap,
int vgap)
Constructs a border layout with the specified gaps between components. |
Method Summary | |
java.awt.Dimension |
calcPreferredSize(LayoutContainer target)
Calculates the preferred size dimension for the layout container. |
void |
componentAdded(java.lang.Object id,
Layoutable comp,
int index)
Invoked when the specified layoutable component is added to the layout container, that uses the layout manager. |
void |
componentRemoved(Layoutable lw,
int index)
Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager. |
int |
getHgap()
Returns the horizontal. |
int |
getVgap()
Returns the vertical gap. |
protected static boolean |
isVisible(Layoutable l)
Tests if the specified layout container is not null and visible. |
void |
layout(LayoutContainer target)
Lays out the child layoutable components inside the specified layout container. |
void |
setHgap(int hgap)
Sets the horizontal gap. |
void |
setVgap(int vgap)
Sets the vertical gap. |
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.Object NORTH
public static final java.lang.Object SOUTH
public static final java.lang.Object EAST
public static final java.lang.Object WEST
public static final java.lang.Object CENTER
Constructor Detail |
public LwBorderLayout()
public LwBorderLayout(int hgap, int vgap)
hgap
and the vertical gap is
specified by vgap
.hgap
- the horizontal gap.vgap
- the vertical gap.Method Detail |
public int getHgap()
public void setHgap(int hgap)
hgap
- the horizontal gap.public int getVgap()
public void setVgap(int vgap)
vgap
- the vertical gap.public void componentAdded(java.lang.Object id, Layoutable comp, int index)
componentAdded
in interface LwLayout
id
- the layoutable component constraints.comp
- the layoutable component.index
- the child index.public void componentRemoved(Layoutable lw, int index)
componentRemoved
in interface LwLayout
lw
- the layoutable component to be removedindex
- the child index.public java.awt.Dimension calcPreferredSize(LayoutContainer target)
calcPreferredSize
in interface LwLayout
target
- the layout container.public void layout(LayoutContainer target)
layout
in interface LwLayout
target
- the layout container that needs to be laid out.protected static boolean isVisible(Layoutable l)
null
and visible.l
- the specified layout container.true
if the layoutable component is not null and visible;
otherwise false
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |