|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel javax.swing.table.DefaultTableModel PIRL.Conductor.Procedures_Table_Model
public class Procedures_Table_Model
A Procedures_Table_Model contains a table of Conductor procedure definition records.
Field Summary | |
---|---|
int |
Current_Row
The row designated as the currently active procedure definitiion of the table. |
boolean |
Editable
Flag that determines if the table cells are editable. |
static String |
ID
Class identification name with source code version and date. |
Fields inherited from class javax.swing.table.DefaultTableModel |
---|
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
Procedures_Table_Model()
Construct an empty Procedures_Table_Model. |
|
Procedures_Table_Model(String[] field_names)
Construct a Procedures_Table_Model from a Vector of field names but no table data. |
|
Procedures_Table_Model(String[][] records,
String[] field_names)
Construct a Procedures_Table_Model from an array of data record arrays and an array of field names. |
|
Procedures_Table_Model(Vector field_names)
Construct a Procedures_Table_Model from a Vector of field names but no table data. |
|
Procedures_Table_Model(Vector records,
Vector field_names)
Construct a Procedures_Table_Model from a Vector of data record Vectors and a Vector of field names. |
Method Summary | |
---|---|
Vector |
Column_Names()
The table field names. |
Class |
getColumnClass(int column)
Get the Class for a table column. |
Object |
getValueAt(int row,
int column)
Get a table cell value. |
void |
insertRow(int row,
Vector record)
Insert a procedure definition record in the table. |
boolean |
isCellEditable(int row,
int column)
Test if a table cell is editable. |
Vector |
Record(int row)
Get the procedure definition record at a table row index. |
Procedures_Table_Model |
Record(int row,
Vector record)
Set the procedure definition record at a table row index. |
static Vector |
Record(Vector record)
Copy record data. |
void |
Restore()
Restore the table content from the last snapshot . |
void |
setDataVector(Vector records,
Vector field_names)
Replace the table data content. |
Vector |
Snapshot_Column_Names()
The last table field names snapshot. |
Vector |
Snapshot_Table_Data()
The last table data records snapshot. |
void |
Snapshot()
Save a snapshot of the table contents. |
static Vector |
Table(Vector records)
Copy table data. |
Methods inherited from class javax.swing.table.DefaultTableModel |
---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setNumRows, setRowCount, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ID
public boolean Editable
public int Current_Row
Constructor Detail |
---|
public Procedures_Table_Model()
public Procedures_Table_Model(Vector records, Vector field_names)
records
- A Vector of records; each record is a Vector of
field value Strings any of which may be null.field_names
- A Vector of field_name Strings.setDataVector(Vector, Vector)
public Procedures_Table_Model(String[][] records, String[] field_names)
records
- An array of records; each record is an array of
field value Strings any of which may be null.field_names
- An array of field_name Strings.setDataVector(Vector, Vector)
public Procedures_Table_Model(Vector field_names)
A snapshot
of the model is taken.
field_names
- A Vector of field_name Strings.public Procedures_Table_Model(String[] field_names)
A snapshot
of the model is taken.
field_names
- An array of field_name Strings.Method Detail |
---|
public Class getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
column
- A table column index.
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
getValueAt
in class DefaultTableModel
row
- A table row index.column
- A table column index.
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class DefaultTableModel
row
- A table row index.column
- A table column index.
Editable
flag.public void setDataVector(Vector records, Vector field_names)
Both the field names and procedure records are replaced.
A snapshot
of the model is taken.
setDataVector
in class DefaultTableModel
records
- A Vector of records; each record is a Vector of
field value Strings any of which may be null.field_names
- A Vector of field_name Strings.public void insertRow(int row, Vector record)
The table snapshot data is updated with the new record.
insertRow
in class DefaultTableModel
row
- A table row index. This must be in the range zero to the
total number of records in the table, inclusive. If the row
equals the total number of records in the table the record is
appended to the table.record
- A procedure definition record Vector. It's size must
be the same as the table's column count
.public Vector Record(int row)
row
- A table row index. This must be in the range zero to the
total number of records in the table, exclusive.
public Procedures_Table_Model Record(int row, Vector record)
If a new row is added to the table the table snapshot data is updated with the new record.
Notification of the row record being updated or added will be generated.
row
- A table row index. This must be in the range zero to the
total number of records in the table, inclusive. If the row
equals the total number of records in the table the record is
appended to the table. Otherwise the record replaces the existing
record at the row index.record
- A procedure definition record Vector. It's size must
be the same as the table's column count
.
ArrayIndexOutOfBoundsException
- If the row index is invalid
or the record size is not the same as the number of columns in
the table.public void Restore()
snapshot
.
The table records are restored from a copy of the last snapshot table data
. If the number of table
columns has changed since the last snapshot the field names are also
restored from a copy of the last snapshot column names
. N.B.: No check is made if the field
names have changed; full table content can be forced by:
setDataVector
(Table (Snapshot_Table_Data ()),
Record (Snapshot_Column_Names ()));
Notification of the change to the table contents will be generated.
Snapshot()
public void Snapshot()
Both the table data records and field names are saved.
Snapshot_Table_Data()
,
Snapshot_Column_Names()
public Vector Snapshot_Table_Data()
snapshot
was taken.
N.B.: The returned Vector is the snapshot data, not a
copy.public Vector Snapshot_Column_Names()
snapshot
was taken.
N.B.: The returned Vector is the snapshot data, not a
copy.public Vector Column_Names()
public static Vector Table(Vector records)
The table is a Vector of row record Vectors. The table is expected to be square: the size of the first row record determines the size of all other rows; no attempt is made to compensenate for an irregular table.
The data elements are not copied; the reference to each element Object is copied. For the expected case where the data elements are Strings, which are immutable, there is no concern that changes in the copied data will affect the copy, or vice versa.
records
- A Vector of records; each record is a Vector of
field value Strings any of which may be null.
public static Vector Record(Vector record)
record
- A Vector of field value Strings any of which may be null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |