|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
com.guigarage.jgrid.ui.GridUI
com.guigarage.jgrid.ui.BasicGridUI
public class BasicGridUI
A basic L&F implementation of GridUI. This implementation is not static, i.e. there's one UIView implementation for every JGrid objects.
| Field Summary | |
|---|---|
protected JGrid |
grid
|
| Constructor Summary | |
|---|---|
BasicGridUI()
|
|
| Method Summary | |
|---|---|
int |
getCellAt(Point point)
Returns the index of the cell that point lies in or -1 if
point is not in a cell |
Rectangle |
getCellBounds(int index)
Returns the Bounds of the cell with index |
int[] |
getCellsIntersectedBy(Rectangle rect)
Returns the indexes of cells that intersect with rect, or an
empty array if none do |
int |
getColumnCount()
Returns the current count of columns in the grid |
int |
getColumnForIndex(int selectedIndex)
Returns the index of the column where modelIndex is in |
int |
getIndexAt(int row,
int column)
Returns the model-index of the cell at row /
column |
protected int |
getPreferredHeightForWidth(int width)
Returns the preferred height of the JGrid for the specified width |
Dimension |
getPreferredSize(JComponent c)
|
int |
getRowCount()
Returns the current count of rows in the grid |
int |
getRowForIndex(int selectedIndex)
Returns the index of the row where modelIndex is in |
void |
installUI(JComponent c)
|
protected boolean |
isDebugMode()
Helper for debbuging. |
void |
markCellBoundsAsDirty()
Marks the bounds of all rendered cells as dirty. |
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintCell(Graphics g,
JComponent c,
int index,
Rectangle bounds,
int leadIndex)
Paints the specified cell. |
protected void |
paintCellBorder(Graphics g,
JComponent c,
int index,
Rectangle bounds,
int leadIndex)
Paints the Border for the specified cell. |
void |
uninstallUI(JComponent c)
|
| Methods inherited from class javax.swing.plaf.ComponentUI |
|---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JGrid grid
| Constructor Detail |
|---|
public BasicGridUI()
| Method Detail |
|---|
public void installUI(JComponent c)
installUI in class ComponentUIpublic void uninstallUI(JComponent c)
uninstallUI in class ComponentUIpublic int getCellAt(Point point)
GridUIpoint lies in or -1 if
point is not in a cell
getCellAt in class GridUIpoint - the location of interest
protected boolean isDebugMode()
protected int getPreferredHeightForWidth(int width)
width - the given width
public Dimension getPreferredSize(JComponent c)
getPreferredSize in class ComponentUI
public void paint(Graphics g,
JComponent c)
paint in class ComponentUI
protected void paintCellBorder(Graphics g,
JComponent c,
int index,
Rectangle bounds,
int leadIndex)
Graphics object to render the Border of the cell.
g - the Graphics context in which to paintc - the JGrid being paintedindex - the cellindexbounds - the bounds of the cell
protected void paintCell(Graphics g,
JComponent c,
int index,
Rectangle bounds,
int leadIndex)
Graphics object to render the cell.
g - the Graphics context in which to paintc - the JGrid being paintedindex - the cellindexbounds - the bounds of the cellpublic Rectangle getCellBounds(int index)
GridUIindex
getCellBounds in class GridUIindex - the model-index
public int getColumnCount()
GridUI
getColumnCount in class GridUI
public int getIndexAt(int row,
int column)
GridUIrow /
column
getIndexAt in class GridUIrow - the row of the cellcolumn - the column of the cell
public int getRowCount()
GridUI
getRowCount in class GridUIpublic int getRowForIndex(int selectedIndex)
GridUImodelIndex is in
getRowForIndex in class GridUIpublic int getColumnForIndex(int selectedIndex)
GridUImodelIndex is in
getColumnForIndex in class GridUIpublic void markCellBoundsAsDirty()
GridUI
markCellBoundsAsDirty in class GridUIpublic int[] getCellsIntersectedBy(Rectangle rect)
GridUIrect, or an
empty array if none do
getCellsIntersectedBy in class GridUIrect - the area of interest
rect, in ascending order
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||