|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.jeppers.grid.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);
Field Summary | |
protected EventListenerList |
listenerList
List of event listeners |
Constructor Summary | |
AbstractGridModel()
|
Method Summary | |
void |
addGridModelListener(GridModelListener listener)
Adds a listener to the list that's notified each time a change to the data model occurs. |
void |
fireGridCellUpdated(int row,
int column)
Notifies all GridModelListeners that registered
themselves as listeners for this GridModel that the cell at
row and column has been updated |
void |
fireGridChanged(GridModelEvent e)
Forwards the given notification event to all GridModelListeners that registered
themselves as listeners for this GridModel. |
void |
fireGridColumnsDeleted(int firstColumn,
int lastColumn)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn] ,
inclusive, have been deleted. |
void |
fireGridColumnsInserted(int firstColumn,
int lastColumn)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn] ,
inclusive, have been inserted. |
void |
fireGridColumnsUpdated(int firstColumn,
int lastColumn)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn] ,
inclusive, have been inserted. |
void |
fireGridModelChanged()
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the entire model has changed |
void |
fireGridRowsDeleted(int firstRow,
int lastRow)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow] ,
inclusive, have been deleted. |
void |
fireGridRowsInserted(int firstRow,
int lastRow)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow] ,
inclusive, have been inserted. |
void |
fireGridRowsUpdated(int firstRow,
int lastRow)
Notifies all GridModelListeners that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow] ,
inclusive, have been updated. |
EventListener[] |
getListeners(Class listenerType)
Returns an array of all the listeners of the given type that were added to this model. |
void |
removeGridModelListener(GridModelListener listener)
Removes a listener from the list that's notified each time a change to the data model occurs. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.jeppers.grid.GridModel |
getColumnCount, getRowCount, getValueAt, isCellEditable, setValueAt |
Field Detail |
protected EventListenerList listenerList
Constructor Detail |
public AbstractGridModel()
Method Detail |
public void addGridModelListener(GridModelListener listener)
GridModel
addGridModelListener
in interface GridModel
listener
- the GridModelListener to addpublic void removeGridModelListener(GridModelListener listener)
GridModel
removeGridModelListener
in interface GridModel
listener
- the GridModelListener to removepublic EventListener[] getListeners(Class listenerType)
listenerType
notifications from this modelpublic void fireGridChanged(GridModelEvent e)
GridModelListeners
that registered
themselves as listeners for this GridModel.
e
- the event to be forwardedaddGridModelListener(net.sf.jeppers.grid.GridModelListener)
,
GridModelEvent
,
EventListenerList
public void fireGridCellUpdated(int row, int column)
GridModelListeners
that registered
themselves as listeners for this GridModel that the cell at
row
and column
has been updated
public void fireGridRowsInserted(int firstRow, int lastRow)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow]
,
inclusive, have been inserted.
public void fireGridRowsUpdated(int firstRow, int lastRow)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow]
,
inclusive, have been updated.
public void fireGridRowsDeleted(int firstRow, int lastRow)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the rows in the range [firstRow, lastRow]
,
inclusive, have been deleted.
public void fireGridColumnsInserted(int firstColumn, int lastColumn)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn]
,
inclusive, have been inserted.
public void fireGridColumnsUpdated(int firstColumn, int lastColumn)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn]
,
inclusive, have been inserted.
public void fireGridColumnsDeleted(int firstColumn, int lastColumn)
GridModelListeners
that
registered themselves as listeners for this GridModel
that the columns in the range [firstColumn, lastColumn]
,
inclusive, have been deleted.
public void fireGridModelChanged()
GridModelListeners
that
registered themselves as listeners for this GridModel
that the entire model has changed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |