class org.aswing.FlowLayout extends EmptyLayout

A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. Flow layouts are typically used to arrange buttons in a panel. It will arrange buttons left to right until no more buttons fit on the same line. Each line is centered.

For example, the following picture shows an applet using the flow layout manager (its default layout manager) to position three buttons:

A flow layout lets each component assume its natural (preferred) size.

The following image illustrate the way the FlowLayout layout child components.


Authors paling, ngrebenshikov

Class Fields

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.

static var RIGHT:Int

This value indicates that each row of components should be right-justified.

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

align is the property that determines how each row distributes empty space. It can be one of the following values:
  • LEFT
  • RIGHT
  • CENTER

var hgap:Int

The flow layout manager allows a seperation of components with gaps. The horizontal gap will specify the space between components.

var margin:Bool

Whether or not the gap will margin around

var vgap:Int

The flow layout manager allows a seperation of components with gaps. The vertical gap will specify the space between rows.

function new(?align:Int = 2, ?hgap:Int = 5, ?vgap:Int = 5, ?margin:Bool = true): Void

Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.

The value of the alignment argument must be one of FlowLayout.LEFT, FlowLayout.RIGHT,or FlowLayout.CENTER.

align

the alignment value, default is LEFT

hgap

the horizontal gap between components, default 5

vgap

the vertical gap between components, default 5

margin

whether or not the gap will margin around

function toString(): String

Returns a string representation of this FlowLayout object and its values.

returns

a string representation of this layout