|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.sciapp.table.ListTableMap
public class ListTableMap
This class defines a TableModel that wraps around a ListTableModel, which is passed in the constructor. The methods of ListTableModel that are implemented are nothing more than calls to the respective methods of the underlying ListTableModel.
Additionally, events generated from the underlying ListTableModel are intercepted and sent to this object's listeners.
| Field Summary | |
|---|---|
protected ListTableModel |
tableModel
The underlying ListTableModel |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
ListTableMap(ListTableModel tableModel)
Constructs a ListTableMap having tableModel as the underlying ListTableModel |
|
| Method Summary | |
|---|---|
void |
addReorderListener(ReorderListener l)
Adds a ReorderListener that is notified each time a change to the data model occurs so that the table updates the selected rows accordingly. |
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. |
void |
fireRowsReordered(int[] changedIndices)
Notifies listeners that the rows of the table have been reordered in some way. |
Object |
getCellValue(Object o,
int index)
Returns tableModel.getCellValue |
Class |
getColumnClass(int c)
Returns tableModel.getColumnClass |
int |
getColumnCount()
Returns tableModel.getColumnCount |
String |
getColumnName(int columnIndex)
Returns tableModel.getColumnName |
TableModel |
getInnerModel()
In a chain of ListTableMaps, this method returns the inner most tablemodel that is not an instanceof ListTableMap. |
ListTableModel |
getModel()
Returns the underlying ListTableModel model |
int |
getRowCount()
Returns tableModel.getRowCount |
List |
getRows()
Returns tableModel.getRows |
Object |
getValueAt(int row,
int column)
Returns tableModel.getValueAt |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns tableModel.isCellEditable |
void |
removeReorderListener(ReorderListener l)
Removes a listener from the list that is notified each time a reorder event is generated. |
void |
removeRow(int row)
Removes a row from the data model |
void |
removeRows(int[] deletedRows)
Removes a few rows from the data model |
void |
rowsReordered(ReorderEvent e)
Called whenever the rows of a JTable have been restructured. |
void |
setModel(ListTableModel newModel)
Sets the underlying ListTableModel to newModel. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Returns tableModel.setValueAt |
void |
tableChanged(TableModelEvent e)
Fires the event to its TableModelListeners. |
| 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 |
| Methods inherited from interface com.sciapp.table.ListTableModel |
|---|
fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged |
| Methods inherited from interface javax.swing.table.TableModel |
|---|
addTableModelListener, removeTableModelListener |
| Field Detail |
|---|
protected ListTableModel tableModel
| Constructor Detail |
|---|
public ListTableMap(ListTableModel tableModel)
| Method Detail |
|---|
public void addReorderListener(ReorderListener l)
addReorderListener in interface ReorderModell - the ReorderListenerpublic 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 ListTableModelpublic void fireRowsReordered(int[] changedIndices)
fireRowsReordered in interface ReorderModelchangedIndices - int array indicating how the rows have been reordered.ReorderEvent
public Object getCellValue(Object o,
int index)
getCellValue in interface ListTableModelo - the row dataindex - an index
public Class getColumnClass(int c)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelc - the column being queried
public int getColumnCount()
getColumnCount in interface TableModelTableModel.getRowCount()public String getColumnName(int columnIndex)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelcolumnIndex - the column being queried
columnpublic TableModel getInnerModel()
public ListTableModel getModel()
public int getRowCount()
getRowCount in interface TableModelTableModel.getColumnCount()public List getRows()
getRows in interface ListTableModel
public Object getValueAt(int row,
int column)
getValueAt in interface TableModelrow - the row whose value is to be queriedcolumn - the column whose value is to be queried
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelrowIndex - the row being queriedcolumnIndex - the column being queried
TableModel.setValueAt(java.lang.Object, int, int)public void removeReorderListener(ReorderListener l)
removeReorderListener in interface ReorderModell - the RearrangeListenerpublic void removeRow(int row)
removeRow in interface ListTableModelrow - the index of the row being removedpublic void removeRows(int[] deletedRows)
removeRows in interface ListTableModeldeletedRows - an integer array that contains indexes of the rows being deletedpublic void rowsReordered(ReorderEvent e)
rowsReordered in interface ReorderListenere - the ReorderEvent objectpublic void setModel(ListTableModel newModel)
newModel - the new ListTableModel to set
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelaValue - value to assign to cellrowIndex - row of cellcolumnIndex - column of cellTableModel.getValueAt(int, int),
TableModel.isCellEditable(int, int)public void tableChanged(TableModelEvent e)
tableChanged in interface TableModelListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||