|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--util.swing.AbstractTableModel | +--util.swing.TableMap | +--util.swing.TableSorter
A sorter for TableModels. The sorter has a model (conforming to TableModel) and itself implements TableModel. TableSorter does not store or copy the data in the TableModel, instead it maintains an array of integers which it keeps the same size as the number of rows in its model. When the model changes it notifies the sorter that something has changed eg. "rowsAdded" so that its internal array of integers can be reallocated. As requests are made of the sorter (like getValueAt(row, col) it redirects them to its model via the mapping array. That way the TableSorter appears to hold another copy of the table with the rows in a different order. The sorting algorthm used is stable which means that it does not move around rows when its comparison function returns 0 to denote that they are equivalent. Habe diese Implementation mit geringen ?nderungen in dieses Package ?bernommen.
Fields inherited from class util.swing.TableMap |
model |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
TableSorter()
Konstruktor. |
|
TableSorter(AbstractTableModel model)
Konstruktor. |
Method Summary | |
void |
addMouseListenerToHeaderInTable(JTable table,
Object[] ao)
F?gt einen Mouselistener hinzu. |
void |
checkModel()
Hilfsmethode. |
int |
compare(int row1,
int row2)
Vergleich. |
int |
compareRowsByColumn(int row1,
int row2,
int column)
Vergleicht Spalten von bestimmten Zeilen. |
Object |
getRecord(int row)
Wrapper - getRecord |
Object |
getValueAt(int aRow,
int aColumn)
Wrapper - getValueAt |
void |
reallocateIndexes()
Hilfsmethode. |
void |
setModel(AbstractTableModel model)
Setzt das Model. |
void |
setValueAt(Object aValue,
int aRow,
int aColumn)
Wrapper - setValueAt |
void |
shuttlesort(int[] from,
int[] to,
int low,
int high)
Revolution?re Sortiermethode. |
void |
sort(Object sender)
Sortiermethode. |
void |
sortByColumn(int column)
Sortiert eine Spalte. |
void |
sortByColumn(int column,
boolean ascending)
Sortiert eine Spalte. |
void |
swap(int i,
int j)
Hilfmethode. |
void |
tableChanged(TableModelEvent e)
Wrapper - tableChanged |
Methods inherited from class util.swing.TableMap |
getColumnClass,
getColumnCount,
getColumnName,
getModel,
getRowCount,
isCellEditable |
Methods inherited from class util.swing.AbstractTableModel |
getEntryDescriptor,
orderByColumn,
reOrderBy |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener,
findColumn,
fireTableCellUpdated,
fireTableChanged,
fireTableDataChanged,
fireTableRowsDeleted,
fireTableRowsInserted,
fireTableRowsUpdated,
fireTableStructureChanged,
getListeners,
removeTableModelListener |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TableSorter()
public TableSorter(AbstractTableModel model)
model
- das eingeschachtelte Model.Method Detail |
public void setModel(AbstractTableModel model)
model
- das Model.public int compareRowsByColumn(int row1, int row2, int column)
row1
- Zeile 1.row2
- Zeile 2.column
- die Spalte.public int compare(int row1, int row2)
row1
- Zeile 1.row2
- Zeile 2.public void reallocateIndexes()
public void tableChanged(TableModelEvent e)
e
- das Event.public void checkModel()
public void sort(Object sender)
sender
- ein Objekt.public void shuttlesort(int[] from, int[] to, int low, int high)
from
- ?to
- ?low
- ?high
- ?public void swap(int i, int j)
i
- ?j
- ?public Object getValueAt(int aRow, int aColumn)
aRow
- die Zeile.aColumn
- die Spalte.public Object getRecord(int row)
row
- die Zeilepublic void setValueAt(Object aValue, int aRow, int aColumn)
aValue
- der Wert.aRow
- die Zeile.aColumn
- die Spalte.public void sortByColumn(int column)
column
- die Spalte.public void sortByColumn(int column, boolean ascending)
column
- die Spalte.ascending
- auf oder absteigend.public void addMouseListenerToHeaderInTable(JTable table, Object[] ao)
table
- die Tabelle, an die der Listener angeh?ngt werden soll.
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |