com.eliad.model
Interface GridContext

All Known Implementing Classes:
AbstractGridContext

public interface GridContext

GridContext defines the interface for an object that gives information about the cell or span when a renderer or an editor is required by a Component.

Version:
1.0
Author:
Stephan Szymkowicz
See Also:
GridCellRenderer, GridCellEditor, StyleModel

Method Summary
 java.awt.Rectangle getBounds()
          Returns the bounds for the current cell inside the context component.
 int getColumn()
          Returns the column of the cell where rendering or editing will take place.
 int getColumnCount()
          Returns the column count of the cell where rendering or editing will take place.
 int getColumnTab(int column)
          Returns the column position for a column that is inside the current cell or span.
 java.awt.Component getComponent()
          Returns the component behind this GridContext.
 StyleContextModel getDefaultStyleContext()
          Returns the default style context model which was defined in the grid component as default cell attributes.
 java.lang.Object getIdentifier()
          Returns the identifier object attached to the cell that this GridContext refers to.
 int getRow()
          Returns the row of the cell where rendering or editing will take place.
 int getRowCount()
          Returns the row count of the cell where rendering or editing will take place.
 int getRowTab(int row)
          Returns the row position for a row that is inside the current cell or span.
 StyleModel getStyleModel()
          Returns the style model which was used to obtain the renderer or editor which will use this GridContext.
 

Method Detail

getComponent

public java.awt.Component getComponent()
Returns the component behind this GridContext. This will normally be a container.
Returns:
the Component that this GridContext is linked to.

getStyleModel

public StyleModel getStyleModel()
Returns the style model which was used to obtain the renderer or editor which will use this GridContext. May be null.
Returns:
the StyleModel which is using the current GridContext.

getDefaultStyleContext

public StyleContextModel getDefaultStyleContext()
Returns the default style context model which was defined in the grid component as default cell attributes. May be null.
Returns:
the StyleContextModel which defined the default attributes of a cell.

getColumn

public int getColumn()
Returns the column of the cell where rendering or editing will take place.
Returns:
the column of the cell or left column of the span where rendering will take place.

getRow

public int getRow()
Returns the row of the cell where rendering or editing will take place.
Returns:
the row of the cell or top row of the span where rendering will take place.

getColumnCount

public int getColumnCount()
Returns the column count of the cell where rendering or editing will take place.
Returns:
the column count of the cell or span.

getRowCount

public int getRowCount()
Returns the row count of the cell where rendering or editing will take place.
Returns:
the row count of the cell or span.

getIdentifier

public java.lang.Object getIdentifier()
Returns the identifier object attached to the cell that this GridContext refers to.

getBounds

public java.awt.Rectangle getBounds()
Returns the bounds for the current cell inside the context component.
Returns:
the bounds of the cell or span in the component native coordinates.

getColumnTab

public int getColumnTab(int column)
Returns the column position for a column that is inside the current cell or span.
Returns:
the column position of the current cell or span in the component native coordinates.
Preconditions:
column >=0 && column <= getColumnCount()
Postconditions:
return >= 0

getRowTab

public int getRowTab(int row)
Returns the row position for a row that is inside the current cell or span.
Returns:
the row position of the current cell or span in the component native coordinates.
Preconditions:
row >=0 && row <= getRowCount()
Postconditions:
return >= 0