com.eliad.model
Interface StyleModel

All Known Implementing Classes:
AbstractStyleModel

public interface StyleModel

This is an interface that provides a way to implement a renderer and an editor collection model. The methods getRenderer and getEditor allow you to implement your own model to choose which renderer and/or editor the JSmartGrid should use, given a Class, a row, a column, and a GridContext.

This is also a source of StyleModelEvents.

A basic implementation of a style model is provided as DefaultStyleModel.

Version:
1.0
Author:
Stephan Szymkowicz
See Also:
StyleModelEvent, StyleModelListener, GridContext, GridCellRenderer, GridCellEditor

Method Summary
 void addStyleModelListener(StyleModelListener l)
          Adds a listener to the list that is notified each time a change to the style model occurs.
 GridCellEditor getEditor(java.lang.Class aClass, int row, int column, GridContext aGridContext)
          Returns an appropriate editor for the cell specified by this row and column.
 GridCellRenderer getRenderer(java.lang.Class aClass, int row, int column, GridContext aGridContext)
          Returns an appropriate renderer for the cell specified by this row and column.
 void installUI(javax.swing.JComponent c)
          Installation of particular graphics attributes
 void removeStyleModelListener(StyleModelListener l)
          Removes a listener from the list that is notified each time a change to the style model occurs.
 void updateUI()
          Notification from the UIManager that the L&F has changed.
 

Method Detail

installUI

public void installUI(javax.swing.JComponent c)
Installation of particular graphics attributes

updateUI

public void updateUI()
Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from the UIManager for all renderer and editor components.
See Also:
JSmartGrid.updateUI(), JComponent.updateUI()

getRenderer

public GridCellRenderer getRenderer(java.lang.Class aClass,
                                    int row,
                                    int column,
                                    GridContext aGridContext)
Returns an appropriate renderer for the cell specified by this row and column.
Parameters:
row - the row of the cell or top row of a span to render, where 0 is the first row.
column - the column of the cell or left column of a span to render, where 0 is the first column.
Returns:
the assigned renderer as a GridCellRenderer; if null the DefaultGridCellRenderer will be used by the JSmartGrid for this cell.
See Also:
DefaultGridCellRenderer

getEditor

public GridCellEditor getEditor(java.lang.Class aClass,
                                int row,
                                int column,
                                GridContext aGridContext)
Returns an appropriate editor for the cell specified by this row and column.
Parameters:
row - the row of the cell or top row of a span to edit, where 0 is the first row.
column - the column of the cell or left column of a span to edit, where 0 is the first column.
Returns:
the assigned renderer as a GridCellRenderer; if null the DefaultGridCellEditor will be used by the JSmartGrid for this cell.
See Also:
DefaultGridCellEditor

addStyleModelListener

public void addStyleModelListener(StyleModelListener l)
Adds a listener to the list that is notified each time a change to the style model occurs.
Parameters:
l - the StyleModelListener

removeStyleModelListener

public void removeStyleModelListener(StyleModelListener l)
Removes a listener from the list that is notified each time a change to the style model occurs.
Parameters:
l - the StyleModelListener