|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
gate.swing.XJTable.SortingModel
Handles translations between an indexed data source and a permutation of itself (like the translations between the rows in sorted table and the rows in the actual unsorted model).
| Field Summary | |
protected TableModel |
sourceModel
|
protected int[] |
sourceToTarget
The direct index |
protected int[] |
targetToSource
The reverse index. |
| Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
| Constructor Summary | |
XJTable.SortingModel(TableModel sourceModel)
|
|
| Method Summary | |
protected void |
buildTargetToSourceIndex()
Builds the reverse index based on the new sorting order. |
Class |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
String |
getColumnName(int columnIndex)
|
int |
getRowCount()
|
Object |
getValueAt(int row,
int column)
|
protected void |
init(TableModel sourceModel)
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
|
void |
sort()
Sorts the table using the values in the specified column and sorting order. |
int |
sourceToTarget(int index)
Converts an index from the source coordinates to the target ones. |
void |
tableChanged(TableModelEvent e)
This gets events from the source model and forwards them to the UI |
int |
targetToSource(int index)
Converts an index from the target coordinates to the source ones. |
| 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[] sourceToTarget
protected int[] targetToSource
protected TableModel sourceModel
| Constructor Detail |
public XJTable.SortingModel(TableModel sourceModel)
| Method Detail |
protected void init(TableModel sourceModel)
public void tableChanged(TableModelEvent e)
tableChanged in interface TableModelListenerpublic int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int columnIndex)
getColumnName in interface TableModelpublic Class getColumnClass(int columnIndex)
getColumnClass in interface TableModel
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModel
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface TableModel
public Object getValueAt(int row,
int column)
getValueAt in interface TableModelpublic void sort()
public int sourceToTarget(int index)
index - the index in the source coordinates.
public int targetToSource(int index)
index - the index in the target coordinates.
Used to propagate events from the view (e.g. editing) to the source
data source (table model).
protected void buildTargetToSourceIndex()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||