new 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.
rows | the rows, with the value zero meaning any number of rows |
cols | the columns, with the value zero meaning any number of columns |
hgap | (optional)the horizontal gap, default 0 |
vgap | (optional)the vertical gap, default 0 |
Error | if the value of both
rows and cols is
set to zero
|
public function getRows():Number
Gets the number of rows in this layout.
the number of rows in this layout
public function setRows(rows:Number):Void
Sets the number of rows in this layout to the specified value.
rows | the number of rows in this layout |
Error | if the value of both
rows and cols is set to zero
|
public function getColumns():Number
Gets the number of columns in this layout.
the number of columns in this layout
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.
cols | the number of columns in this layout |
Error | if the value of both
rows and cols is set to zero
|
public function getHgap():Number
Gets the horizontal gap between components.
the horizontal gap between components
public function setHgap(hgap:Number):Void
Sets the horizontal gap between components to the specified value.
hgap | the horizontal gap between components |
public function getVgap():Number
Gets the vertical gap between components.
the vertical gap between components
public function setVgap(vgap:Number):Void
Sets the vertical gap between components to the specified value.
vgap | the vertical gap between components |
public function preferredLayoutSize(target:Container):Dimension
Description copied from EmptyLayout
return target.getSize();
preferredLayoutSize() in org.aswing.LayoutManager
public function minimumLayoutSize(target:Container):Dimension
Description copied from EmptyLayout
new Dimension(0, 0);
minimumLayoutSize() in org.aswing.LayoutManager
public function maximumLayoutSize(target:Container):Dimension
return new Dimension(Number.MAX_VALUE, Number.MAX_VALUE);
maximumLayoutSize() in org.aswing.LayoutManager
public function layoutContainer(target:Container):Void
Description copied from EmptyLayout
do nothing
layoutContainer() in org.aswing.LayoutManager
public function getLayoutAlignmentX(target:Container):Number
public function getLayoutAlignmentY(target:Container):Number