|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.xnap.commons.gui.table.TableSorter
public class TableSorter
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.xnap.commons.gui.table.SortableModel |
|---|
SortableModel.Order |
| Field Summary | |
|---|---|
protected int |
compares
Counts number of compares. |
protected int[] |
indexes
|
protected int |
lastSortedColumn
|
protected boolean |
maintainSortOrder
|
protected int[] |
revIndexes
|
protected ArrayList<Integer> |
sortingColumns
|
protected SortableModel.Order |
sortOrder
|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
TableSorter()
|
|
TableSorter(TableModel tableModel)
|
|
| Method Summary | |
|---|---|
protected int |
compare(int row1,
int row2)
Compares two rows. |
protected int |
compareRowsByColumn(int row1,
int row2,
int column)
Compares two rows by a column. |
Class<?> |
getColumnClass(int column)
Returns the class of the data objects in column at index. |
int |
getColumnCount()
|
String |
getColumnName(int column)
|
boolean |
getMaintainSortOrder()
|
int |
getRowCount()
|
int |
getSortedColumn()
Returns the index of the column that was sorted last. |
SortableModel.Order |
getSortOrder()
|
TableModel |
getTableModel()
|
Object |
getValueAt(int row,
int column)
|
boolean |
isCellEditable(int row,
int column)
|
int |
mapToIndex(int i)
Returns the mapped row index. |
protected void |
reallocateIndexes()
|
protected void |
reallocateIndexes(TableModelEvent e)
|
void |
resort()
|
void |
setMaintainSortOrder(boolean newValue)
Sets the maintain sort order flag. |
void |
setSortOrder(SortableModel.Order newValue)
|
void |
setTableModel(TableModel tableModel)
|
void |
setValueAt(Object aValue,
int row,
int column)
|
boolean |
shuttlesort(int[] from,
int[] to,
int low,
int high)
Returns false if nothing has changed. |
protected boolean |
sort()
Returns false if nothing has changed. |
SortableModel.Order |
sortByColumn(int column,
SortableModel.Order sortOrder,
boolean revert)
Sorts the table. |
| 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 int[] indexes
protected int[] revIndexes
protected ArrayList<Integer> sortingColumns
protected SortableModel.Order sortOrder
protected int compares
protected int lastSortedColumn
protected boolean maintainSortOrder
| Constructor Detail |
|---|
public TableSorter()
public TableSorter(TableModel tableModel)
| Method Detail |
|---|
public TableModel getTableModel()
public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int column)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic Class<?> getColumnClass(int column)
SortableModelindex.
getColumnClass in interface TableModelgetColumnClass in interface SortableModelgetColumnClass in class AbstractTableModel
public boolean isCellEditable(int row,
int column)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModel
public Object getValueAt(int row,
int column)
getValueAt in interface TableModel
public void setValueAt(Object aValue,
int row,
int column)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelpublic int getSortedColumn()
SortableModel
getSortedColumn in interface SortableModelpublic SortableModel.Order getSortOrder()
getSortOrder in interface SortableModelpublic int mapToIndex(int i)
public void setMaintainSortOrder(boolean newValue)
SortableModel
setMaintainSortOrder in interface SortableModelpublic void setSortOrder(SortableModel.Order newValue)
setSortOrder in interface SortableModelpublic void setTableModel(TableModel tableModel)
public SortableModel.Order sortByColumn(int column,
SortableModel.Order sortOrder,
boolean revert)
sortByColumn in interface SortableModelcolumn - the column to sortsortOrder - the sort order to sory byrevert - automatically revert sort order
public void resort()
protected int compare(int row1,
int row2)
protected int compareRowsByColumn(int row1,
int row2,
int column)
protected void reallocateIndexes(TableModelEvent e)
protected void reallocateIndexes()
protected boolean sort()
public boolean shuttlesort(int[] from,
int[] to,
int low,
int high)
public boolean getMaintainSortOrder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||