|
|||||||||
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 ListTableModelMethod Detail |
---|
public void filter(TableFilter tf)
filter
in interface TableFilterListener
tf
- the TableFilter used to filter the datapublic void fireTableChanged(TableModelEvent e)
TableModelListeners
that registered
themselves as listeners for this table model.
fireTableChanged
in interface ListTableModel
fireTableChanged
in class AbstractTableModel
e
- the event to be forwardedAbstractTableModel.addTableModelListener(javax.swing.event.TableModelListener)
,
TableModelEvent
,
EventListenerList
public int[] getFilteredIndexes()
public int getRowCount()
getRowCount
in interface TableModel
getRowCount
in class ListTableMap
TableModel.getColumnCount()
public List getRows()
getRows
in interface ListTableModel
getRows
in class ListTableMap
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
getValueAt
in class ListTableMap
row
- 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 TableModel
isCellEditable
in class ListTableMap
rowIndex
- the row being queriedcolumnIndex
- the column being queried
TableModel.setValueAt(java.lang.Object, int, int)
public void removeFilter()
removeFilter
in interface TableFilterListener
public void removeRow(int row)
removeRow
in interface ListTableModel
removeRow
in class ListTableMap
row
- the index of the row being removedpublic void removeRows(int[] deletedRows)
removeRows
in interface ListTableModel
removeRows
in class ListTableMap
deletedRows
- an integer array that contains indexes of the rows being deletedpublic void rowsReordered(ReorderEvent e)
rowsReordered
in interface ReorderListener
rowsReordered
in class ListTableMap
e
- the ReorderEvent objectpublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class ListTableMap
aValue
- 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 |