|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pagelayout.GridRow
public class GridRow
GridRow is a utility class to make it easier to create
a grid.
Each row of a grid may be constructed by creating
an object of the class GridRow. Components or cells can be added
to the row by using one of the add
methods of this class. Any of the components or cells
can be made to span
more than one column by using the span
method, and empty columns may be added by using
the skip
method of this class. Note
that a cell or a component in a column may be made to span more than
one row by adding the cell
CellGrid.VSPANCELL
to the
column exactly below the spanning cell/component in the next row.
Once all the rows have been
so created, the
createCellGrid(GridRow... rows)
method of CellGrid
can be used to construct the grid.
Example10
Constructor Summary | |
---|---|
GridRow()
Creates the GridRow object, to which components or cells can be added by using one of the add methods of this class. |
|
GridRow(Cell... cells)
Creates a GridRow object and adds the array of cells specified as inputs. |
|
GridRow(java.awt.Component... components)
Creates a GridRow object and adds the array of components specified as inputs. |
|
GridRow(int halign,
int valign,
Cell... cells)
Creates a GridRow object and adds the array of cells specified as inputs. |
|
GridRow(int halign,
int valign,
java.awt.Component... components)
Creates a GridRow object and adds the array of components specified as inputs. |
Method Summary | |
---|---|
GridRow |
add(Cell... cells)
Add an array of cells to the row. |
GridRow |
add(java.awt.Component... components)
Add an array of components to the row. |
GridRow |
add(int halign,
int valign,
Cell... cells)
Add an array of cells with specified alignments to the row. |
GridRow |
add(int halign,
int valign,
java.awt.Component... components)
Add an array of components with specified alignments to the row. |
protected Cell[] |
getCells()
Used by CellGrid . |
protected byte |
getHorizontalAlignment(int index)
Used by CellGrid . |
protected byte |
getVerticalAlignment(int index)
Used by CellGrid . |
int |
size()
Returns the number of cells in the row. |
GridRow |
skip(int n)
Adds empty columns to the row at the current position. |
GridRow |
span(int n)
Specifies the number of columns that should be spanned by the current component/cell of the row. |
GridRow |
spanHorizontal(int n)
Specifies the number of columns that should be spanned by the current component/cell of the row. |
GridRow |
spanVertical()
This method is used to specify that the component/cell in the previous row immediately above the current column of the row shoud span this column. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GridRow()
add
methods of this class.
public GridRow(java.awt.Component... components)
components
- the array of components to be added after creattion
of the object.public GridRow(int halign, int valign, java.awt.Component... components)
halign
- the horizontal alignment of the componentsvalign
- the vertical alignment of the componentscomponents
- the array of components to be added after creattion
of the object.public GridRow(Cell... cells)
cells
- the array of cells to be added after creattion
of the object.public GridRow(int halign, int valign, Cell... cells)
halign
- the horizontal alignment of the cellsvalign
- the vertical alignment of the cellscells
- the array of cells to be added after creattion
of the object.Method Detail |
---|
public GridRow add(java.awt.Component... components)
components
- the array of components to be added.
public GridRow add(int halign, int valign, java.awt.Component... components)
halign
- the horizontal alignment of the components.valign
- the vertical alignment of the components.components
- the arary of components to be added.
public GridRow add(Cell... cells)
cells
- the array of cells to be added.
public GridRow add(int halign, int valign, Cell... cells)
halign
- the horizontal alignment of the cells.valign
- the vertical alignment of the cells.cells
- the arary of cells to be added.
public GridRow span(int n)
n
- (>=2) the number of columns spanned by the current cell/component.
public GridRow skip(int n)
n
- the number of empty columns to add.
protected Cell[] getCells()
CellGrid
.
The method
createCellGrid(GridRow... rows)
uses this method to convert
a GridRow
object to an array of cells.
protected byte getVerticalAlignment(int index)
CellGrid
.
The method
createCellGrid(GridRow... rows)
uses this
method to obtain
the vertical alignment of the cell at the given index.
index
- the index of the cell whose alignment is needed.
protected byte getHorizontalAlignment(int index)
CellGrid
.
The method
createCellGrid(GridRow... rows)
uses this method to obtain
the horizontal alignment of the cell at the given index.
index
- the index of the cell whose alignment is needed.
public int size()
public GridRow spanHorizontal(int n)
span
.
n
- (>=2) the number of columns spanned by the current cell/component.
public GridRow spanVertical()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |