Class IrisTreeTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.illumon.iris.gui.table.IrisTableModel
com.illumon.iris.console.db.BaseDBTableModel
com.illumon.iris.console.events.treetable.IrisTreeTableModel
- All Implemented Interfaces:
DBTableFetcher
,LayoutHintingModel
,TableFormatProvider
,ViewportAdjuster
,AbstractDataTableModel
,AutoFilterModel
,FilteredModel
,MultiModelTable
,QuickFilterable
,SortableModel
,ToolTipGeneratingTableModel
,UpdateListener
,Workspace
,AdjustmentListener
,ComponentListener
,Serializable
,EventListener
,TableModel
public class IrisTreeTableModel
extends BaseDBTableModel
implements ViewportAdjuster, AbstractDataTableModel, AdjustmentListener, ComponentListener, MultiModelTable, FilteredModel, SortableModel, TableFormatProvider, Workspace, QuickFilterable, LayoutHintingModel, ToolTipGeneratingTableModel, AutoFilterModel, DBTableFetcher
A
TableModel
that supports the display of tables created via Table.treeTable(String, String)
or Table.rollup(ComboAggregateFactory, Collection)
.
The model supports expanding and contracting rows within the tree.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.AutoFilterModel
AutoFilterModel.AutoFilterListener, AutoFilterModel.AutoFilterRequestHandler
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.SortableModel
SortableModel.SortingDirective
Nested classes/interfaces inherited from interface com.illumon.iris.console.db.TableFormatProvider
TableFormatProvider.FormatType
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ToolTipGeneratingTableModel
ToolTipGeneratingTableModel.GeneratedToolTip
-
Field Summary
Fields inherited from class com.illumon.iris.gui.table.IrisTableModel
columnSet_, nonViewColumnSet_
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
Fields inherited from interface com.illumon.iris.gui.table.QuickFilterable
DEFAULT_MAX_QUICKFILTER_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionIrisTreeTableModel
(com.fishlib.io.logger.Logger log, String name, Table table) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
areSelectedColumnsInViewport
(BitSet columns) boolean
void
Clear sorting on all columns.void
Close the existing viewport and clean up all table resources.void
void
void
void
void
computeNewViewport
(boolean forceUpdate) Compute a new viewport.void
contractNode
(int row) Request contraction for a particular row.void
Disconnect the current adjuster from the viewport, but do not clean up table resourcesvoid
expandNode
(int row) Request expansion for a particular row.void
Notify the implementation that the set of underlying filters have changed.generateToolTip
(int col, GuiColumn column) getCellFormat
(String columnName, int row, TableFormatProvider.FormatType type) long
getColumnColor
(String columnName, int row) Get theFilterStrategyImpl
in use.getHeaderRendererIcon
(int columnIndex, int size) Get the sort icon for the specified column and size.int
getInitialFetchSize
(String column) Get the number of unique values to initially fetch for the specified column.getModel()
return the single child model, or null if none<T extends TableModel>
Treturn a model of type modelType, or null if noneint[]
getOriginalRowIndices
(int[] selectedRows) int[]
getOriginalRowIndices
(int[] selectedRows, boolean sorted) Get the current quick filter stringGet the current quick filter mode.com.fishlib.dataobjects.WAbstractDataObject
getRow
(int index) long
getRowColor
(int row) int
getRowProperties
(int row) Get all of the properties for a row in one synchronized step.org.jdom2.Element[]
Get all of the saved strategy workspaceElement
sGet the set of sortable columns.getSortingDirective
(int columnIndex) Get the sorting status of a single column.getTable()
Gets the unrolled version of this table model.getValueAt
(int rowIndex, int columnIndex) org.jdom2.Element
Serialize the class into an element to be stored in the workspaceboolean
hasCellFormat
(String columnName, TableFormatProvider.FormatType type) boolean
hasColumnColor
(String columnName) boolean
hasRowColor
(String columnName) boolean
void
Called when sorting should be changed based on a header click.boolean
isFilterable
(String column) Check if the specified column is filterable.boolean
Check if the model is currently being filtered.boolean
determine whether there are any sorting directives - similar to empty()void
markColumnColorUnchanged
(String columnName) void
removeStrategy
(String name) Remove the globally saved filter of the specified name.requestAutoFilterData
(String columnName, int maxUniqueValues, AutoFilterModel.AutoFilterListener listener) Requests auto filter data for a given column name.requestMoreAutoFilterData
(String columnName, AutoFilterModel.AutoFilterListener listener) Requests more data for the given column.void
saveStrategy
(String name) Save the current set of filters to the global set of filters by name.void
setEmbeddedDbConsole
(EmbeddedDbConsole console) Set the EmbeddedDBConsole for issuing queries, if available.void
setFreezeTable
(IrisTable freezeTable) void
Set the PQ client to issue remote queries to.void
setQuickFilter
(String filter, QuickFilterMode mode) Set the quick filter to apply.void
setScrollPane
(JScrollPane pane) Set the scroll pane to listen to events from.void
setSortingStatus
(int columnIndex, int status, boolean isAbsolute, boolean clearSorting) Set the sorting status of a single column.void
setToolTipDialog
(int col, GuiColumn column, JDialog dialog, JLabel label) void
setTreeTable
(IrisTable treeTable) void
setUnrolledModel
(UnrolledModelInfo unrolledModelInfo) Sets the table model that was used to create this model via a rollup.void
Set the IrisView underneath which this adjuster resides.void
setWorkspaceInfo
(org.jdom2.Element workspaceInfo) Restore the class to the state defined by the data persisted in workspaceInfovoid
showStatistics
(JTable table, int col, GuiColumn column) void
Suspend processing of events generated by the underlying model.updateTelemetryInfo
(TelemetryLogger.TelemetryInfo telemetryInfo) updateTelemetryInfo
(String tableName, long pqSerial, QueryProcessorConnection qpc) boolean
wasColumnColorChanged
(String columnName) Methods inherited from class com.illumon.iris.console.db.BaseDBTableModel
columnSet, columnSet, columnSet, columnSet, columnSet, doneProcessing, generateThrowableHtmlMessage, getIrisTablePanel, getName, getViewportForTable, removeStatusMessage, setIrisTablePanel, setProcessingMessage, setStatusMessage, setStatusMessageButton, setTabColor, setWarningAndTableSize, showProcessingErrorPopup, showProcessingErrorPopup
Methods inherited from class com.illumon.iris.gui.table.IrisTableModel
dispose, getColumnClass, getColumnCount, getColumnIndex, getColumnName, getColumnSet, getNonViewColumnSet, getTableModelName, isStale, processUpdate, registerAsUpdateListener, setColumnSet
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.gui.table.AbstractDataTableModel
getData
Methods inherited from interface com.illumon.iris.gui.table.AutoFilterModel
getColumnSet
Methods inherited from interface com.illumon.iris.gui.table.FilteredModel
getColumnSet
Methods inherited from interface com.illumon.iris.gui.table.QuickFilterable
getMaxQuickfilterLength
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, isCellEditable, removeTableModelListener, setValueAt
Methods inherited from interface com.illumon.iris.gui.workspace.Workspace
isGlobalSetting
-
Constructor Details
-
IrisTreeTableModel
-
-
Method Details
-
areSelectedRowsInViewport
public boolean areSelectedRowsInViewport() -
areSelectedColumnsInViewport
-
updateTelemetryInfo
public IrisTreeTableModel updateTelemetryInfo(@Nullable TelemetryLogger.TelemetryInfo telemetryInfo) -
updateTelemetryInfo
public IrisTreeTableModel updateTelemetryInfo(@Nullable String tableName, long pqSerial, @Nullable QueryProcessorConnection qpc) -
getLayoutHints
- Specified by:
getLayoutHints
in interfaceLayoutHintingModel
- Returns:
- A LayoutHintBuilder defining the layout hints for this model, or null if none were present.
-
setTreeTable
-
setFreezeTable
-
getRowCount
public int getRowCount()- Specified by:
getRowCount
in interfaceTableModel
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
-
getData
- Specified by:
getData
in interfaceAbstractDataTableModel
-
getRowProperties
Get all of the properties for a row in one synchronized step.- Parameters:
row
- The row to get.- Returns:
- A
IrisTreeTableModel.RowProperties
object defining the row.
-
getRow
public com.fishlib.dataobjects.WAbstractDataObject getRow(int index) - Specified by:
getRow
in interfaceAbstractDataTableModel
-
expandNode
public void expandNode(int row) Request expansion for a particular row. This method has no effect if the row is already expanded. The expansion itself will occur on the server side and generate a new viewport.- Parameters:
row
- The row to expand
-
contractNode
public void contractNode(int row) Request contraction for a particular row. This method has no effect if the row is already contracted.- Parameters:
row
- The row to contract.
-
computeNewViewport
public void computeNewViewport(boolean forceUpdate) Description copied from interface:ViewportAdjuster
Compute a new viewport.- Specified by:
computeNewViewport
in interfaceViewportAdjuster
- Parameters:
forceUpdate
- force an update, even if no changes were detected.
-
closeViewPort
public void closeViewPort()Description copied from interface:ViewportAdjuster
Close the existing viewport and clean up all table resources.- Specified by:
closeViewPort
in interfaceViewportAdjuster
-
disconnectViewport
public void disconnectViewport()Description copied from interface:ViewportAdjuster
Disconnect the current adjuster from the viewport, but do not clean up table resources- Specified by:
disconnectViewport
in interfaceViewportAdjuster
-
suspendViewport
public void suspendViewport()Description copied from interface:ViewportAdjuster
Suspend processing of events generated by the underlying model.- Specified by:
suspendViewport
in interfaceViewportAdjuster
-
setView
Description copied from interface:ViewportAdjuster
Set the IrisView underneath which this adjuster resides.- Specified by:
setView
in interfaceViewportAdjuster
- Parameters:
view
- the IrisView.
-
setPersistentQueryClient
Description copied from interface:ViewportAdjuster
Set the PQ client to issue remote queries to.- Specified by:
setPersistentQueryClient
in interfaceViewportAdjuster
- Parameters:
client
- the PQ Client
-
setEmbeddedDbConsole
Description copied from interface:ViewportAdjuster
Set the EmbeddedDBConsole for issuing queries, if available. Note that onlyViewportAdjuster.setPersistentQueryClient(PersistentQueryClient)
or this should be called, not both.- Specified by:
setEmbeddedDbConsole
in interfaceViewportAdjuster
- Parameters:
console
- the Console
-
setScrollPane
Description copied from interface:ViewportAdjuster
Set the scroll pane to listen to events from.- Specified by:
setScrollPane
in interfaceViewportAdjuster
- Parameters:
pane
- The scrollpane
-
componentResized
- Specified by:
componentResized
in interfaceComponentListener
-
componentMoved
- Specified by:
componentMoved
in interfaceComponentListener
-
componentShown
- Specified by:
componentShown
in interfaceComponentListener
-
componentHidden
- Specified by:
componentHidden
in interfaceComponentListener
-
adjustmentValueChanged
- Specified by:
adjustmentValueChanged
in interfaceAdjustmentListener
-
getModel
Description copied from interface:MultiModelTable
return a model of type modelType, or null if none- Specified by:
getModel
in interfaceMultiModelTable
-
getModel
Description copied from interface:MultiModelTable
return the single child model, or null if none- Specified by:
getModel
in interfaceMultiModelTable
-
getOriginalModel
- Specified by:
getOriginalModel
in interfaceMultiModelTable
-
getOriginalRowIndices
public int[] getOriginalRowIndices(int[] selectedRows) - Specified by:
getOriginalRowIndices
in interfaceMultiModelTable
-
getOriginalRowIndices
public int[] getOriginalRowIndices(int[] selectedRows, boolean sorted) - Specified by:
getOriginalRowIndices
in interfaceMultiModelTable
-
filterChanged
public void filterChanged()Description copied from interface:FilteredModel
Notify the implementation that the set of underlying filters have changed.- Specified by:
filterChanged
in interfaceFilteredModel
-
getFilterStrategy
Description copied from interface:FilteredModel
Get theFilterStrategyImpl
in use.- Specified by:
getFilterStrategy
in interfaceAutoFilterModel
- Specified by:
getFilterStrategy
in interfaceFilteredModel
- Returns:
- the FilterStrategy
-
getSavedStrategies
@NotNull public org.jdom2.Element[] getSavedStrategies()Description copied from interface:FilteredModel
Get all of the saved strategy workspaceElement
s- Specified by:
getSavedStrategies
in interfaceFilteredModel
- Returns:
- an array of saved filter strategy elements.
-
saveStrategy
Description copied from interface:FilteredModel
Save the current set of filters to the global set of filters by name.- Specified by:
saveStrategy
in interfaceFilteredModel
- Parameters:
name
- the name of the filter
-
removeStrategy
Description copied from interface:FilteredModel
Remove the globally saved filter of the specified name.- Specified by:
removeStrategy
in interfaceFilteredModel
- Parameters:
name
- the name of the filter to remove
-
isFilteringOn
public boolean isFilteringOn()Description copied from interface:FilteredModel
Check if the model is currently being filtered.- Specified by:
isFilteringOn
in interfaceFilteredModel
- Returns:
- true if filters are currently applied
-
setQuickFilter
Description copied from interface:QuickFilterable
Set the quick filter to apply.- Specified by:
setQuickFilter
in interfaceQuickFilterable
- Parameters:
filter
- the filter textmode
- theQuickFilterMode
to apply with
-
getQuickFilter
Description copied from interface:QuickFilterable
Get the current quick filter string- Specified by:
getQuickFilter
in interfaceQuickFilterable
- Returns:
- the current filter
-
getQuickFilterMode
Description copied from interface:QuickFilterable
Get the current quick filter mode.- Specified by:
getQuickFilterMode
in interfaceQuickFilterable
- Returns:
- the quickfilter mode
-
isFilterable
Description copied from interface:FilteredModel
Check if the specified column is filterable.- Specified by:
isFilterable
in interfaceAutoFilterModel
- Specified by:
isFilterable
in interfaceFilteredModel
- Parameters:
column
- the column name.- Returns:
- true if the column is filterable.
-
cancelSorting
public void cancelSorting()Description copied from interface:SortableModel
Clear sorting on all columns.- Specified by:
cancelSorting
in interfaceSortableModel
-
setSortingStatus
public void setSortingStatus(int columnIndex, 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
-
isSorting
public boolean isSorting()Description copied from interface:SortableModel
determine whether there are any sorting directives - similar to empty()- Specified by:
isSorting
in interfaceSortableModel
-
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
-
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:
columnIndex
- the columnsize
- the icon size- Returns:
- an icon to render for sorting.
-
getSortableColumns
Description copied from interface:SortableModel
Get the set of sortable columns.- Specified by:
getSortableColumns
in interfaceSortableModel
- Overrides:
getSortableColumns
in classIrisTableModel
- Returns:
- the set of sortable columns
-
getColumnColor
- Specified by:
getColumnColor
in interfaceTableFormatProvider
-
getRowColor
public long getRowColor(int row) - Specified by:
getRowColor
in interfaceTableFormatProvider
-
getCellFormat
- Specified by:
getCellFormat
in interfaceTableFormatProvider
-
hasColumnColor
- Specified by:
hasColumnColor
in interfaceTableFormatProvider
-
hasRowColor
- Specified by:
hasRowColor
in interfaceTableFormatProvider
-
hasCellFormat
- Specified by:
hasCellFormat
in interfaceTableFormatProvider
-
wasColumnColorChanged
- Specified by:
wasColumnColorChanged
in interfaceTableFormatProvider
-
markColumnColorUnchanged
- Specified by:
markColumnColorUnchanged
in interfaceTableFormatProvider
-
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 classIrisTableModel
- 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 classIrisTableModel
- Parameters:
workspaceInfo
- AnElement
containing the persisted state.
-
setUnrolledModel
Sets the table model that was used to create this model via a rollup.- Parameters:
unrolledModelInfo
- the unrolled version of this model
-
getUnrolledModel
Gets the unrolled version of this table model. Null if it was not create from another table model.- Returns:
- the unrolled table model or null
-
generateToolTip
- Specified by:
generateToolTip
in interfaceToolTipGeneratingTableModel
-
hasShowStatistics
public boolean hasShowStatistics()- Specified by:
hasShowStatistics
in interfaceToolTipGeneratingTableModel
-
showStatistics
- Specified by:
showStatistics
in interfaceToolTipGeneratingTableModel
-
setToolTipDialog
- Specified by:
setToolTipDialog
in interfaceToolTipGeneratingTableModel
-
requestAutoFilterData
public AutoFilterModel.AutoFilterRequestHandler requestAutoFilterData(String columnName, int maxUniqueValues, AutoFilterModel.AutoFilterListener listener) Description copied from interface:AutoFilterModel
Requests auto filter data for a given column name.- Specified by:
requestAutoFilterData
in interfaceAutoFilterModel
- Parameters:
columnName
- the name of the columnmaxUniqueValues
- the maximum number of unique values to returnlistener
- a listener for the data- Returns:
- a handler for the request
-
requestMoreAutoFilterData
public AutoFilterModel.AutoFilterRequestHandler requestMoreAutoFilterData(String columnName, AutoFilterModel.AutoFilterListener listener) Description copied from interface:AutoFilterModel
Requests more data for the given column.- Specified by:
requestMoreAutoFilterData
in interfaceAutoFilterModel
- Parameters:
columnName
- the name of the columnlistener
- a listener for the data- Returns:
- a handler for the request
-
getInitialFetchSize
Description copied from interface:AutoFilterModel
Get the number of unique values to initially fetch for the specified column.- Specified by:
getInitialFetchSize
in interfaceAutoFilterModel
- Parameters:
column
- The column to get the fetch size for- Returns:
- The number of unique values to fetch
-
getTable
- Specified by:
getTable
in interfaceDBTableFetcher
-
getHierarchicalTableInfo
-