|
|||||||||
| 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
com.sciapp.table.FilterTableModel
public class FilterTableModel
FilterTableModel offers filtering capabilities to a table. This class needs a ListTableModel that holds the data of the table. FilterTableModel processes filtering requests and updates the data sent to the table accordingly.
| Field Summary |
|---|
| Fields inherited from class com.sciapp.table.ListTableMap |
|---|
tableModel |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
FilterTableModel(ListTableModel tableModel)
Constructs a FilterTableModel having tableModel as the underlying
ListTableModel holding the tabular data. |
|
| Method Summary | |
|---|---|
void |
filter(TableFilter tf)
Called whenever filtering of data has been requested. |
void |
fireTableChanged(TableModelEvent e)
Forwards the given notification event to all TableModelListeners that registered
themselves as listeners for this table model. |
int[] |
getFilteredIndexes()
Returns an int array showing the relation between the original and the filtered data. |
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 |
removeFilter()
Called whenever filtering of data has been cancelled. |
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)
Does nothing. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
This empty implementation is provided so users don't have to implement this method if their data model is not editable. |
| Methods inherited from class com.sciapp.table.ListTableMap |
|---|
addReorderListener, addRow, addRows, clear, fireRowsReordered, getCellValue, getColumnClass, getColumnCount, getColumnName, getModel, removeReorderListener, setModel, tableChanged |
| Methods inherited from class javax.swing.table.AbstractTableModel |
|---|
addTableModelListener, findColumn, fireTableCellUpdated, 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, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged |
| Methods inherited from interface javax.swing.table.TableModel |
|---|
addTableModelListener, removeTableModelListener |
| Constructor Detail |
|---|
public FilterTableModel(ListTableModel tableModel)
tableModel as the underlying
ListTableModel holding the tabular data.
tableModel - the underlying ListTableModel| Method Detail |
|---|
public void filter(TableFilter tf)
filter in interface TableFilterListenertf - the TableFilter used to filter the datapublic void fireTableChanged(TableModelEvent e)
TableModelListeners that registered
themselves as listeners for this table model.
fireTableChanged in interface ListTableModelfireTableChanged in class AbstractTableModele - the event to be forwardedAbstractTableModel.addTableModelListener(javax.swing.event.TableModelListener),
TableModelEvent,
EventListenerListpublic int[] getFilteredIndexes()
public int getRowCount()
getRowCount in interface TableModelgetRowCount in class ListTableMapTableModel.getColumnCount()public List getRows()
getRows in interface ListTableModelgetRows in class ListTableMap
public Object getValueAt(int row,
int column)
getValueAt in interface TableModelgetValueAt in class ListTableMaprow - 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 ListTableMaprowIndex - the row being queriedcolumnIndex - the column being queried
TableModel.setValueAt(java.lang.Object, int, int)public void removeFilter()
removeFilter in interface TableFilterListenerpublic void removeRow(int row)
removeRow in interface ListTableModelremoveRow in class ListTableMaprow - the index of the row being removedpublic void removeRows(int[] deletedRows)
removeRows in interface ListTableModelremoveRows in class ListTableMapdeletedRows - an integer array that contains indexes of the rows being deletedpublic void rowsReordered(ReorderEvent e)
rowsReordered in interface ReorderListenerrowsReordered in class ListTableMape - the ReorderEvent object
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModelsetValueAt in class ListTableMapaValue - value to assign to cellrowIndex - row of cellcolumnIndex - column of cellTableModel.getValueAt(int, int),
TableModel.isCellEditable(int, int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||