Package adams.gui.visualization.debug
Class StoragePanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.debug.StoragePanel
-
- All Implemented Interfaces:
CleanUpHandler,StorageChangeListener,ImageObserver,MenuContainer,Serializable,Accessible
public class StoragePanel extends BasePanel implements CleanUpHandler, StorageChangeListener
Displays the current items stored in the temp storage of a flow.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStoragePanel.TableModelTable model for displaying a storage container.-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseButtonm_ButtonEditthe button for editing an item.protected BaseButtonm_ButtonExportthe button for exporting an item.protected BaseButtonm_ButtonInspectthe button for inspecting an item.protected BaseFlatButtonm_ButtonRenderLimitthe button for applying the render limit.protected BaseCheckBoxm_CheckBoxPreviewthe checkbox for previewing items.protected BaseCheckBoxm_CheckBoxRenderLimitthe checkbox for applying a render limit.protected BaseDialogm_DialogInspectthe dialog for inspecting an item.protected ObjectExporterFileChooserm_FileChooserthe filechooser for exporting the object.protected StorageHandlerm_Handlerthe current storage handler.protected InspectionPanelm_PanelInspectthe panel for inspecing an item.protected JPanelm_PanelPreviewthe panel with the preview.protected SearchPanelm_PanelSearchthe search panel.protected Map<String,ObjectRenderer>m_RendererCachethe cache for the renderers.protected booleanm_RenderLimitChangedwhether the render limit changed.protected booleanm_RenderLimitSupportedwhether the rendering limit is supported.protected BaseSplitPanem_SplitPanethe split pane for table and preview.protected SortableAndSearchableTableWithButtonsm_Tablethe table to display the storage items.protected StoragePanel.TableModelm_TableModelthe table model.protected BaseTextFieldm_TextFieldRenderLimitthe textfield for the render limit.-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description StoragePanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEdit(Object obj)Returns whether the object can be edited.voidcleanUp()Cleans up data structures, frees up memory.protected voidcopyCache()Copies the cache to the clipboard.protected voidcopyName()Copies the name to the clipboard.protected voidedit()Brings up the dialog for editing an item.protected voidexport()Brings up the dialog for exporting an item.StorageHandlergetHandler()Returns the current storage handler.protected IntegergetRenderLimit()Returns the current render limit.protected ObjectgetSelectedObject()Returns the currently selected object.protected StringgetSelectedObjectID()Returns the ID of the currently selected object.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.protected voidinspect()Brings up the dialog for inspecting an item.protected voidinspect(boolean newDialog)Brings up the dialog for inspecting an item.protected voidnewPreview()Shows the preview in a new dialog.protected voidrenderObject(JPanel panel, Object obj)Renders the specified object in the provided panel.voidsetHandler(StorageHandler value)Sets the handler to display the storage items for.protected voidshowTablePopup(MouseEvent e)Shows popup for table.voidstorageChanged(StorageChangeEvent e)Gets triggered when a storage item changed (added, modified, removed).protected voidupdateButtons()Updates the enabled state of the buttons.protected voidupdateInspection()Updates the inspection (if visible).protected voidupdatePreview()Updates the preview.protected voidupdateRenderLimit()Updates the render limit.protected voidupdateRenderWidgets()Updates the state of the render widgets.-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, 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, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, validateTree
-
Methods inherited from class java.awt.Component
action, 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, getName, getParent, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_Handler
protected StorageHandler m_Handler
the current storage handler.
-
m_Table
protected SortableAndSearchableTableWithButtons m_Table
the table to display the storage items.
-
m_TableModel
protected StoragePanel.TableModel m_TableModel
the table model.
-
m_ButtonInspect
protected BaseButton m_ButtonInspect
the button for inspecting an item.
-
m_ButtonEdit
protected BaseButton m_ButtonEdit
the button for editing an item.
-
m_ButtonExport
protected BaseButton m_ButtonExport
the button for exporting an item.
-
m_CheckBoxPreview
protected BaseCheckBox m_CheckBoxPreview
the checkbox for previewing items.
-
m_DialogInspect
protected BaseDialog m_DialogInspect
the dialog for inspecting an item.
-
m_PanelInspect
protected InspectionPanel m_PanelInspect
the panel for inspecing an item.
-
m_PanelSearch
protected SearchPanel m_PanelSearch
the search panel.
-
m_PanelPreview
protected JPanel m_PanelPreview
the panel with the preview.
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane for table and preview.
-
m_FileChooser
protected ObjectExporterFileChooser m_FileChooser
the filechooser for exporting the object.
-
m_CheckBoxRenderLimit
protected BaseCheckBox m_CheckBoxRenderLimit
the checkbox for applying a render limit.
-
m_TextFieldRenderLimit
protected BaseTextField m_TextFieldRenderLimit
the textfield for the render limit.
-
m_ButtonRenderLimit
protected BaseFlatButton m_ButtonRenderLimit
the button for applying the render limit.
-
m_RenderLimitChanged
protected boolean m_RenderLimitChanged
whether the render limit changed.
-
m_RenderLimitSupported
protected boolean m_RenderLimitSupported
whether the rendering limit is supported.
-
m_RendererCache
protected Map<String,ObjectRenderer> m_RendererCache
the cache for the renderers.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classBasePanel
-
updateButtons
protected void updateButtons()
Updates the enabled state of the buttons.
-
getRenderLimit
protected Integer getRenderLimit()
Returns the current render limit.- Returns:
- the limit
-
updateRenderWidgets
protected void updateRenderWidgets()
Updates the state of the render widgets.
-
updateRenderLimit
protected void updateRenderLimit()
Updates the render limit.
-
renderObject
protected void renderObject(JPanel panel, Object obj)
Renders the specified object in the provided panel.- Parameters:
panel- the panel to use for renderingobj- the object to render
-
updatePreview
protected void updatePreview()
Updates the preview.
-
updateInspection
protected void updateInspection()
Updates the inspection (if visible).- See Also:
inspect()
-
newPreview
protected void newPreview()
Shows the preview in a new dialog.
-
getSelectedObjectID
protected String getSelectedObjectID()
Returns the ID of the currently selected object.- Returns:
- the ID, null if none selected
-
getSelectedObject
protected Object getSelectedObject()
Returns the currently selected object.- Returns:
- the object, null if none selected
-
copyName
protected void copyName()
Copies the name to the clipboard.
-
copyCache
protected void copyCache()
Copies the cache to the clipboard.
-
inspect
protected void inspect()
Brings up the dialog for inspecting an item.
-
inspect
protected void inspect(boolean newDialog)
Brings up the dialog for inspecting an item.- Parameters:
newDialog- true if to create a new dialog instead of usingm_DialogInspect
-
canEdit
protected boolean canEdit(Object obj)
Returns whether the object can be edited.- Parameters:
obj- the object to check- Returns:
- true if editable
-
edit
protected void edit()
Brings up the dialog for editing an item.
-
export
protected void export()
Brings up the dialog for exporting an item.
-
setHandler
public void setHandler(StorageHandler value)
Sets the handler to display the storage items for.- Parameters:
value- the handler to use
-
getHandler
public StorageHandler getHandler()
Returns the current storage handler.- Returns:
- the handler, null if none set
-
showTablePopup
protected void showTablePopup(MouseEvent e)
Shows popup for table.- Parameters:
e- the mouse event
-
storageChanged
public void storageChanged(StorageChangeEvent e)
Gets triggered when a storage item changed (added, modified, removed).- Specified by:
storageChangedin interfaceStorageChangeListener- Parameters:
e- the event
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler
-
-