class org.aswing.SoftBoxLayout extends 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 BoxLayout

Author paling

Class Fields

static var BOTTOM:Int

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

static var CENTER:Int

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

static var LEFT:Int

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

static var RIGHT:Int

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

static var TOP:Int

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

static var X_AXIS:Int

Specifies that components should be laid out left to right.

static var Y_AXIS:Int

Specifies that components should be laid out top to bottom.

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from EmptyLayout

function addLayoutComponent(comp:Component, constraints:Dynamic):Void
function getLayoutAlignmentX(target:Container):Float
function getLayoutAlignmentY(target:Container):Float
function invalidateLayout(target:Container):Void
function layoutContainer(target:Container):Void
function maximumLayoutSize(target:Container):IntDimension
function minimumLayoutSize(target:Container):IntDimension
function preferredLayoutSize(target:Container):IntDimension
function removeLayoutComponent(comp:Component):Void

var align:Int

The layout align. Must be one of:

  • LEFT
  • RIGHT
  • CENTER
  • TOP
  • BOTTOM

Default is LEFT.

var axis:Int

The layout axis. Must be one of:

  • X_AXIS
  • Y_AXIS

Default is X_AXIS.

var gap:Int

The space between children

function new(?axis:Int = 0, ?gap:Int = 0, ?align:Int = 2): Void

axis

the layout axis, default X_AXIS

gap

(optional)the gap between each component, default 0

align

(optional)the alignment value, default is LEFT