|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
com.sciapp.table.DefaultListTableModel
public class DefaultListTableModel
DefaultListTableModel is a subclass of DefaultTableModel that implements ListTableModel.
This makes it possible for this class to be used with other classes in this library,
i.e. ListTableMap, SortTableModel and FilterTableModel.
| Field Summary |
|---|
| Fields inherited from class javax.swing.table.DefaultTableModel |
|---|
columnIdentifiers, dataVector |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
DefaultListTableModel()
Constructs a default DefaultListTableModel which is a table of zero columns and zero rows. |
|
DefaultListTableModel(int numRows,
int numColumns)
Constructs a DefaultListTableModel with numRows and numColumns of null object values. |
|
DefaultListTableModel(Object[][] data,
Object[] columnNames)
Constructs a DefaultListTableModel and initializes the table by passing data and columnNames to the setDataVector() method. |
|
DefaultListTableModel(Object[] columnNames,
int numRows)
Constructs a DefaultListTableModel with as many columns as there are elements in columnNames and numRows of null object values. |
|
DefaultListTableModel(Vector columnNames,
int numRows)
Constructs a DefaultTableModel with as many columns as there are elements in columnNames and numRows of null object values. |
|
DefaultListTableModel(Vector data,
Vector columnNames)
Constructs a DefaultListTableModel and initializes the table by passing data and columnNames to the setDataVector() method. |
|
| Method Summary | |
|---|---|
void |
addRow(Object row)
Adds a row to the end of the model. |
void |
addRows(List addedRows)
Adds a list of rows to the end of the model. |
void |
clear()
Clears the model of any data. |
Object |
getCellValue(Object o,
int index)
Returns the Object found at index of row passed as a parameter. |
List |
getRows()
Returns the data of this tablemodel |
void |
removeRows(int[] deletedRows)
Removes a few rows from the data model |
| Methods inherited from class javax.swing.table.DefaultTableModel |
|---|
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sciapp.table.ListTableModel |
|---|
fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, removeRow |
| Methods inherited from interface javax.swing.table.TableModel |
|---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
| Constructor Detail |
|---|
public DefaultListTableModel()
public DefaultListTableModel(Object[][] data,
Object[] columnNames)
data - The data of the tablecolumnNames - The names of the columns.
public DefaultListTableModel(Object[] columnNames,
int numRows)
columnNames - Array containing the names of the new columns.
If this null then the model has no columnsnumRows - The number of rows the table holds
public DefaultListTableModel(int numRows,
int numColumns)
numRows - The number of rows the table holdsnumColumns - The number of columns the table holds
public DefaultListTableModel(Vector columnNames,
int numRows)
columnNames - Vector containing the names of the new columns.
If this null then the model has no columnsnumRows - The number of rows the table holds
public DefaultListTableModel(Vector data,
Vector columnNames)
data - The data of the tablecolumnNames - Vector containing the names of the new columns.| Method Detail |
|---|
public void addRow(Object row)
addRow in interface ListTableModelrow - the row being addedpublic void addRows(List addedRows)
addedRows contains objects representing the actual rows being added. e.g. java.util.Vector, for DefaultTableModel.
addRows in interface ListTableModeladdedRows - the rows being added.public void clear()
clear in interface ListTableModel
public Object getCellValue(Object o,
int index)
getCellValue in interface ListTableModelo - the row dataindex - an index
public List getRows()
getRows in interface ListTableModelpublic void removeRows(int[] deletedRows)
removeRows in interface ListTableModeldeletedRows - an integer array that contains indexes of the rows being deleted
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||