| Package | org.aswing |
| Class | public class BoxLayout |
| Inheritance | BoxLayout EmptyLayout |
If this boxlayout is set to X_AXIS, it will layout the child componnets evenly regardless the value of width,height,preferredWidth,preferredHeight.
The height of the child components is the same as the parent container.
The following picture illustrate this:
It works the same way when it is set to Y_AXIS.
| Method | Defined by | ||
|---|---|---|---|
|
BoxLayout(axis:int, gap:int = 0)
| BoxLayout | ||
![]() |
addLayoutComponent(comp:Component, constraints:Object):void
Do nothing
Adds the specified component to the layout, using the specified
constraint object.
| EmptyLayout | |
|
getAxis():int
Gets axis.
| BoxLayout | ||
|
getGap():int
Gets gap.
| BoxLayout | ||
|
getLayoutAlignmentX(target:Container):Number
return 0.5
| BoxLayout | ||
|
getLayoutAlignmentY(target:Container):Number
return 0.5
| BoxLayout | ||
![]() |
invalidateLayout(target:Container):void
do nothing
| EmptyLayout | |
|
layoutContainer(target:Container):void
| BoxLayout | ||
| BoxLayout | |||
| BoxLayout | |||
| BoxLayout | |||
![]() |
removeLayoutComponent(comp:Component):void
Do nothing
Removes the specified component from the layout.
| EmptyLayout | |
|
setAxis(axis:int):void
Sets new axis.
| BoxLayout | ||
|
setGap(gap:int = 0):void
Sets new gap.
| BoxLayout | ||
| Constant | Defined by | ||
|---|---|---|---|
| X_AXIS : int = 0 [static]
Specifies that components should be laid out left to right.
| BoxLayout | ||
| Y_AXIS : int = 1 [static]
Specifies that components should be laid out top to bottom.
| BoxLayout | ||
| BoxLayout | () | constructor |
public function BoxLayout(axis:int, gap:int = 0)Parameters
axis:int — (optional)the layout axis, default is X_AXIS
|
|
gap:int (default = 0) — (optional)the gap between children, default is 0
|
See also
| getAxis | () | method |
public function getAxis():intGets axis.
Returnsint — axis
|
| getGap | () | method |
public function getGap():intGets gap.
Returnsint — gap
|
| getLayoutAlignmentX | () | method |
public override function getLayoutAlignmentX(target:Container):Numberreturn 0.5
Parameterstarget:Container |
Number |
| getLayoutAlignmentY | () | method |
public override function getLayoutAlignmentY(target:Container):Numberreturn 0.5
Parameterstarget:Container |
Number |
| layoutContainer | () | method |
| maximumLayoutSize | () | method |
public override function maximumLayoutSize(target:Container):IntDimensionParameters
target:Container |
IntDimension |
| minimumLayoutSize | () | method |
public override function minimumLayoutSize(target:Container):IntDimensionParameters
target:Container |
IntDimension |
| preferredLayoutSize | () | method |
public override function preferredLayoutSize(target:Container):IntDimensionParameters
target:Container |
IntDimension |
| setAxis | () | method |
public function setAxis(axis:int):voidSets new axis.
Parametersaxis:int — new axis default is X_AXIS
|
| setGap | () | method |
public function setGap(gap:int = 0):voidSets new gap.
Parametersgap:int (default = 0) — new gap
|
| X_AXIS | constant |
public static const X_AXIS:int = 0Specifies that components should be laid out left to right.
| Y_AXIS | constant |
public static const Y_AXIS:int = 1Specifies that components should be laid out top to bottom.