nextapp.echoservlet.ui
Class GridRenderingModel

java.lang.Object
  extended by nextapp.echoservlet.ui.GridRenderingModel
All Implemented Interfaces:
java.io.Serializable

public final class GridRenderingModel
extends java.lang.Object
implements java.io.Serializable

A utility class used when rendering Grid components.

See Also:
Serialized Form

Field Summary
static int CELL_TYPE_EMPTY
           
static int CELL_TYPE_ORIGIN
           
static int CELL_TYPE_POINTER
           
 
Constructor Summary
GridRenderingModel(Grid grid)
          Creates a GridRenderingModel for the specified Grid.
 
Method Summary
 Grid.Cell getCell(int column, int row)
          Returns the Grid.Cell at the specified coordinate.
 int getCellHeight(int column, int row)
          Returns the height of the specified cell, or EchoConstants.UNDEFINED_SIZE if it cannot be determined.
 int getCellType(int column, int row)
          Returns the cell type at the specified coordinate.
 int getCellWidth(int column, int row)
          Returns the width of the specified cell, or EchoConstants.UNDEFINED_SIZE if it cannot be determined.
 int getColumnCount()
          Returns the number of columns in the rendered version of the grid.
 int getColumnSpan(int column, int row)
          Returns the column span of the cell at the specified coordinates in the rendered version of the grid.
 int getColumnWidth(int column)
          Returns the rendered width of the given column.
 int getRowCount()
          Returns the number of rows in the rendered version of the grid.
 int getRowHeight(int row)
          Returns the rendered height of the given row.
 int getRowSpan(int column, int row)
          Returns the row span of the cell at the specified coordinates in the rendered version of the grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_TYPE_EMPTY

public static final int CELL_TYPE_EMPTY
See Also:
Constant Field Values

CELL_TYPE_ORIGIN

public static final int CELL_TYPE_ORIGIN
See Also:
Constant Field Values

CELL_TYPE_POINTER

public static final int CELL_TYPE_POINTER
See Also:
Constant Field Values
Constructor Detail

GridRenderingModel

public GridRenderingModel(Grid grid)
Creates a GridRenderingModel for the specified Grid.

Parameters:
grid - The Grid to be rendered.
Method Detail

getCell

public Grid.Cell getCell(int column,
                         int row)
Returns the Grid.Cell at the specified coordinate. The cells position and row and column spans may have changed if the cell flow-filled up or to the left and/or rows and columns of the grid were reduced.


getCellType

public int getCellType(int column,
                       int row)
Returns the cell type at the specified coordinate. The cell type may be one of the following values:


getCellHeight

public int getCellHeight(int column,
                         int row)
Returns the height of the specified cell, or EchoConstants.UNDEFINED_SIZE if it cannot be determined. Will throw IllegalArgumentException if OriginCell does not exist at specified coordinate.


getCellWidth

public int getCellWidth(int column,
                        int row)
Returns the width of the specified cell, or EchoConstants.UNDEFINED_SIZE if it cannot be determined. Will throw IllegalArgumentException if OriginCell does not exist at specified coordinate.


getColumnCount

public int getColumnCount()
Returns the number of columns in the rendered version of the grid.


getColumnSpan

public int getColumnSpan(int column,
                         int row)
Returns the column span of the cell at the specified coordinates in the rendered version of the grid.


getColumnWidth

public int getColumnWidth(int column)
Returns the rendered width of the given column.


getRowCount

public int getRowCount()
Returns the number of rows in the rendered version of the grid.


getRowHeight

public int getRowHeight(int row)
Returns the rendered height of the given row.


getRowSpan

public int getRowSpan(int column,
                      int row)
Returns the row span of the cell at the specified coordinates in the rendered version of the grid.