public class CellTableView extends JTable implements MonitorView, AgentChannelsFilter
ImageView.
The implementation provided by this class is optimized for handling small tables
(typically 1-4 cells) displayed on top of graphical representation of equipment
by ImageView. If this class is ever used for large tables, it will have to
be subclassed and at least the update(...) method will have to be overridden.
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintModeJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyMonitorView.DescriptorAgentChannelsFilter.Event, AgentChannelsFilter.ListenerAUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeaderlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTALLABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
CellTableView(int rows,
int columns,
MonitorCell... content) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener) |
void |
configure(AgentStatusEvent event)
Called when the complete static information on the source agent (including
channels dictionary) becomes available for the first time, and when it changes.
|
void |
connect(AgentStatusEvent event)
Called when a new agent connects to the buses.
|
void |
disconnect(AgentStatusEvent event)
Called when an agent disconnects from the buses or goes into OFFLINE state.
|
List<String> |
getDisplayChannels()
Returns a list of display paths produced by this filter.
|
List<String> |
getDisplayPath(String originPath)
Returns a list of display channels for the specified original path.
|
List<String> |
getFields(boolean compact)
Returns a list of attributes to display for each channel.
|
AgentChannelsFilter |
getFilter()
Returns the filter associated with this view, or
null if there is none. |
Dimension |
getMaximumSize() |
Dimension |
getMinimumSize() |
String |
getName()
Returns the name of this view.
|
List<String> |
getOriginChannels()
Returns a list of original channel paths accepted by this filter.
|
String |
getOriginPath(String displayPath)
Returns the original path corresponding to the specified display channel.
|
JComponent |
getPanel()
Returns the graphical component maintained by this view.
|
Dimension |
getPreferredSize() |
boolean |
isEqualColumns() |
boolean |
isEqualRows() |
protected void |
resizeAndRepaint() |
void |
restore(MonitorView.Descriptor descriptor)
Restores this view to the state described by the provided descriptor, to the extent possible.
|
MonitorView.Descriptor |
save()
Returns a descriptor that contains information required to re-create this view in its current state.
|
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setEqualColumns(boolean value) |
void |
setEqualRows(boolean value)
Sets
equalRows flag. |
void |
setFilter(AgentChannelsFilter filter)
Sets the channels filter to be used by this view.
|
void |
setFormat(MonitorFormat format) |
void |
setName(String name)
Sets the name of this view.
|
void |
setResizeListener(ChangeListener listener) |
void |
statusChanged(AgentStatusEvent event)
Called on status change.
|
void |
test(int rowIndex,
int columnIndex,
String text) |
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChangedaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinstall, isEmpty, uninstalladdListener, getAgents, getAttributes, getDisplayPath, removeListenerpublic CellTableView(int rows,
int columns,
MonitorCell... content)
public void setResizeListener(ChangeListener listener)
public String getName()
MonitorViewgetName in interface AgentChannelsFiltergetName in interface MonitorViewgetName in class Componentpublic void setName(String name)
MonitorViewsetName in interface MonitorViewsetName in class Componentname - View name.public JComponent getPanel()
MonitorViewgetPanel in interface MonitorViewpublic AgentChannelsFilter getFilter()
MonitorViewnull if there is none.getFilter in interface MonitorViewpublic void setFilter(AgentChannelsFilter filter)
MonitorViewsetFilter in interface MonitorViewfilter - Filter to be associated with this view.public MonitorView.Descriptor save()
MonitorViewnull.save in interface MonitorViewnull is this view does not support saving.public void restore(MonitorView.Descriptor descriptor)
MonitorViewrestore in interface MonitorViewdescriptor - View descriptor.public void connect(AgentStatusEvent event)
AgentStatusListener
The event passed to this method does not contain any information on channels
(corresponding methods return empty collections) or a reference to a status message.
The event can only be used to retrieve AgentInfo descriptor and a reference
to the AgentStatusAggregator instance.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
connect in interface AgentStatusListenerevent - Event.public void configure(AgentStatusEvent event)
AgentStatusListener
The event passed to this method contains a list of added channels. Methods accessing lists
of changed and removed channels will return empty collections. Since the configuration event
is not necessarily triggered by a status message, getMessage() method returns null.
configure in interface AgentStatusListenerevent - Event.public void disconnect(AgentStatusEvent event)
AgentStatusListener
The event passed to this method does not contain any information on channels status -
corresponding methods return empty collections. Since the disconnection event might or might not
be triggered by a status message, getMessage() method might return null.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
disconnect in interface AgentStatusListenerevent - Event.public void statusChanged(AgentStatusEvent event)
AgentStatusListenerstatusChanged in interface AgentStatusListenerevent - event Event.public List<String> getOriginChannels()
AgentChannelsFilter
Note that if this filter is used to configure AgentStatusAggregator or any clients
that rely on it (like monitoring data views), the list returned by this method may contain
templates and selectors. See
AgentStatusAggregator.addListener(listener, agents, channels)
for details.
getOriginChannels in interface AgentChannelsFilternull if any
original path for which AgentChannelsFilter.getDisplayPath(org.lsst.ccs.gconsole.agent.AgentChannel) returns a non-empty list is accepted.public List<String> getDisplayChannels()
AgentChannelsFilterAgentChannelsFilter.getDisplayPath(org.lsst.ccs.gconsole.agent.AgentChannel)
applied to accepted original channels. Otherwise, any display channels for
which the data is available will be displayed.getDisplayChannels in interface AgentChannelsFilternull if the set is not fixed.public String getOriginPath(String displayPath)
AgentChannelsFiltergetOriginPath in interface AgentChannelsFilterdisplayPath - Display channel path.null if the specified path does not correspond to any original channel.public List<String> getDisplayPath(String originPath)
AgentChannelsFilter
Not that if the specified original channel is not accepted by this filter,
this method should return an empty list. null should never be returned.
getDisplayPath in interface AgentChannelsFilteroriginPath - Original path.public List<String> getFields(boolean compact)
AgentChannelsFiltergetFields in interface AgentChannelsFiltercompact - If true, returns a list of columns in a compact view.null if this filter does not provides any hints on what attributes should be displayed.public void setFormat(MonitorFormat format)
public void setEqualRows(boolean value)
equalRows flag.
By default, rows of this table have the same height. That means every row is sized
to accommodate the highest content. If this flag is set to false,
each row will be sized individually. In either case, any extra height assigned to
this table by the layout manager will be split equally between all rows.value - Flag value.public void setEqualColumns(boolean value)
public boolean isEqualRows()
public boolean isEqualColumns()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic Dimension getMinimumSize()
getMinimumSize in class JComponentpublic Dimension getMaximumSize()
getMaximumSize in class JComponentpublic void setBounds(int x,
int y,
int width,
int height)
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in class Containerpublic void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
addPropertyChangeListener in class Containerprotected void resizeAndRepaint()
resizeAndRepaint in class JTablepublic void test(int rowIndex,
int columnIndex,
String text)
Copyright © 2018 LSST. All rights reserved.