Class org.aswing.GridLayout

Description

Method Index

new GridLayout()
getColumns(), getHgap(), getLayoutAlignmentX(), getLayoutAlignmentY(), getRows(), getVgap(), layoutContainer(), maximumLayoutSize(), minimumLayoutSize(), preferredLayoutSize(), setColumns(), setHgap(), setRows(), setVgap(), toString()

Inherited from EmptyLayout

Constructor Detail

GridLayout

public function GridLayout(rows:Number, cols:Number, hgap:Number, vgap:Number)

GridLayout(rows:Number, cols:Number)
GridLayout(rows:Number, cols:Number, hgap:Number)
GridLayout(rows:Number, cols:Number, hgap:Number, vgap:Number)

Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.

In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed between each of the columns. Vertical gaps are placed between each of the rows.

One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.

All GridLayout constructors defer to this one.

Parameters

rowsthe rows, with the value zero meaning any number of rows
colsthe columns, with the value zero meaning any number of columns
hgap(optional)the horizontal gap, default 0
vgap(optional)the vertical gap, default 0

Throws

Errorif the value of both rows and cols is set to zero

Method Detail

getRows

public function getRows():Number

Gets the number of rows in this layout.

Return

the number of rows in this layout

setRows

public function setRows(rows:Number):Void

Sets the number of rows in this layout to the specified value.

Parameters

rowsthe number of rows in this layout

Throws

Errorif the value of both rows and cols is set to zero

getColumns

public function getColumns():Number

Gets the number of columns in this layout.

Return

the number of columns in this layout

setColumns

public function setColumns(cols:Number):Void

Sets the number of columns in this layout to the specified value. Setting the number of columns has no affect on the layout if the number of rows specified by a constructor or by the setRows method is non-zero. In that case, the number of columns displayed in the layout is determined by the total number of components and the number of rows specified.

Parameters

colsthe number of columns in this layout

Throws

Errorif the value of both rows and cols is set to zero

getHgap

public function getHgap():Number

Gets the horizontal gap between components.

Return

the horizontal gap between components

setHgap

public function setHgap(hgap:Number):Void

Sets the horizontal gap between components to the specified value.

Parameters

hgapthe horizontal gap between components

getVgap

public function getVgap():Number

Gets the vertical gap between components.

Return

the vertical gap between components

setVgap

public function setVgap(vgap:Number):Void

Sets the vertical gap between components to the specified value.

Parameters

vgapthe vertical gap between components

preferredLayoutSize

public function preferredLayoutSize(target:Container):Dimension

Description copied from EmptyLayout

return target.getSize();

Specified By

preferredLayoutSize() in org.aswing.LayoutManager

Overrides

preferredLayoutSize() in org.aswing.EmptyLayout

minimumLayoutSize

public function minimumLayoutSize(target:Container):Dimension

Description copied from EmptyLayout

new Dimension(0, 0);

Specified By

minimumLayoutSize() in org.aswing.LayoutManager

Overrides

minimumLayoutSize() in org.aswing.EmptyLayout

maximumLayoutSize

public function maximumLayoutSize(target:Container):Dimension

return new Dimension(Number.MAX_VALUE, Number.MAX_VALUE);

Specified By

maximumLayoutSize() in org.aswing.LayoutManager

Overrides

maximumLayoutSize() in org.aswing.EmptyLayout

layoutContainer

public function layoutContainer(target:Container):Void

Description copied from EmptyLayout

do nothing

Specified By

layoutContainer() in org.aswing.LayoutManager

Overrides

layoutContainer() in org.aswing.EmptyLayout

toString

public function toString():String

getLayoutAlignmentX

public function getLayoutAlignmentX(target:Container):Number

getLayoutAlignmentY

public function getLayoutAlignmentY(target:Container):Number