Package com.illumon.iris.gui.table
Class SortedTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.illumon.iris.gui.table.IrisTableModel
com.illumon.iris.gui.table.GuiTableMap
com.illumon.iris.gui.table.SortedTableModel
- All Implemented Interfaces:
ExtendableTableInterface
,MultiModelTable
,ReversibleModel
,SortableModel
,UpdateListener
,Workspace
,Serializable
,EventListener
,TableModelListener
,TableModel
public class SortedTableModel extends GuiTableMap implements Workspace, TableModelListener, SortableModel, ReversibleModel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ExtendableTableInterface
ExtendableTableInterface.Entry, ExtendableTableInterface.PartialResult
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ReversibleModel
ReversibleModel.ReverseType
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.SortableModel
SortableModel.SortingDirective
-
Field Summary
Fields Modifier and Type Field Description static int
ASCENDING
static Comparator<Comparable<?>>
COMPARABLE_COMPARATOR
static int
DESCENDING
static Comparator<Object>
INSENSITIVE_LEXICAL_COMPARATOR
static Comparator<Object>
LEXICAL_COMPARATOR
static int
NOT_SORTED
protected static com.fishlib.io.logger.Logger
staticLog_
-
Constructor Summary
Constructors Constructor Description SortedTableModel(com.fishlib.io.logger.Logger log, IrisTableModel tableModel)
SortedTableModel(IrisTableModel tableModel)
Deprecated. -
Method Summary
Modifier and Type Method Description void
cancelSorting()
Clear sorting on all columns.void
finishAddColumns(ExtendableTableInterface.PartialResult partialResult)
Incorporate the new DBTable and columns into tables and models.protected Comparator<?>
getComparator(int column)
Icon
getHeaderRendererIcon(int column, int size)
Get the sort icon for the specified column and size.int
getMappedRowIndex(int index)
ReversibleModel.ReverseType
getReverseType()
SortableModel.SortingDirective
getSortingDirective(int column)
Get the sorting status of a single column.int
getSortingStatus(int column)
org.jdom2.Element
getWorkspaceInfo()
Serialize the class into an element to be stored in the workspacevoid
headerClicked(MouseEvent e)
Called when sorting should be changed based on a header click.boolean
isSorting()
determine whether there are any sorting directives - similar to empty()void
reverse(ReversibleModel.ReverseType type)
Set the type of reversal operation to perform.void
setClassComparator(Class<?> type, Comparator<?> comparator)
void
setHeaderInteractionDisabled(boolean headerInteractionDisabled)
void
setSortingStatus(int column, int status, boolean isAbsolute)
old interface for backward compatibilityvoid
setSortingStatus(int column, int status, boolean isAbsolute, boolean clearSorting)
Set the sorting status of a single column.void
setWorkspaceInfo(org.jdom2.Element workspaceInfo)
Restore the class to the state defined by the data persisted in workspaceInfovoid
tableChanged(TableModelEvent e)
Methods inherited from class com.illumon.iris.gui.table.GuiTableMap
beginAddColumns, getColumnClass, getColumnCount, getColumnName, getExtendedColumns, getModel, getModel, getOriginalModel, getOriginalRowIndex, getOriginalRowIndices, getOriginalRowIndices, getRowCount, getSortableColumns, getValueAt, isCellEditable, isStale, popFinishedCallback, setColumnSet, setFinishedCallback, setValueAt, supportsColumnChange
Methods inherited from class com.illumon.iris.gui.table.IrisTableModel
dispose, getColumnIndex, getColumnSet, getNonViewColumnSet, getTableModelName, processUpdate, registerAsUpdateListener
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
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
-
Field Details
-
staticLog_
protected static final com.fishlib.io.logger.Logger staticLog_ -
DESCENDING
public static final int DESCENDING- See Also:
- Constant Field Values
-
NOT_SORTED
public static final int NOT_SORTED- See Also:
- Constant Field Values
-
ASCENDING
public static final int ASCENDING- See Also:
- Constant Field Values
-
COMPARABLE_COMPARATOR
-
LEXICAL_COMPARATOR
-
INSENSITIVE_LEXICAL_COMPARATOR
-
-
Constructor Details
-
SortedTableModel
Deprecated. -
SortedTableModel
-
-
Method Details
-
setHeaderInteractionDisabled
public void setHeaderInteractionDisabled(boolean headerInteractionDisabled) -
isSorting
public boolean isSorting()Description copied from interface:SortableModel
determine whether there are any sorting directives - similar to empty()- Specified by:
isSorting
in interfaceSortableModel
-
getSortingStatus
public int getSortingStatus(int column) -
setSortingStatus
public void setSortingStatus(int column, int status, boolean isAbsolute)old interface for backward compatibility -
setSortingStatus
public void setSortingStatus(int column, int status, boolean isAbsolute, boolean clearSorting)Description copied from interface:SortableModel
Set the sorting status of a single column. Adds to existing sort definition.- Specified by:
setSortingStatus
in interfaceSortableModel
-
getSortingDirective
Description copied from interface:SortableModel
Get the sorting status of a single column.- Specified by:
getSortingDirective
in interfaceSortableModel
-
getHeaderRendererIcon
Description copied from interface:SortableModel
Get the sort icon for the specified column and size. May return null, for no icon.- Specified by:
getHeaderRendererIcon
in interfaceSortableModel
- Parameters:
column
- the columnsize
- the icon size- Returns:
- an icon to render for sorting.
-
cancelSorting
public void cancelSorting()Description copied from interface:SortableModel
Clear sorting on all columns.- Specified by:
cancelSorting
in interfaceSortableModel
-
setClassComparator
-
getComparator
-
getMappedRowIndex
public int getMappedRowIndex(int index)- Specified by:
getMappedRowIndex
in classGuiTableMap
-
headerClicked
Description copied from interface:SortableModel
Called when sorting should be changed based on a header click.- Specified by:
headerClicked
in interfaceSortableModel
- Parameters:
e
- the drivingMouseEvent
-
finishAddColumns
Description copied from interface:ExtendableTableInterface
Incorporate the new DBTable and columns into tables and models. This must not be called on the Swing event thread.- Specified by:
finishAddColumns
in interfaceExtendableTableInterface
- Overrides:
finishAddColumns
in classGuiTableMap
- Parameters:
partialResult
- intermediate results from beginAddColumns
-
getWorkspaceInfo
public org.jdom2.Element getWorkspaceInfo()Description copied from interface:Workspace
Serialize the class into an element to be stored in the workspace- Specified by:
getWorkspaceInfo
in interfaceWorkspace
- Overrides:
getWorkspaceInfo
in classGuiTableMap
- Returns:
- An
Element
containing the data to persist.
-
setWorkspaceInfo
public void setWorkspaceInfo(org.jdom2.Element workspaceInfo)Description copied from interface:Workspace
Restore the class to the state defined by the data persisted in workspaceInfo- Specified by:
setWorkspaceInfo
in interfaceWorkspace
- Overrides:
setWorkspaceInfo
in classGuiTableMap
- Parameters:
workspaceInfo
- AnElement
containing the persisted state.
-
tableChanged
- Specified by:
tableChanged
in interfaceTableModelListener
-
reverse
Description copied from interface:ReversibleModel
Set the type of reversal operation to perform.
ReversibleModel.ReverseType.None
- No reversal is performedReversibleModel.ReverseType.PreReverse
- Reverse the table before performing sortsReversibleModel.ReverseType.PostReverse
- Reverse the table after performing sorts
- Specified by:
reverse
in interfaceReversibleModel
-
getReverseType
- Specified by:
getReverseType
in interfaceReversibleModel
- Returns:
- The current table reversal mode.
-