|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wings.SAbstractLayoutManager
org.wings.SBoxLayout
public class SBoxLayout
Allows multiple components to be laid out either vertically or horizontally.
Nesting multiple panels with different combinations of horizontal and vertical gives an effect similar to GridBagLayout, without the complexity.
| Field Summary | |
|---|---|
protected int |
align
|
protected int |
borderThickness
|
protected ArrayList |
components
|
protected int |
hgap
The horizontal gap (in pixels) specifiying the space between columns. |
protected int |
orientation
|
protected int |
vgap
The vertical gap (in pixels) which specifiying the space between rows. |
static int |
X_AXIS
|
static int |
Y_AXIS
|
| Fields inherited from class org.wings.SAbstractLayoutManager |
|---|
border, cg, container, preferredSize |
| Fields inherited from interface org.wings.SConstants |
|---|
BASELINE, BLOCK_ALIGN, BOTTOM, BOTTOM_ALIGN, CENTER, CENTER_ALIGN, HORIZONTAL, JUSTIFY, LEFT, LEFT_ALIGN, NO_ALIGN, RIGHT, RIGHT_ALIGN, TOP, TOP_ALIGN, UID_DIVIDER, VERTICAL |
| Constructor Summary | |
|---|---|
SBoxLayout(int orientation)
Deprecated. This constructor mismatch the swing api. Better use SBoxLayout( SContainer c, int orientation ) |
|
SBoxLayout(SContainer c,
int orientation)
creates a new box layout with the given orientation |
|
| Method Summary | |
|---|---|
void |
addComponent(SComponent c,
Object constraint,
int index)
Adds a component to the layout manager |
int |
getBorder()
Typical PLAFs will render this layout as invisible table (border = 0). |
SComponent |
getComponentAt(int i)
returns the component at the given position |
List |
getComponents()
returns a list of all components |
int |
getHgap()
Gets the horizontal gap between components in pixel. |
int |
getOrientation()
returns the orientation |
int |
getVgap()
Gets the vertical gap between components in pixel. |
void |
removeComponent(SComponent c)
Removes a component from the layout manager |
void |
setBorder(int borderThickness)
Typical PLAFs will render this layout as invisible table (border = 0). |
void |
setHgap(int hgap)
Sets the horizontal gap between components to the specified value in pixe. |
void |
setOrientation(int o)
Sets the orientation. |
void |
setVgap(int vgap)
Sets the vertical gap between components to the specified value in pixel. |
| Methods inherited from class org.wings.SAbstractLayoutManager |
|---|
getCG, getContainer, getPreferredSize, setCG, setContainer, setPreferredSize, updateCG, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int X_AXIS
public static final int Y_AXIS
protected ArrayList components
protected int orientation
protected int align
protected int borderThickness
protected int hgap
protected int vgap
| Constructor Detail |
|---|
public SBoxLayout(int orientation)
orientation - either SConstants#VERTICAL or SConstants#HORIZONTAL
public SBoxLayout(SContainer c,
int orientation)
c - - the container that needs to be laid outorientation - either SConstants#VERTICAL or SConstants#HORIZONTAL| Method Detail |
|---|
public void addComponent(SComponent c,
Object constraint,
int index)
SLayoutManager
c - The new componentconstraint - A (sometimes optional) constraint objectpublic void removeComponent(SComponent c)
SLayoutManager
c - The new componentpublic List getComponents()
public SComponent getComponentAt(int i)
i - position
public void setOrientation(int o)
o - One of the following constants:
SConstants#HORIZONTAL or
SConstants#VERTICALpublic int getOrientation()
public void setBorder(int borderThickness)
setBorder in interface SLayoutManagersetBorder in class SAbstractLayoutManagerborderThickness - The rendered border with in pixelpublic int getBorder()
getBorder in interface SLayoutManagergetBorder in class SAbstractLayoutManagerpublic int getHgap()
public void setHgap(int hgap)
hgap - the horizontal gap between componentspublic int getVgap()
public void setVgap(int vgap)
vgap - the vertical gap between components
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||