|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.zfqjava.swing.AbstractDataGridModel
Field Summary | |
protected javax.swing.event.EventListenerList |
listenerList
List of listeners |
Constructor Summary | |
AbstractDataGridModel()
|
Method Summary | |
void |
addDataGridModelListener(DataGridModelListener l)
Adds a listener to the list that is notified each time a change to the data model occurs. |
void |
addTableModelListener(javax.swing.event.TableModelListener l)
Adds a listener to the list that's notified each time a change to the data model occurs. |
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Registers the given observer to begin receiving notifications when undoable edits are made to the model. |
protected void |
fireCellAttributesChanged(Cell c)
Notifies all listeners that cell attributes have been changed. |
protected void |
fireCellAttributesChanged(int rowIndex,
int columnIndex)
Notifies all listeners that cell attributes have been changed. |
protected void |
fireCellChanged(Cell c)
Notifies all listeners that all cell object have been changed. |
protected void |
fireCellChanged(DataGridModelEvent e)
Notifies all listeners that cell have been changed. |
protected void |
fireCellClassChanged(Cell c)
Notifies all listeners that cell class have been changed. |
protected void |
fireCellClassChanged(int rowIndex,
int columnIndex)
Notifies all listeners that cell class have been changed. |
protected void |
fireCellEditableChanged(Cell c)
Notifies all listeners that cell editable have been changed. |
protected void |
fireCellEditableChanged(int rowIndex,
int columnIndex)
Notifies all listeners that cell editable have been changed. |
protected void |
fireCellSpanChanged(Cell c)
Notifies all listeners that cell span have been changed. |
protected void |
fireCellSpanChanged(int firstRow,
int lastRow,
int firstColumn,
int lastColumn)
Notifies all listeners that cell span have been changed. |
protected void |
fireCellValueChanged(Cell c)
Notifies all listeners that cell value have been changed. |
protected void |
fireTableCellUpdated(int row,
int column)
Notifies all listeners that the value of the cell at [row, column] has been updated. |
protected void |
fireTableChanged(javax.swing.event.TableModelEvent e)
Forwards the given notification event to all TableModelListeners that registered
themselves as listeners for this table model. |
protected void |
fireTableColumnsDeleted(int firstColumn,
int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn] , inclusive, have been deleted. |
protected void |
fireTableColumnsInserted(int firstColumn,
int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn] , inclusive, have been inserted. |
protected void |
fireTableColumnsUpdated(int firstColumn,
int lastColumn)
Notifies all listeners that columns in the range [firstColumn, lastColumn] , inclusive, have been updated. |
protected void |
fireTableColumnUpdated(int column)
Notifies all listeners that the value of the colum at column has been updated. |
protected void |
fireTableDataChanged()
Notifies all listeners that all cell values in the table's rows may have changed. |
protected void |
fireTableRowsDeleted(int firstRow,
int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow] , inclusive, have been deleted. |
protected void |
fireTableRowsInserted(int firstRow,
int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow] , inclusive, have been inserted. |
protected void |
fireTableRowsUpdated(int firstRow,
int lastRow)
Notifies all listeners that rows in the range [firstRow, lastRow] , inclusive, have been updated. |
protected void |
fireTableRowUpdated(int row)
Notifies all listeners that the value of the row at row has been updated. |
protected void |
fireTableStructureChanged()
Notifies all listeners that the table's structure has changed. |
protected void |
fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
Notifies all listeners that have registered interest for notification on this event type. |
java.lang.Class |
getColumnClass(int columnIndex)
Returns Object.class regardless of columnIndex . |
java.lang.String |
getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... |
DataGridModelListener[] |
getDataGridModelListeners()
Returns an array of all the data grid model listeners registered on this model. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Returns an array of all the objects currently registered as FooListener s
upon this AbstractTableModel . |
javax.swing.event.TableModelListener[] |
getTableModelListeners()
Returns an array of all the table model listeners registered on this model. |
javax.swing.event.UndoableEditListener[] |
getUndoableEditListeners()
Returns an array of all the undoable edit listeners registered on this model. |
void |
removeDataGridModelListener(DataGridModelListener l)
Removes a listener from the list that is notified each time a change to the data model occurs. |
void |
removeTableModelListener(javax.swing.event.TableModelListener l)
Removes a listener from the list that's notified each time a change to the data model occurs. |
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Unregisters the given observer from the notification list so it will no longer receive updates. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.zfqjava.swing.DataGridModel |
getCellAttributes, getCellClass, getCellSpans, getCellSpans, getSpannedCells, hasCellSpans, hasCellSpans, isSpannedCell, merge, setCellAttributes, setCellClass, setCellEditable, setColumnClass, setColumnCount, setColumnName, setRowCount, split |
Methods inherited from interface javax.swing.table.TableModel |
getColumnCount, getRowCount, getValueAt, isCellEditable, setValueAt |
Field Detail |
protected transient javax.swing.event.EventListenerList listenerList
Constructor Detail |
public AbstractDataGridModel()
Method Detail |
public java.lang.String getColumnName(int column)
column
cannot be found,
returns an empty string.getColumnName
in interface javax.swing.table.TableModel
column
- the column being queriedcolumn
public java.lang.Class getColumnClass(int columnIndex)
Object.class
regardless of columnIndex
.getColumnClass
in interface javax.swing.table.TableModel
columnIndex
- the column being queriedpublic void addTableModelListener(javax.swing.event.TableModelListener l)
addTableModelListener
in interface javax.swing.table.TableModel
l
- the TableModelListenerpublic void removeTableModelListener(javax.swing.event.TableModelListener l)
removeTableModelListener
in interface javax.swing.table.TableModel
l
- the TableModelListenerpublic javax.swing.event.TableModelListener[] getTableModelListeners()
TableModelListener
s
or an empty
array if no table model listeners are currently registeredaddTableModelListener(javax.swing.event.TableModelListener)
,
removeTableModelListener(javax.swing.event.TableModelListener)
protected void fireTableDataChanged()
JTable
should redraw the
table from scratch. The structure of the table (as in the order of the
columns) is assumed to be the same.TableModelEvent
,
EventListenerList
,
JTable.tableChanged(TableModelEvent)
protected void fireTableStructureChanged()
JTable
receives this event and its
autoCreateColumnsFromModel
flag is set it discards any table columns that it had and reallocates
default columns in the order they appear in the model. This is the
same as calling setModel(TableModel)
on the
JTable
.TableModelEvent
,
EventListenerList
protected void fireTableRowsInserted(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been inserted.firstRow
- the first rowlastRow
- the last rowTableModelEvent
,
EventListenerList
protected void fireTableRowsUpdated(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been updated.firstRow
- the first rowlastRow
- the last rowTableModelEvent
,
EventListenerList
protected void fireTableRowsDeleted(int firstRow, int lastRow)
[firstRow, lastRow]
, inclusive, have been deleted.firstRow
- the first rowlastRow
- the last rowTableModelEvent
,
EventListenerList
protected void fireTableColumnsInserted(int firstColumn, int lastColumn)
[firstColumn, lastColumn]
, inclusive, have been inserted.firstColumn
- the first columnlastColumn
- the last columnTableModelEvent
,
EventListenerList
protected void fireTableColumnsUpdated(int firstColumn, int lastColumn)
[firstColumn, lastColumn]
, inclusive, have been updated.firstColumn
- the first columnlastColumn
- the last columnTableModelEvent
,
EventListenerList
protected void fireTableColumnsDeleted(int firstColumn, int lastColumn)
[firstColumn, lastColumn]
, inclusive, have been deleted.firstColumn
- the first columnlastColumn
- the last columnTableModelEvent
,
EventListenerList
protected void fireTableColumnUpdated(int column)
column
has been updated.column
- column which has been updatedTableModelEvent
,
EventListenerList
protected void fireTableRowUpdated(int row)
row
has been updated.row
- row which has been updatedTableModelEvent
,
EventListenerList
protected void fireTableCellUpdated(int row, int column)
[row, column]
has been updated.row
- row of cell which has been updatedcolumn
- column of cell which has been updatedTableModelEvent
,
EventListenerList
protected void fireTableChanged(javax.swing.event.TableModelEvent e)
TableModelListeners
that registered
themselves as listeners for this table model.e
- the event to be forwardedaddTableModelListener(javax.swing.event.TableModelListener)
,
TableModelEvent
,
EventListenerList
public void addDataGridModelListener(DataGridModelListener l)
addDataGridModelListener
in interface DataGridModel
l
- the DataGridModelListenerpublic void removeDataGridModelListener(DataGridModelListener l)
removeDataGridModelListener
in interface DataGridModel
l
- the DataGridModelListenerpublic DataGridModelListener[] getDataGridModelListeners()
DataGridModelListener
s
or an empty
array if no data grid model listeners are currently registeredaddDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener)
,
removeDataGridModelListener(com.zfqjava.swing.event.DataGridModelListener)
protected void fireCellAttributesChanged(int rowIndex, int columnIndex)
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellAttributesChanged(Cell c)
c
- the specified cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellClassChanged(int rowIndex, int columnIndex)
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellClassChanged(Cell c)
c
- the specified cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellEditableChanged(int rowIndex, int columnIndex)
rowIndex
- the row index of the cellcolumnIndex
- the column index of the cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellEditableChanged(Cell c)
c
- the specified cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellSpanChanged(Cell c)
c
- the spanned cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellSpanChanged(int firstRow, int lastRow, int firstColumn, int lastColumn)
firstRow
- the first row index of the specified cell arealastRow
- the last row index of the specified cell areafirstColumn
- the first column index of the specified cell arealastColumn
- the last column index of the specified cell areaprotected void fireCellValueChanged(Cell c)
c
- the specified cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellChanged(Cell c)
c
- the specified cellfireCellChanged(com.zfqjava.swing.cell.Cell)
protected void fireCellChanged(DataGridModelEvent e)
public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
addUndoableEditListener
in interface DataGridModel
listener
- the observer to registerUndoableEditEvent
public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
removeUndoableEditListener
in interface DataGridModel
listener
- the observer to registerUndoableEditEvent
public javax.swing.event.UndoableEditListener[] getUndoableEditListeners()
UndoableEditListener
s
or an empty array if no undoable edit listeners are
currently registeredaddUndoableEditListener(javax.swing.event.UndoableEditListener)
,
removeUndoableEditListener(javax.swing.event.UndoableEditListener)
protected void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
EventListenerList
public java.util.EventListener[] getListeners(java.lang.Class listenerType)
FooListener
s
upon this AbstractTableModel
.
FooListener
s are registered using the
addFooListener
method.
You can specify the listenerType
argument
with a class literal,
such as
FooListener.class
.
For example, you can query a
model m
for its table model listeners with the following code:
TableModelListener[] tmls = (TableModelListener[])(m.getListeners(TableModelListener.class));If no such listeners exist, this method returns an empty array.
listenerType
- the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListener
s on this component,
or an empty array if no such
listeners have been addedClassCastException
- if listenerType
doesn't specify a class or interface that implements
java.util.EventListener
getTableModelListeners()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |