|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.progeeks.util.swing.SortedTableModel
public class SortedTableModel
Wraps a standard table model and provides a sorted view.
| Field Summary | |
|---|---|
protected int[] |
indexMap
Maps incoming index values to the internal table model index values based on the current sort. |
protected javax.swing.table.TableModel |
model
The internal table model to which this model is a sorted view. |
protected int |
primarySort
The primary sort column. |
protected boolean |
reversed
Set to true if the sort ordering is reversed. |
protected int[] |
reverseMap
A reverse of the indexMap; |
protected int |
secondarySort
The secondary sort column. |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
SortedTableModel(javax.swing.table.TableModel model)
|
|
| Method Summary | |
|---|---|
java.lang.Class |
getColumnClass(int column)
|
int |
getColumnCount()
|
java.lang.String |
getColumnName(int column)
|
int |
getPrimarySortColumn()
|
int |
getRowCount()
|
int |
getSecondarySortColumn()
|
java.lang.Object |
getValueAt(int row,
int column)
|
boolean |
isCellEditable(int row,
int column)
|
boolean |
isReversed()
|
boolean |
isSortable(int column)
|
void |
pushSortColumn(int column)
|
protected void |
resetIndexMap()
Creates a new identity mapping. |
protected boolean |
resortTable()
Recalculates the sorted view and returns true if the view has changed. |
void |
setPrimarySortColumn(int column)
|
void |
setReversed(boolean flag)
|
void |
setSecondarySortColumn(int column)
|
void |
setSortColumns(int primary,
int secondary)
|
void |
setValueAt(java.lang.Object aValue,
int row,
int column)
|
int |
toRealIndex(int sorted)
Maps an index in the sorted view to an index in the real table. |
int |
toSortedIndex(int real)
Maps an index in the real table to an index in the sorted view. |
| 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[] indexMap
protected int[] reverseMap
protected javax.swing.table.TableModel model
protected int primarySort
protected int secondarySort
protected boolean reversed
| Constructor Detail |
|---|
public SortedTableModel(javax.swing.table.TableModel model)
| Method Detail |
|---|
public boolean isSortable(int column)
public void setSortColumns(int primary,
int secondary)
public void pushSortColumn(int column)
public void setPrimarySortColumn(int column)
public int getPrimarySortColumn()
public void setSecondarySortColumn(int column)
public int getSecondarySortColumn()
public void setReversed(boolean flag)
public boolean isReversed()
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int column)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelpublic java.lang.Class getColumnClass(int column)
getColumnClass in interface javax.swing.table.TableModelgetColumnClass in class javax.swing.table.AbstractTableModel
public boolean isCellEditable(int row,
int column)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row,
int column)
public void setValueAt(java.lang.Object aValue,
int row,
int column)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelpublic int toRealIndex(int sorted)
public int toSortedIndex(int real)
protected void resetIndexMap()
protected boolean resortTable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||