|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| 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.elegantj.jfc.table.DefaultJFCTableModel
This is an implementation of TableModel that uses a Vector of Vectors to store the cell value objects.
| Field Summary |
| Fields inherited from class javax.swing.table.DefaultTableModel |
columnIdentifiers, dataVector |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
DefaultJFCTableModel()
Constructs a default DefaultJFCTableModel which is a table of zero columns and zero rows. |
|
DefaultJFCTableModel(int rowCount,
int columnCount)
Constructs a DefaultJFCTableModel with rowCount and columnCount of null object values. |
|
DefaultJFCTableModel(java.lang.Object[][] data,
java.lang.Object[] columnNames)
Constructs a DefaultJFCTableModel and initializes the table by passing data and columnNames to the setDataVector method. |
|
DefaultJFCTableModel(java.lang.Object[] columnNames,
int rowCount)
Constructs a DefaultJFCTableModel with as many columns as there are elements in columnNames and rowCount of null object values. |
|
DefaultJFCTableModel(java.util.Vector columnNames,
int rowCount)
Constructs a DefaultJFCTableModel with as many columns as there are elements in columnNames and rowCount of null object values. |
|
DefaultJFCTableModel(java.util.Vector data,
java.util.Vector columnNames)
Constructs a DefaultJFCTableModel and initializes the table by passing data and columnNames to the setDataVector method. |
|
| Method Summary | |
void |
addColumn(java.lang.Object columnName,
java.util.Vector columnData)
Adds a column to the model. |
java.lang.String |
getColumnName(int column)
Returns the column name. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
Returns an array of all the listeners of the given type that were added to this model. |
void |
insertColumn(int column,
java.lang.Object columnName,
java.util.Vector columnData)
Inserts a column to the model at column index. |
void |
newRowsAdded(javax.swing.event.TableModelEvent e)
Ensures that the new rows have the correct number of columns. |
void |
removeColumn(int column)
Removes the column from the data model at specified index. |
void |
removeColumn(java.lang.String columnName)
Removes the column columnName from the data model. |
void |
removeRows(int[] rows)
Removes the rows at row indexes from the model. |
void |
setColumnCount(int columnCount)
Sets the number of columns in the model. |
void |
setColumnIdentifiers(java.util.Vector newIdentifiers)
Replaces the column identifiers in the model. |
void |
setDataVector(java.util.Vector dataVector)
Replaces the current dataVector instance variable with the new Vector of rows, newData. |
void |
setRowCount(int rowCount)
Sets the number of rows in the model. |
| Methods inherited from class javax.swing.table.DefaultTableModel |
addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, removeRow, rowsRemoved, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setValueAt |
| Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getTableModelListeners, removeTableModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultJFCTableModel()
public DefaultJFCTableModel(int rowCount,
int columnCount)
rowCount - the number of rows the table holdscolumnCount - the number of columns the table holds
public DefaultJFCTableModel(java.util.Vector columnNames,
int rowCount)
columnNames - vector containing the names
of the new columns; if this is
null then the model has no columnsrowCount - the number of rows the table holds
public DefaultJFCTableModel(java.lang.Object[] columnNames,
int rowCount)
columnNames - array containing the names
of the new columns; if this is
null then the model has no columnsrowCount - the number of rows the table holds
public DefaultJFCTableModel(java.util.Vector data,
java.util.Vector columnNames)
data - the data of the tablecolumnNames - vector containing the names of the new columns
public DefaultJFCTableModel(java.lang.Object[][] data,
java.lang.Object[] columnNames)
data - the data of the tablecolumnNames - the names of the columnsDefaultTableModel.getDataVector(),
setDataVector(java.util.Vector)| Method Detail |
public void setRowCount(int rowCount)
rowCount - the new number of rows in the modelpublic void setColumnCount(int columnCount)
columnCount - the new number of columns in the modelpublic void setColumnIdentifiers(java.util.Vector newIdentifiers)
newIdentifiers - vector of column identifiers. If
null, set the model to zero columns
public void addColumn(java.lang.Object columnName,
java.util.Vector columnData)
columnName - the identifier of the column being addedcolumnData - optional data of the column being addedpublic void removeColumn(int column)
column - the column index to be removedpublic void removeColumn(java.lang.String columnName)
columnName - the column name to be removed
public void insertColumn(int column,
java.lang.Object columnName,
java.util.Vector columnData)
columnName - the identifier of the column being addedcolumnData - optional data of the column being addedpublic java.lang.String getColumnName(int column)
public void setDataVector(java.util.Vector dataVector)
public void newRowsAdded(javax.swing.event.TableModelEvent e)
public void removeRows(int[] rows)
rows - the row indexes of the rows to be removed
java.lang.ArrayIndexOutOfBoundsException - if the row indexes was invalidpublic java.util.EventListener[] getListeners(java.lang.Class listenerType)
|
ElegantJ Data Tables Java API Specification v1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||