| Package | org.aswing.event |
| Class | public class TableModelEvent |
| Inheritance | TableModelEvent ModelEvent |
TableModelEvent(source); // The data, ie. all rows changed TableModelEvent(source, HEADER_ROW); // Structure change, reallocate TableColumns TableModelEvent(source, 1); // Row 1 changed TableModelEvent(source, 3, 6); // Rows 3 to 6 inclusive changed TableModelEvent(source, 2, 2, 6); // Cell at (2, 6) changed TableModelEvent(source, 3, 6, ALL_COLUMNS, INSERT); // Rows (3, 6) were inserted TableModelEvent(source, 3, 6, ALL_COLUMNS, DELETE); // Rows (3, 6) were deletedIt is possible to use other combinations of the parameters, not all of them are meaningful. By subclassing, you can add other information, for example: whether the event WILL happen or DID happen. This makes the specification of rows in DELETE events more useful but has not been included in the swing package as the JTable only needs post-event notification.
| Method | Defined by | ||
|---|---|---|---|
|
TableModelEvent(source:TableModel, firstRow:int = -2, lastRow:int = -2, column:int, type:String)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int, column:int, type:String)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int, column:int)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int)
TableModelEvent(source:TableModel, row:int)
TableModelEvent(source:TableModel)
| TableModelEvent | ||
|
getColumn():int
Returns the column for the event.
| TableModelEvent | ||
|
getFirstRow():int
Returns the first row that changed.
| TableModelEvent | ||
|
getLastRow():int
Returns the last row that changed.
| TableModelEvent | ||
![]() |
getSource():Object
| ModelEvent | |
|
getType():String
| TableModelEvent | ||
| Constant | Defined by | ||
|---|---|---|---|
| ALL_COLUMNS : int = -1 [static] Specifies all columns in a row or rows.
| TableModelEvent | ||
| DELETE : String = "delete" [static] Identifies the removal of rows or columns.
| TableModelEvent | ||
| HEADER_ROW : int = -1 [static] Identifies the header row.
| TableModelEvent | ||
| INSERT : String = "insert" [static] Identifies the addtion of new rows or columns.
| TableModelEvent | ||
| UPDATE : String = "update" [static] Identifies a change to existing data.
| TableModelEvent | ||
| TableModelEvent | () | constructor |
public function TableModelEvent(source:TableModel, firstRow:int = -2, lastRow:int = -2, column:int, type:String)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int, column:int, type:String)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int, column:int)
TableModelEvent(source:TableModel, firstRow:int, lastRow:int)
TableModelEvent(source:TableModel, row:int)
TableModelEvent(source:TableModel)
HEADER_ROW as the value for the row.
When the JTable receives this event and its
autoCreateColumnsFromModel
flag is set it discards any TableColumns that it had and reallocates
default ones in the order they appear in the model. This is the
same as calling setModel(TableModel) on the JTable.
TableModel
to get the new row count and all the appropriate values.
The JTable will repaint the entire visible region on
receiving this event, querying the model for the cell values that are visible.
The structure of the table ie, the column names, types and order
have not changed.
source:TableModel |
|
firstRow:int (default = -2) |
|
lastRow:int (default = -2) |
|
column:int |
|
type:String |
| getColumn | () | method |
public function getColumn():intReturns the column for the event. If the return value is ALL_COLUMNS; it means every column in the specified rows changed.
Returnsint |
| getFirstRow | () | method |
public function getFirstRow():intReturns the first row that changed. HEADER_ROW means the meta data, ie. names, types and order of the columns.
Returnsint |
| getLastRow | () | method |
public function getLastRow():intReturns the last row that changed.
Returnsint |
| getType | () | method |
public function getType():String
Returns
String |
| ALL_COLUMNS | constant |
public static const ALL_COLUMNS:int = -1Specifies all columns in a row or rows.
| DELETE | constant |
public static const DELETE:String = "delete"Identifies the removal of rows or columns.
| HEADER_ROW | constant |
public static const HEADER_ROW:int = -1Identifies the header row.
| INSERT | constant |
public static const INSERT:String = "insert"Identifies the addtion of new rows or columns.
| UPDATE | constant |
public static const UPDATE:String = "update"Identifies a change to existing data.