| Package | org.aswing.table |
| Class | public class AbstractTableModel |
| Implements | TableModel |
| Subclasses | DefaultTableModel, PropertyTableModel, TableSorter |
TableModel interface. It takes care of
the management of listeners and provides some conveniences for generating
TableModelEvents and dispatching them to the listeners.
To create a concrete TableModel as a subclass of
AbstractTableModel you need only provide implementations
for the following three methods:
public function getRowCount():Number; public function getColumnCount():Number; public function getValueAt(row:Number, column:Number);
| Property | Defined by | ||
|---|---|---|---|
| columnClasses : Array | AbstractTableModel | ||
| listenerList : Array List of listeners
| AbstractTableModel | ||
| Method | Defined by | ||
|---|---|---|---|
| AbstractTableModel | |||
|
Adds a listener to the list that's notified each time a change
to the data model occurs.
| AbstractTableModel | ||
|
findColumn(columnName:String):int
Returns a column given its name.
| AbstractTableModel | ||
|
getColumnClass(columnIndex:int):String
Returns class name regardless of
columnIndex. | AbstractTableModel | ||
|
getColumnCount():int
Subclass must override this method.
| AbstractTableModel | ||
|
getColumnName(column:int):String
Returns a default name for the column using spreadsheet conventions:
A, B, C, ...
| AbstractTableModel | ||
|
getRowCount():int
Subclass must override this method.
| AbstractTableModel | ||
|
getTableModelListeners():Array
Returns an array of all the table model listeners
registered on this model.
| AbstractTableModel | ||
|
getValueAt(rowIndex:int, columnIndex:int):*
Subclass must override this method.
| AbstractTableModel | ||
|
isCellEditable(rowIndex:int, columnIndex:int):Boolean
Returns false.
| AbstractTableModel | ||
|
Removes a listener from the list that's notified each time a
change to the data model occurs.
| AbstractTableModel | ||
|
setColumnClass(columnIndex:int, className:String):void
Sets class name regardless of
columnIndex. | AbstractTableModel | ||
|
setValueAt(aValue:*, rowIndex:int, columnIndex:int):void
This empty implementation is provided so users don't have to implement
this method if their data model is not editable.
| AbstractTableModel | ||
|
toString():String
| AbstractTableModel | ||
| Method | Defined by | ||
|---|---|---|---|
|
fireTableCellUpdated(row:int, column:int):void
Notifies all listeners that the value of the cell at
[row, column] has been updated. | AbstractTableModel | ||
|
fireTableChanged(e:TableModelEvent):void
Forwards the given notification event to all
TableModelListeners that registered
themselves as listeners for this table model. | AbstractTableModel | ||
|
fireTableDataChanged():void
Notifies all listeners that all cell values in the table's
rows may have changed.
| AbstractTableModel | ||
|
fireTableRowsDeleted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been deleted. | AbstractTableModel | ||
|
fireTableRowsInserted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been inserted. | AbstractTableModel | ||
|
fireTableRowsUpdated(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been updated. | AbstractTableModel | ||
|
fireTableStructureChanged():void
Notifies all listeners that the table's structure has changed.
| AbstractTableModel | ||
| columnClasses | property |
protected var columnClasses:Array
| listenerList | property |
protected var listenerList:ArrayList of listeners
| AbstractTableModel | () | constructor |
public function AbstractTableModel()
| addTableModelListener | () | method |
public function addTableModelListener(l:TableModelListener):voidAdds a listener to the list that's notified each time a change to the data model occurs.
Parametersl:TableModelListener — the TableModelListener
|
| findColumn | () | method |
public function findColumn(columnName:String):int
Returns a column given its name.
Implementation is naive so this should be overridden if
this method is to be called often. This method is not
in the TableModel interface and is not used by the
JTable.
columnName:String — string containing name of column to be located
|
int — the column with columnName, or -1 if not found
|
| fireTableCellUpdated | () | method |
protected function fireTableCellUpdated(row:int, column:int):void
Notifies all listeners that the value of the cell at
[row, column] has been updated.
row:int — row of cell which has been updated
|
|
column:int — column of cell which has been updated
|
See also
| fireTableChanged | () | method |
protected function fireTableChanged(e:TableModelEvent):void
Forwards the given notification event to all
TableModelListeners that registered
themselves as listeners for this table model.
e:TableModelEvent — the event to be forwarded
|
See also
| fireTableDataChanged | () | method |
protected function fireTableDataChanged():void
Notifies all listeners that all cell values in the table's
rows may have changed. The number of rows may also have changed
and the 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.
See also
| fireTableRowsDeleted | () | method |
protected function fireTableRowsDeleted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been deleted.
firstRow:int — the first row
|
|
lastRow:int — the last row
|
See also
| fireTableRowsInserted | () | method |
protected function fireTableRowsInserted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been inserted.
firstRow:int — firstRow the first row
|
|
lastRow:int — lastRow the last row
|
See also
| fireTableRowsUpdated | () | method |
protected function fireTableRowsUpdated(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been updated.
firstRow:int — the first row
|
|
lastRow:int — the last row
|
See also
| fireTableStructureChanged | () | method |
protected function fireTableStructureChanged():void
Notifies all listeners that the table's structure has changed.
The number of columns in the table, and the names and types of
the new columns may be different from the previous state.
If the 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.
See also
| getColumnClass | () | method |
public function getColumnClass(columnIndex:int):String
Returns class name regardless of columnIndex.
columnIndex:int — the column being queried
|
String — the class name, default is "Object"
|
| getColumnCount | () | method |
public function getColumnCount():intSubclass must override this method.
Returnsint |
| getColumnName | () | method |
public function getColumnName(column:int):String
Returns a default name for the column using spreadsheet conventions:
A, B, C, ... Z, AA, AB, etc. If column cannot be found,
returns an empty string.
column:int — the column being queried
|
String — a string containing the default name of column
|
| getRowCount | () | method |
public function getRowCount():intSubclass must override this method.
Returnsint |
| getTableModelListeners | () | method |
public function getTableModelListeners():ArrayReturns an array of all the table model listeners registered on this model.
ReturnsArray — all of this model's TableModelListeners
or an empty
array if no table model listeners are currently registered
|
See also
| getValueAt | () | method |
public function getValueAt(rowIndex:int, columnIndex:int):*Subclass must override this method.
ParametersrowIndex:int |
|
columnIndex:int |
* |
| isCellEditable | () | method |
public function isCellEditable(rowIndex:int, columnIndex:int):BooleanReturns false. This is the default implementation for all cells.
ParametersrowIndex:int — rowIndex the row being queried
|
|
columnIndex:int — columnIndex the column being queried
|
Boolean — false
|
| removeTableModelListener | () | method |
public function removeTableModelListener(l:TableModelListener):voidRemoves a listener from the list that's notified each time a change to the data model occurs.
Parametersl:TableModelListener — the TableModelListener
|
| setColumnClass | () | method |
public function setColumnClass(columnIndex:int, className:String):void
Sets class name regardless of columnIndex.
columnIndex:int — the column being queried
|
|
className:String — the class name
|
| setValueAt | () | method |
public function setValueAt(aValue:*, rowIndex:int, columnIndex:int):voidThis empty implementation is provided so users don't have to implement this method if their data model is not editable.
ParametersaValue:* — aValue value to assign to cell
|
|
rowIndex:int — rowIndex row of cell
|
|
columnIndex:int — columnIndex column of cell
|
| toString | () | method |
public function toString():String
Returns
String |