Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.webcontainer.syncpeer
Class GridProcessor

    java.lang.Object
      nextapp.echo2.webcontainer.syncpeer.GridProcessor

    public class GridProcessor

extends java.lang.Object

Provides analysis of a `Grid` for rendering purposes.

This object defines the `Grid` in terms of two axes, "x" and "y". The axes are transposed based on whether the `origin` property of the `Grid` is horizontal or vertical. For horizontally-oriented `Grid`s, the x-axis represents columns and the y-axis represents rows. For vertically oriented `Grid`s, the x-axis represents rows and the y-axis represents columns.

Once a `GridProcessor` has been instantiated, the rendering `GridPeer` can make inquiries to it to determine how the HTML table representing the Grid should be rendered.

Upon instantiation, the dimensions of the grid are calculated, and the content of each cell within those dimensions is determined. By specifying an "x" and "y" coordinate to various getXXX() methods, the renderer can determine what `Component` exists at a particular coordinate, how many rows and columns that `Component` spans, and the index of the `Component` within its parent `Grid`'s children.

This class should not be extended or used by classes outside of the Echo framework.

Constructor Summary
`GridProcessor(Grid grid)` Creates a new `GridProcessor` for the specified `Grid`.

Method Summary
`int` | `getColumnCount()` Returns the number of columns that should be rendered.
`int` | `getColumnSpan(int column, int row)` Returns the column span of the cell at the specified rendered index.
`Extent` | `getColumnWidth(int column)` Returns the width of the specified column index
`int` | `getComponentIndex(int column, int row)` Returns the index of the `Component` that should be rendered at the specified position within its parent `Grid` container.
`Component` | `getContent(int column, int row)` Returns the `Component` that should be rendered at the specified position.
`int` | `getRowCount()` Returns the number of rows that should be rendered.
`Extent` | `getRowHeight(int row)` Returns the height of the specified row index
`int` | `getRowSpan(int column, int row)` Returns the row span of the cell at the specified rendered index.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GridProcessor

    public GridProcessor(Grid grid)

  Creates a new `GridProcessor` for the specified `Grid`. Creating a new `GridProcessor` will cause immediately analyze the `Grid` which will immediately consume processor and memory resources. Such operations should be done at most once per rendering.

  Parameters:
    `grid` - the `Grid`

Method Detail

### getContent

    public Component getContent(int column,
                                int row)

  Returns the `Component` that should be rendered at the specified position.

  Parameters:
    `column` - the column index
    `row` - the row index
  Returns:
    the `Component` (may be null)

### getComponentIndex

    public int getComponentIndex(int column,
                                 int row)

  Returns the index of the `Component` that should be rendered at the specified position within its parent `Grid` container.

  Parameters:
    `column` - the column index
    `row` - the row index
  Returns:
    the index of the `Component` within its container.

### getColumnCount

    public int getColumnCount()

  Returns the number of columns that should be rendered.

  Returns:
    the number of rendered columns

### getRowCount

    public int getRowCount()

  Returns the number of rows that should be rendered.

  Returns:
    the number of rendered rows

### getColumnWidth

    public Extent getColumnWidth(int column)

  Returns the width of the specified column index

  Parameters:
    `column` - the column index
  Returns:
    the width

### getRowHeight

    public Extent getRowHeight(int row)

  Returns the height of the specified row index

  Parameters:
    `row` - the row index
  Returns:
    the height

### getColumnSpan

    public int getColumnSpan(int column,
                             int row)

  Returns the column span of the cell at the specified rendered index.

  Parameters:
    `column` - the column index
    `row` - the row index
  Returns:
    the column span (-1 will be returned in the event that no cell exists at the specified index)

### getRowSpan

    public int getRowSpan(int column,
                          int row)

  Returns the row span of the cell at the specified rendered index.

  Parameters:
    `column` - the column index
    `row` - the row index
  Returns:
    the row span (-1 will be returned in the event that no cell exists at the specified index)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD