|
||||||||||
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.AbstractGridModel
This abstract class provides default implementations for most of
the methods in the GridModel
interface. It takes care of
the management of listeners and provides some conveniences for generating
GridModelEvents
and dispatching them to the listeners.
To create a concrete GridModel
as a subclass of
AbstractGridModel
you need only provide implementations
for the following three methods:
public int getRowCount(); public int getColumnCount(); public Object getValueAt(int row, int column);
Fields inherited from class com.eliad.model.AbstractGenericModel |
listeners_ |
Constructor Summary | |
AbstractGridModel()
|
Method Summary | |
void |
addGridModelListener(GridModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs. |
void |
fireGridCellsChanged(int firstRow,
int firstColumn,
int rowCount,
int columnCount)
Forwards a "data changed" notification event to all GridModelListeners that are registered
for this grid model. |
void |
fireGridColumnsChanged(int firstColumn,
int columnCount)
Forwards a "data changed" notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridColumnsDeleted(int firstColumn,
int columnCount)
Forwards a columns removed notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridColumnsInserted(int firstColumn,
int columnCount)
Forwards a columns added notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridModelChanged()
Forwards a "structure totally changed" notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridRowsChanged(int firstRow,
int rowCount)
Forwards a "data changed" notification event to all GridModelListeners that are
registered for this grid model. |
void |
fireGridRowsDeleted(int firstRow,
int rowCount)
Forwards a rows removed notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridRowsInserted(int firstRow,
int rowCount)
Forwards a rows added notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
void |
fireGridStructureChanged(int type,
int first,
int count)
Forwards a "structure incrementally changed" notification event to all GridModelListeners that registered
themselves as listeners for this grid model. |
boolean |
isCellEditable(int row,
int column)
Returns whether the cell at row and column is editable.
|
protected void |
propagateDataChange(GridModelEvent e)
|
protected void |
propagateModelChange(GridModelEvent e)
|
protected void |
propagateStructureChange(GridModelEvent e)
|
void |
removeGridModelListener(GridModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
void |
setValueAt(java.lang.Object aValue,
int row,
int column)
Sets the value in the cell at column and row
to aValue .
|
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 AbstractGridModel()
Method Detail |
public boolean isCellEditable(int row, int column)
row
and column
is editable.
The default implementation for all cells is false.row
- the row being queriedcolumn
- the column being queriedpublic void setValueAt(java.lang.Object aValue, int row, int column)
column
and row
to aValue
.
This empty implementation is provided so developpers don't have to implement
this method if their data model is not editable.aValue
- value to assign to cellrow
- row of cellcolumn
- column of cellpublic void addGridModelListener(GridModelListener l)
l
- the GridModelListenerpublic void removeGridModelListener(GridModelListener l)
l
- the GridModelListenerprotected void propagateDataChange(GridModelEvent e)
protected void propagateModelChange(GridModelEvent e)
protected void propagateStructureChange(GridModelEvent e)
public void fireGridCellsChanged(int firstRow, int firstColumn, int rowCount, int columnCount)
GridModelListeners
that are registered
for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridRowsChanged(int firstRow, int rowCount)
GridModelListeners
that are
registered for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridColumnsChanged(int firstColumn, int columnCount)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridStructureChanged(int type, int first, int count)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridModelChanged()
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridRowsInserted(int firstRow, int rowCount)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridRowsDeleted(int firstRow, int rowCount)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridColumnsInserted(int firstColumn, int columnCount)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridColumnsDeleted(int firstColumn, int columnCount)
GridModelListeners
that registered
themselves as listeners for this grid model.addGridModelListener(com.eliad.model.GridModelListener)
,
GridModelEvent
,
EventListenerList
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |