net.sf.jeppers.grid
Class DefaultStyleModel

java.lang.Object
  |
  +--net.sf.jeppers.grid.AbstractStyleModel
        |
        +--net.sf.jeppers.grid.DefaultStyleModel
All Implemented Interfaces:
ResizableGrid, StyleModel

public class DefaultStyleModel
extends AbstractStyleModel
implements ResizableGrid

Default implementation of StyleModel that uses a Map between class types and editors / renderers.

Author:
Cameron Zemek

Field Summary
 
Fields inherited from class net.sf.jeppers.grid.AbstractStyleModel
listenerList
 
Constructor Summary
DefaultStyleModel()
           
 
Method Summary
 CellStyle getCellStyle(int row, int column)
          Returns the style for the cell at row, column.
 CellStyle getDefaultCellStyle()
           
 GridCellEditor getEditor(Class aClass, int row, int column, JGrid grid)
          Returns an appropriate editor for the cell specified by this row and column.
 GridCellRenderer getRenderer(Class aClass, int row, int column, JGrid grid)
          Returns an appropriate renderer for the cell specified by this row and column.
 void insertColumns(int column, int columnCount)
          Insert columnCount columns at column.
 void insertRows(int row, int rowCount)
          Insert rowCount rows at row.
 void removeColumns(int column, int columnCount)
          Remove columnCount columns at column.
 void removeRows(int row, int rowCount)
          Remove rowCount rows at row.
 void setCellStyle(CellStyle style, int row, int column)
           
 void setEditor(Class clazz, GridCellEditor editor)
           
 void setRenderer(Class clazz, GridCellRenderer renderer)
           
 void updateUI()
          Notification from the UIManager that the L&F has changed.
 
Methods inherited from class net.sf.jeppers.grid.AbstractStyleModel
addStyleModelListener, fireCellStyleChanged, fireCellStylesChanged, fireEditorAdded, fireEditorChanged, fireEditorRemoved, fireEditorsChanged, fireModelChanged, fireRendererAdded, fireRendererChanged, fireRendererRemoved, fireRenderersChanged, fireStyleChanged, getListeners, removeStyleModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultStyleModel

public DefaultStyleModel()
Method Detail

getEditor

public GridCellEditor getEditor(Class aClass,
                                int row,
                                int column,
                                JGrid grid)
Description copied from interface: StyleModel
Returns an appropriate editor for the cell specified by this row and column.

Specified by:
getEditor in interface StyleModel

setEditor

public void setEditor(Class clazz,
                      GridCellEditor editor)

getRenderer

public GridCellRenderer getRenderer(Class aClass,
                                    int row,
                                    int column,
                                    JGrid grid)
Description copied from interface: StyleModel
Returns an appropriate renderer for the cell specified by this row and column.

Specified by:
getRenderer in interface StyleModel

setRenderer

public void setRenderer(Class clazz,
                        GridCellRenderer renderer)

updateUI

public void updateUI()
Description copied from interface: StyleModel
Notification from the UIManager that the L&F has changed.

Specified by:
updateUI in interface StyleModel

getDefaultCellStyle

public CellStyle getDefaultCellStyle()

getCellStyle

public CellStyle getCellStyle(int row,
                              int column)
Description copied from interface: StyleModel
Returns the style for the cell at row, column.

Specified by:
getCellStyle in interface StyleModel

setCellStyle

public void setCellStyle(CellStyle style,
                         int row,
                         int column)

insertRows

public void insertRows(int row,
                       int rowCount)
Description copied from interface: ResizableGrid
Insert rowCount rows at row.

Specified by:
insertRows in interface ResizableGrid
Parameters:
row - the row to insert at
rowCount - the number of rows to insert

removeRows

public void removeRows(int row,
                       int rowCount)
Description copied from interface: ResizableGrid
Remove rowCount rows at row.

Specified by:
removeRows in interface ResizableGrid
Parameters:
row - the row to remove from
rowCount - the number of rows to remove

insertColumns

public void insertColumns(int column,
                          int columnCount)
Description copied from interface: ResizableGrid
Insert columnCount columns at column.

Specified by:
insertColumns in interface ResizableGrid
Parameters:
column - the column to insert at
columnCount - the number of columns to insert

removeColumns

public void removeColumns(int column,
                          int columnCount)
Description copied from interface: ResizableGrid
Remove columnCount columns at column.

Specified by:
removeColumns in interface ResizableGrid
Parameters:
column - the column to remove from
columnCount - the number of columns to remove