pagelayout
Class GridRows

java.lang.Object
  extended by pagelayout.GridRows

public class GridRows
extends java.lang.Object

GridRows is a utility class that may make it easier to create a grid using GridRow. It just provides some syntactic sugar so the code for using GridRow may appear to be more compact to some users. Here is the alternate code for Example10 that replaces the lines that create the seven rows for the grid and then the grid itself. This is available as Example11.

                GridRows rows=new GridRows();

                // First row 
                rows.newRow().add(lastName,lastNameE,firstName,firstNameE);


                // Second row 
                rows.newRow().add(phone,phoneE)
                    .add(new Row(NO_ALIGNMENT,CENTER,email,emailE)).span(2);


                // Third row 
                rows.newRow().add(address1,address1E).span(3);


                // Fourth row 
                rows.newRow().add(address2,address2E).span(3);


                // Fifth row 
                rows.newRow().add(city,cityE);


                // Sixth row 
                rows.newRow().add(state,stateE,postal,postalE);

                // Seventh row
                rows.newRow().add(county,countyE);

                CellGrid grid=rows.createCellGrid();


Constructor Summary
GridRows()
          Creates instance of this class.
 
Method Summary
 CellGrid createCellGrid()
          Creates a CellGrid object from the rows created by calling the newRow method of this object.
 GridRow getCurrentRow()
          Returns the current row represented by a GridRow object.
 GridRow newRow()
          Creates and returns a new GridRow object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridRows

public GridRows()
Creates instance of this class.

Method Detail

newRow

public GridRow newRow()
Creates and returns a new GridRow object. This row is added to the existing rows.

Returns:
The newly created GridRow.

getCurrentRow

public GridRow getCurrentRow()
Returns the current row represented by a GridRow object.

Returns:
The current row.

createCellGrid

public CellGrid createCellGrid()
Creates a CellGrid object from the rows created by calling the newRow method of this object.

Returns:
The CellGrid object.