Packageorg.aswing
Classpublic class SoftBoxLayout
InheritanceSoftBoxLayout Inheritance EmptyLayout

The SoftBoxLayout will layout the child components using their preferredWidth or preferredHeight instead of width or height. It ignores the preferredWidth when set to Y_AXIS, ignores the preferredHeight when set to X_AXIS.

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

BoxLayout


Public Methods
 MethodDefined by
  
SoftBoxLayout(axis:int, gap:int = 0, align:int)
SoftBoxLayout
 Inherited
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
  
return 0.5
SoftBoxLayout
  
return 0.5
SoftBoxLayout
 Inherited
do nothing
EmptyLayout
  
do nothing
SoftBoxLayout
 Inherited
return IntDimension.createBigDimension();
EmptyLayout
  
Returns minimumLayoutSize;
SoftBoxLayout
  
Returns preferredLayoutSize;
SoftBoxLayout
 Inherited
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
Public Constants
 ConstantDefined 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
Constructor detail
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

Method detail
getAlign()method
public function getAlign():int

Returns the align.

Returns
int — the align
getAxis()method 
public function getAxis():int

Gets axis.

Returns
int — axis
getGap()method 
public function getGap():int

Gets gap.

Returns
int — gap
getLayoutAlignmentX()method 
public override function getLayoutAlignmentX(target:Container):Number

return 0.5

Parameters
target:Container

Returns
Number
getLayoutAlignmentY()method 
public override function getLayoutAlignmentY(target:Container):Number

return 0.5

Parameters
target:Container

Returns
Number
layoutContainer()method 
public override function layoutContainer(target:Container):void

do nothing

Parameters
target:Container
minimumLayoutSize()method 
public override function minimumLayoutSize(target:Container):IntDimension

Returns minimumLayoutSize;

Parameters
target:Container

Returns
IntDimension
preferredLayoutSize()method 
public override function preferredLayoutSize(target:Container):IntDimension

Returns preferredLayoutSize;

Parameters
target:Container

Returns
IntDimension
setAlign()method 
public function setAlign(align:int):void

Sets new align. Must be one of:

Default is LEFT.

Parameters
align:int — new align
setAxis()method 
public function setAxis(axis:int):void

Sets new axis. Must be one of:

Default is X_AXIS.

Parameters
axis:int — new axis
setGap()method 
public function setGap(gap:int = 0):void

Sets new gap.

Parameters
gap:int (default = 0) — new gap
Constant detail
BOTTOMconstant
public static const BOTTOM:int = 3

This value indicates that each row of components should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).

CENTERconstant 
public static const CENTER:int = 0

This value indicates that each row of components should be centered.

LEFTconstant 
public static const LEFT:int = 2

This value indicates that each row of components should be left-justified(X_AXIS)/top-justified(Y_AXIS).

RIGHTconstant 
public static const RIGHT:int = 4

This value indicates that each row of components should be right-justified(X_AXIS)/bottom-justified(Y_AXIS).

TOPconstant 
public static const TOP:int = 1

This value indicates that each row of components should be left-justified(X_AXIS)/top-justified(Y_AXIS).

X_AXISconstant 
public static const X_AXIS:int = 0

Specifies that components should be laid out left to right.

Y_AXISconstant 
public static const Y_AXIS:int = 1

Specifies that components should be laid out top to bottom.