Packageorg.aswing
Classpublic class GridLayout
InheritanceGridLayout Inheritance EmptyLayout



Public Methods
 MethodDefined by
  
GridLayout(rows:int = 1, cols:int = 0, hgap:int = 0, vgap:int = 0)

Creates a grid layout with the specified number of rows and columns.

GridLayout
 Inherited
addLayoutComponent(comp:Component, constraints:Object):void
Do nothing Adds the specified component to the layout, using the specified constraint object.
EmptyLayout
  
getColumns():int
Gets the number of columns in this layout.
GridLayout
  
getHgap():int
Gets the horizontal gap between components.
GridLayout
  
return 0.5
GridLayout
  
return 0.5
GridLayout
  
getRows():int
Gets the number of rows in this layout.
GridLayout
  
getVgap():int
Gets the vertical gap between components.
GridLayout
 Inherited
do nothing
EmptyLayout
  
GridLayout
  
return new IntDimension(1000000, 1000000);
GridLayout
  
GridLayout
  
GridLayout
 Inherited
Do nothing Removes the specified component from the layout.
EmptyLayout
  
setColumns(cols:int):void
Sets the number of columns in this layout.
GridLayout
  
setHgap(hgap:int):void
Sets the horizontal gap between components to the specified value.
GridLayout
  
setRows(rows:int):void
Sets the number of rows in this layout to the specified value.
GridLayout
  
setVgap(vgap:int):void
Sets the vertical gap between components to the specified value.
GridLayout
  
toString():String
GridLayout
Constructor detail
GridLayout()constructor
public function GridLayout(rows:int = 1, cols:int = 0, hgap:int = 0, vgap:int = 0)

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
rows:int (default = 1) — rows the rows, with the value zero meaning any number of rows
 
cols:int (default = 0) — cols the columns, with the value zero meaning any number of columns
 
hgap:int (default = 0) — hgap (optional)the horizontal gap, default 0
 
vgap:int (default = 0) — vgap (optional)the vertical gap, default 0

Throws
— if the value of both rows and cols is set to zero
Method detail
getColumns()method
public function getColumns():int

Gets the number of columns in this layout.

Returns
int — the number of columns in this layout
getHgap()method 
public function getHgap():int

Gets the horizontal gap between components.

Returns
int — the horizontal gap between components
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
getRows()method 
public function getRows():int

Gets the number of rows in this layout.

Returns
int — the number of rows in this layout
getVgap()method 
public function getVgap():int

Gets the vertical gap between components.

Returns
int — the vertical gap between components
layoutContainer()method 
public override function layoutContainer(target:Container):voidParameters
target:Container
maximumLayoutSize()method 
public override function maximumLayoutSize(target:Container):IntDimension

return new IntDimension(1000000, 1000000);

Parameters
target:Container

Returns
IntDimension
minimumLayoutSize()method 
public override function minimumLayoutSize(target:Container):IntDimensionParameters
target:Container

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

Returns
IntDimension
setColumns()method 
public function setColumns(cols:int):void

Sets the number of columns in this layout. Setting the number of columns has no effect 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
cols:int — cols the number of columns in this layout
setHgap()method 
public function setHgap(hgap:int):void

Sets the horizontal gap between components to the specified value.

Parameters
hgap:int — hgap the horizontal gap between components
setRows()method 
public function setRows(rows:int):void

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

Parameters
rows:int — rows the number of rows in this layout
setVgap()method 
public function setVgap(vgap:int):void

Sets the vertical gap between components to the specified value.

Parameters
vgap:int — vgap the vertical gap between components
toString()method 
public function toString():String

Returns
String