|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.swing.table.AbstractTableModel
|
+--org.ejtools.swing.table.TableModelDecorator
|
+--org.ejtools.swing.table.TableModelIndexed
|
+--org.ejtools.swing.table.TableModelSorter
| Field Summary | |
protected boolean |
ascending
Description of the Field |
protected int |
column
Description of the Field |
protected int |
compares
Description of the Field |
protected java.util.Vector |
sortingColumns
Description of the Field |
| Fields inherited from class org.ejtools.swing.table.TableModelIndexed |
indexes |
| Fields inherited from class org.ejtools.swing.table.TableModelDecorator |
model |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
TableModelSorter(javax.swing.table.TableModel model)
Constructor for TableModelSorter. |
|
| Method Summary | |
void |
addMouseListenerToHeaderInTable(javax.swing.JTable table)
Add a mouse listener to the Table to trigger a table sort when a column heading is clicked in the JTable. |
void |
checkModel()
Description of the Method |
int |
compare(int row1,
int row2)
Description of the Method |
int |
compareRowsByColumn(int row1,
int row2,
int column)
Description of the Method |
int |
getColumn()
Gets the column attribute of the TableModelSorter object |
java.lang.Object |
getValueAt(int aRow,
int aColumn)
Gets the valueAt attribute of the TableModelSorter object |
boolean |
isAscending()
Gets the ascending attribute of the TableModelSorter object |
void |
n2sort()
Description of the Method |
void |
reallocateIndexes()
Description of the Method |
void |
setValueAt(java.lang.Object aValue,
int aRow,
int aColumn)
Sets the valueAt attribute of the TableModelSorter object |
void |
shuttlesort(int[] from,
int[] to,
int low,
int high)
This is a home-grown implementation which we have not had time to research - it may perform poorly in some circumstances. |
void |
sort(java.lang.Object sender)
Description of the Method |
void |
sortByColumn(int column)
Description of the Method |
void |
sortByColumn(int column,
boolean ascending)
Description of the Method |
void |
tableChanged(javax.swing.event.TableModelEvent event)
Description of the Method |
| Methods inherited from class org.ejtools.swing.table.TableModelIndexed |
getRowCount, setModel, swap |
| Methods inherited from class org.ejtools.swing.table.TableModelDecorator |
getColumnClass, getColumnCount, getColumnName, getModel, isCellEditable |
| 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 |
| Field Detail |
protected boolean ascending
protected int column
protected int compares
protected java.util.Vector sortingColumns
| Constructor Detail |
public TableModelSorter(javax.swing.table.TableModel model)
model - | Method Detail |
public void addMouseListenerToHeaderInTable(javax.swing.JTable table)
table - The feature to be added to the MouseListenerToHeaderInTable
attributepublic void checkModel()
public int compare(int row1,
int row2)
row1 - Description of the Parameterrow2 - Description of the Parameter
public int compareRowsByColumn(int row1,
int row2,
int column)
row1 - Description of the Parameterrow2 - Description of the Parametercolumn - Description of the Parameter
public int getColumn()
public java.lang.Object getValueAt(int aRow,
int aColumn)
getValueAt in interface javax.swing.table.TableModelgetValueAt in class TableModelIndexedaRow - Description of the ParameteraColumn - Description of the Parameter
public boolean isAscending()
public void n2sort()
public void reallocateIndexes()
public void setValueAt(java.lang.Object aValue,
int aRow,
int aColumn)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class TableModelIndexedaValue - The new valueAt valueaRow - The new valueAt valueaColumn - The new valueAt value
public void shuttlesort(int[] from,
int[] to,
int low,
int high)
from - Description of the Parameterto - Description of the Parameterlow - Description of the Parameterhigh - Description of the Parameterpublic void sort(java.lang.Object sender)
sender - Description of the Parameterpublic void sortByColumn(int column)
column - Description of the Parameter
public void sortByColumn(int column,
boolean ascending)
column - Description of the Parameterascending - Description of the Parameterpublic void tableChanged(javax.swing.event.TableModelEvent event)
tableChanged in interface javax.swing.event.TableModelListenertableChanged in class TableModelDecoratorevent - Description of the Parameter
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||