com.guigarage.jgrid.ui
Class GridUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by com.guigarage.jgrid.ui.GridUI
Direct Known Subclasses:
BasicGridUI

public abstract class GridUI
extends ComponentUI

Look and feel interface for JGrid.

Since:
0.3
Version:
0.1
Author:
Hendrik Ebbers

Constructor Summary
GridUI()
           
 
Method Summary
abstract  int getCellAt(Point point)
          Returns the index of the cell that point lies in or -1 if point is not in a cell
abstract  Rectangle getCellBounds(int index)
          Returns the Bounds of the cell with index
abstract  int[] getCellsIntersectedBy(Rectangle rect)
          Returns the indexes of cells that intersect with rect, or an empty array if none do
abstract  int getColumnCount()
          Returns the current count of columns in the grid
abstract  int getColumnForIndex(int modelIndex)
          Returns the index of the column where modelIndex is in
abstract  int getIndexAt(int row, int column)
          Returns the model-index of the cell at row / column
abstract  int getRowCount()
          Returns the current count of rows in the grid
abstract  int getRowForIndex(int modelIndex)
          Returns the index of the row where modelIndex is in
abstract  void markCellBoundsAsDirty()
          Marks the bounds of all rendered cells as dirty.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridUI

public GridUI()
Method Detail

getCellsIntersectedBy

public abstract int[] getCellsIntersectedBy(Rectangle rect)
Returns the indexes of cells that intersect with rect, or an empty array if none do

Parameters:
rect - the area of interest
Returns:
array of cell indexes intersected by rect, in ascending order

getCellAt

public abstract int getCellAt(Point point)
Returns the index of the cell that point lies in or -1 if point is not in a cell

Parameters:
point - the location of interest
Returns:
cellindex at the point

getCellBounds

public abstract Rectangle getCellBounds(int index)
Returns the Bounds of the cell with index

Parameters:
index - the model-index
Returns:
Bounds of the cell at the given index

getColumnCount

public abstract int getColumnCount()
Returns the current count of columns in the grid

Returns:
count of columns in the grid

getIndexAt

public abstract int getIndexAt(int row,
                               int column)
Returns the model-index of the cell at row / column

Parameters:
row - the row of the cell
column - the column of the cell
Returns:
model-index of the cell

getRowCount

public abstract int getRowCount()
Returns the current count of rows in the grid

Returns:
count of rows in the grid

getRowForIndex

public abstract int getRowForIndex(int modelIndex)
Returns the index of the row where modelIndex is in

Parameters:
selectedIndex - the model-index
Returns:
index of the row

getColumnForIndex

public abstract int getColumnForIndex(int modelIndex)
Returns the index of the column where modelIndex is in

Parameters:
selectedIndex - the model-index
Returns:
index of the column

markCellBoundsAsDirty

public abstract void markCellBoundsAsDirty()
Marks the bounds of all rendered cells as dirty. Next time the bounds are needed or the grid is rendered all bounds will refreshed



Copyright © 2012. All Rights Reserved.