|
|||||||||
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 |
applyFilter(FilterModelEvent e)
Called whenever filtering of data has been requested. |
protected int[] |
filterData()
Filters the data of the table. |
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 |
TableFilter |
getTableFilter()
Returns the current TableFilter of this FilterTableModel. |
Object |
getValueAt(int row,
int column)
Returns tableModel.getValueAt |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns tableModel.isCellEditable |
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 |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Returns tableModel.setValueAt |
Methods inherited from class com.sciapp.table.ListTableMap |
---|
addReorderListener, addRow, addRows, clear, fireRowsReordered, getCellValue, getColumnClass, getColumnCount, getColumnName, getInnerModel, 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 applyFilter(FilterModelEvent e)
FilterModelListeners can get the TableFilter set by calling e.getTableFilter(). If the returned value is null, the FilterModelListener should remove the filter of the table.
applyFilter
in interface FilterModelListener
e
- the FilterModelEvent objectpublic 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 TableFilter getTableFilter()
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 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)
protected int[] filterData()
ReorderEvent
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |