|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.eliad.model.AbstractGenericModel | +--com.eliad.model.AbstractStyleModel | +--com.eliad.model.defaults.DefaultStyleModel
The DefaultStyleModel
furnishes a way to manage a StyleModel
which provides Editors and/or Renderers for cells or spans based on the class of the value.
A default editor and renderer is always provided.
Note: The DefaultStyleModel is always used as the default unless another StyleModel is provided.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
DefaultGridCellEditor
,
DefaultGridCellRenderer
,
GridCellEditor
,
GridCellRenderer
, Serialized FormInner Class Summary | |
static class |
DefaultStyleModel.BooleanEditor
A specific editor for truth values |
static class |
DefaultStyleModel.BooleanRenderer
A specific renderer for truth values |
static class |
DefaultStyleModel.DateRenderer
A Renderer specialized for date cells. |
static class |
DefaultStyleModel.DoubleRenderer
A Renderer further specialized for precision numeric cells. |
static class |
DefaultStyleModel.GenericEditor
A generic editor usable with most basic data types. |
static class |
DefaultStyleModel.IconRenderer
A Renderer specialized for image cells. |
static class |
DefaultStyleModel.NumberEditor
A variant, adapted for numeric entry |
static class |
DefaultStyleModel.NumberRenderer
A Renderer specialized for numeric cells. |
static class |
DefaultStyleModel.ProxyLazyValue
Variant of UIDefaults.ProxyLazyValue that
allows you to specify a class loader. |
Fields inherited from class com.eliad.model.AbstractGenericModel |
listeners_ |
Constructor Summary | |
DefaultStyleModel()
|
|
DefaultStyleModel(boolean isLazyRequired)
|
Method Summary | |
protected void |
createDefaultEditors(boolean isLazyRequired)
Creates default cell editors for objects, numbers, and boolean values. |
protected void |
createDefaultRenderers(boolean isLazyRequired)
Creates default cell renderers for objects, numbers, doubles, dates, booleans, and icons. |
GridCellEditor |
getEditor(java.lang.Class clazz)
Returns the editor to be used by default. |
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. |
protected GridCellRenderer |
getRenderer(java.lang.Class aClass)
Returns the cell renderer to be used when no renderer has been set in a StyleModel . |
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 |
setEditor(java.lang.Class clazz,
GridCellEditor editor)
Sets a default cell editor. |
protected void |
setLazyEditor(java.lang.Class c,
java.lang.String s)
|
protected void |
setLazyRenderer(java.lang.Class c,
java.lang.String s)
|
protected void |
setLazyValue(java.util.Hashtable h,
java.lang.Class c,
java.lang.String s)
|
void |
setRenderer(java.lang.Class clazz,
GridCellRenderer renderer)
Sets a default class renderer to be used if no renderer has been set in a cell. |
void |
updateUI()
Notification from the UIManager that the L&F has changed.
|
Methods inherited from class com.eliad.model.AbstractStyleModel |
addStyleModelListener,
fireStyleEditorChanged,
fireStyleEditorModelChanged,
fireStyleModelChanged,
fireStyleRendererChanged,
fireStyleRendererModelChanged,
installUI,
removeStyleModelListener |
Methods inherited from class com.eliad.model.AbstractGenericModel |
getListenerCount,
getListeners |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DefaultStyleModel()
public DefaultStyleModel(boolean isLazyRequired)
Method Detail |
public void installUI(javax.swing.JComponent c)
protected void createDefaultRenderers(boolean isLazyRequired)
protected void createDefaultEditors(boolean isLazyRequired)
DefaultStyleModel.GenericEditor
public void updateUI()
UIManager
that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager
.StyleModel.updateUI()
,
JSmartGrid.updateUI()
,
JComponent.updateUI()
protected void setLazyValue(java.util.Hashtable h, java.lang.Class c, java.lang.String s)
protected void setLazyRenderer(java.lang.Class c, java.lang.String s)
protected void setLazyEditor(java.lang.Class c, java.lang.String s)
protected GridCellRenderer getRenderer(java.lang.Class aClass)
StyleModel
. During the rendering of cells the renderer is fetched from
a Hashtable
of entries according to the class of the cells in the column. If
there is no entry for this class
, the method returns
the entry for the most specific superclass. The DefaultStyleModel
installs entries
for Object
, Number
, and Boolean
, all of which can be modified
or replaced.clazz
- return the default cell renderer
for this classpublic void setRenderer(java.lang.Class clazz, GridCellRenderer renderer)
null
,
it removes the default renderer for this class.clazz
- set the default cell renderer for this classrenderer
- default cell renderer to be used for this classpublic GridCellEditor getEditor(java.lang.Class clazz)
Hashtable
of entries according to the class of the cell value. If
there is no entry for this class, the method returns
the entry for the most specific superclass. The DefaultStyleModel
installs entries
for Object
, Number
, and Boolean
, all of which can be modified
or replaced.clazz
- return the default cell editor for this classpublic void setEditor(java.lang.Class clazz, GridCellEditor editor)
isCellEditable
method in the GridModel
interface to ensure that this
JSmartGrid
will not start an editor in these cells.
If the editor is null
, removes the default editor for this
class.clazz
- set the default cell editor for this classeditor
- default cell editor to be used for this classGridModel.isCellEditable(int, int)
public GridCellRenderer getRenderer(java.lang.Class aClass, int row, int column, GridContext aGridContext)
GridCellRenderer
.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 ot left column of a span to render,
where 0 is the first column.GridCellRenderer
;
if null
the DefaultGridCellRenderer
will be used by the JSmartGrid
for this cell.DefaultGridCellRenderer
public GridCellEditor getEditor(java.lang.Class aClass, int row, int column, GridContext aGridContext)
GridCellEditor
.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 ot left column of a span to edit,
where 0 is the first column.GridCellEditor
;
if null
the cell will not be edited.StyleModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |