|
GATE Version 3.1-2270 |
|||||||||
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
protected class 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 TableModelListener
public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public Class getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
public void sort()
sortedColumn
- the column used for sorting the data.ascending
- the sorting order.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()
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |