| Package | org.aswing |
| Class | public class SoftBoxLayout |
| Inheritance | SoftBoxLayout EmptyLayout |
When set to X_AXIS, all of the child components share the same height from the container and use their own preferredWidth When set to Y_AXIS, all of the child components share the same width from the container and use their own preferredHeight
The picture below shows that when set X_AXIS,all of the child component share the same height no matter what value you set for the componnet.
It ignores the width and height property you set for the child component.
Note: The align is set to LEFT, so the children are ajusted to the left side,
In the right,there are still free space.
The picture below shows that when set Y_AXIS,all of the child component share the same width no matter what value you set for the componnet.
It ignores the width and height property you set for the child component.
Note: The align is set to RIGHT, when axis set to Y_AXIS and align set to right, the children are ajusted to the bottom,
at top ,there are still free space.
Note the container itself who applied SoftBoxLayout is not affected by the X_AXIS or Y_AXIS you set for SoftBoxLayout
The container's size will be determined by its parents' layout manager.
See also
| Method | Defined by | ||
|---|---|---|---|
|
SoftBoxLayout(axis:int, gap:int = 0, align:int)
| SoftBoxLayout | ||
![]() |
addLayoutComponent(comp:Component, constraints:Object):void
Do nothing
Adds the specified component to the layout, using the specified
constraint object.
| EmptyLayout | |
|
getAlign():int
Returns the align.
| SoftBoxLayout | ||
|
getAxis():int
Gets axis.
| SoftBoxLayout | ||
|
getGap():int
Gets gap.
| SoftBoxLayout | ||
|
getLayoutAlignmentX(target:Container):Number
return 0.5
| SoftBoxLayout | ||
|
getLayoutAlignmentY(target:Container):Number
return 0.5
| SoftBoxLayout | ||
![]() |
invalidateLayout(target:Container):void
do nothing
| EmptyLayout | |
|
layoutContainer(target:Container):void
do nothing
| SoftBoxLayout | ||
![]() |
return IntDimension.createBigDimension();
| EmptyLayout | |
|
Returns minimumLayoutSize;
| SoftBoxLayout | ||
|
Returns preferredLayoutSize;
| SoftBoxLayout | ||
![]() |
removeLayoutComponent(comp:Component):void
Do nothing
Removes the specified component from the layout.
| EmptyLayout | |
|
setAlign(align:int):void
Sets new align.
| SoftBoxLayout | ||
|
setAxis(axis:int):void
Sets new axis.
| SoftBoxLayout | ||
|
setGap(gap:int = 0):void
Sets new gap.
| SoftBoxLayout | ||
| Constant | Defined by | ||
|---|---|---|---|
| BOTTOM : int = 3 [static]
This value indicates that each row of components
should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).
| SoftBoxLayout | ||
| CENTER : int = 0 [static]
This value indicates that each row of components
should be centered.
| SoftBoxLayout | ||
| LEFT : int = 2 [static]
This value indicates that each row of components
should be left-justified(X_AXIS)/top-justified(Y_AXIS).
| SoftBoxLayout | ||
| RIGHT : int = 4 [static]
This value indicates that each row of components
should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).
| SoftBoxLayout | ||
| TOP : int = 1 [static]
This value indicates that each row of components
should be left-justified(X_AXIS)/top-justified(Y_AXIS).
| SoftBoxLayout | ||
| X_AXIS : int = 0 [static]
Specifies that components should be laid out left to right.
| SoftBoxLayout | ||
| Y_AXIS : int = 1 [static]
Specifies that components should be laid out top to bottom.
| SoftBoxLayout | ||
| SoftBoxLayout | () | constructor |
public function SoftBoxLayout(axis:int, gap:int = 0, align:int)Parameters
axis:int — the layout axis, default X_AXIS
|
|
gap:int (default = 0) — (optional)the gap between each component, default 0
|
|
align:int — (optional)the alignment value, default is LEFT
|
See also
| getAlign | () | method |
public function getAlign():intReturns the align.
Returnsint — the align
|
| 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 |
public override function layoutContainer(target:Container):voiddo nothing
Parameterstarget:Container |
| minimumLayoutSize | () | method |
public override function minimumLayoutSize(target:Container):IntDimensionReturns minimumLayoutSize;
Parameterstarget:Container |
IntDimension |
| preferredLayoutSize | () | method |
public override function preferredLayoutSize(target:Container):IntDimensionReturns preferredLayoutSize;
Parameterstarget:Container |
IntDimension |
| setAlign | () | method |
public function setAlign(align:int):voidSets new align. Must be one of:
align:int — new align
|
| setAxis | () | method |
public function setAxis(axis:int):voidSets new axis. Must be one of:
axis:int — new axis
|
| setGap | () | method |
public function setGap(gap:int = 0):voidSets new gap.
Parametersgap:int (default = 0) — new gap
|
| BOTTOM | constant |
public static const BOTTOM:int = 3This value indicates that each row of components should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).
| CENTER | constant |
public static const CENTER:int = 0This value indicates that each row of components should be centered.
| LEFT | constant |
public static const LEFT:int = 2This value indicates that each row of components should be left-justified(X_AXIS)/top-justified(Y_AXIS).
| RIGHT | constant |
public static const RIGHT:int = 4This value indicates that each row of components should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).
| TOP | constant |
public static const TOP:int = 1This value indicates that each row of components should be left-justified(X_AXIS)/top-justified(Y_AXIS).
| 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.