Package rma.swing.table
Class RmaTableSorter
java.lang.Object
javax.swing.table.AbstractTableModel
rma.swing.table.AbstractRmaTableModel
rma.swing.RmaTableMap
rma.swing.table.RmaTableSorter
- All Implemented Interfaces:
Serializable,EventListener,TableModelListener,TableModel,RmaTableModelInterface
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe constant for an ascending sort.static final intThe constant for a descending sort.static final intThe constant for a sort that flip-flops between ascending and descending.protected int[]Fields inherited from class rma.swing.RmaTableMap
modelFields inherited from class rma.swing.table.AbstractRmaTableModel
m_columnNames, m_displayUnitSystem, m_gmtOffset, m_unitSystemFields inherited from class javax.swing.table.AbstractTableModel
listenerListFields inherited from interface rma.swing.table.RmaTableModelInterface
UNDEF_COLUMN_PARAM_ID -
Constructor Summary
ConstructorsConstructorDescriptionRmaTableSorter(TableModel model) RmaTableSorter(TableModel model, int sortType) Constructs a RmaTableSorter around the TableModel with a defined Sorting Type. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanReturns the boolean for ascending.voidintcompare(int row1, int row2) intcompareRowsByColumn(int row1, int row2, int column) intgetMappedRow(int tableRow) Returns the mapped row for a specific table row.getValueAt(int aRow, int aColumn) Returns the value at a given row/column location.booleanisCellEditable(int aRow, int column) voidn2sort()voidvoidsetModel(TableModel model) voidsetSortingType(int sortingType) Sets the Sorting Type to the arg int.voidsetValueAt(Object aValue, int aRow, int aColumn) voidshuttlesort(int[] from, int[] to, int low, int high) voidvoidsortByColumn(int column) voidsortByColumn(int column, boolean ascending) voidswap(int i, int j) voidMethods inherited from class rma.swing.RmaTableMap
getColumnClass, getColumnCount, getColumnName, getModel, getRowCountMethods inherited from class rma.swing.table.AbstractRmaTableModel
addColumn, addColumn, addRow, clearAll, deleteRow, getColumnParameter, getDataVector, getDisplayUnitSystem, getGmtOffset, getRow, getUnitSystem, insertRow, insertRows, resetRowEnabled, setColEnabled, setColumnClass, setColumnNames, setColumnNames, setColumnParameters, setDisplayUnitsSystem, setRowEnabled, setUnitSystemMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rma.swing.table.RmaTableModelInterface
setCellEnabledMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, removeTableModelListener
-
Field Details
-
indexes
protected int[] indexes -
ASCENDING
public static final int ASCENDINGThe constant for an ascending sort.- See Also:
-
DESCENDING
public static final int DESCENDINGThe constant for a descending sort.- See Also:
-
FLIPFLOP
public static final int FLIPFLOPThe constant for a sort that flip-flops between ascending and descending.- See Also:
-
-
Constructor Details
-
RmaTableSorter
public RmaTableSorter() -
RmaTableSorter
-
RmaTableSorter
Constructs a RmaTableSorter around the TableModel with a defined Sorting Type.
-
-
Method Details
-
setSortingType
public void setSortingType(int sortingType) Sets the Sorting Type to the arg int. Use the class defined constants. -
ascending
public boolean ascending()Returns the boolean for ascending. -
setModel
- Overrides:
setModelin classRmaTableMap
-
compareRowsByColumn
public int compareRowsByColumn(int row1, int row2, int column) -
compare
public int compare(int row1, int row2) -
reallocateIndexes
public void reallocateIndexes() -
tableChanged
- Specified by:
tableChangedin interfaceTableModelListener- Overrides:
tableChangedin classRmaTableMap
-
checkModel
public void checkModel() -
sort
-
n2sort
public void n2sort() -
shuttlesort
public void shuttlesort(int[] from, int[] to, int low, int high) -
swap
public void swap(int i, int j) -
getMappedRow
public int getMappedRow(int tableRow) Returns the mapped row for a specific table row.- Parameters:
tableRow-- Returns:
-
getValueAt
Description copied from class:AbstractRmaTableModelReturns the value at a given row/column location. The default method returns null. Needs to be overrridden- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classRmaTableMap- Parameters:
aRow- the row to look for the value in.aColumn- the column to look for the value in.
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classRmaTableMap
-
isCellEditable
public boolean isCellEditable(int aRow, int column) - Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classRmaTableMap
-
sortByColumn
public void sortByColumn(int column) -
sortByColumn
public void sortByColumn(int column, boolean ascending) -
getSortingColumns
-
addMouseListenerToHeaderInTable
-