Class AbstractParamContainerPanel

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

    public class AbstractParamContainerPanel
    extends javax.swing.JSplitPane
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JSplitPane

        javax.swing.JSplitPane.AccessibleJSplitPane
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_ROOT_NODE_NAME
      The default name used for the root node of the tree showing the option panel names.
      protected java.lang.Object paramObject  
      • Fields inherited from class javax.swing.JSplitPane

        BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLIT
      • 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
      AbstractParamContainerPanel()
      Constructs an AbstractParamContainerPanel with a default root node's name ("Root").
      AbstractParamContainerPanel​(java.lang.String rootName)
      Constructs an AbstractParamContainerPanel with the given root node's name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addParamPanel​(java.lang.String[] parentParams, java.lang.String name, AbstractParamPanel panel, boolean sort)
      Adds the given panel with the given name positioned under the given parents (or root node if none given).
      void addParamPanel​(java.lang.String[] parentParams, AbstractParamPanel panel, boolean sort)
      Adds the given panel, with its own name, positioned under the given parents (or root node if none given).
      void expandParamPanelNode​(java.lang.String panelName)
      Expands the node of the param panel with the given name.
      void expandRoot()  
      protected java.util.Collection<AbstractParamPanel> getPanels()
      Gets the panels shown on this dialog.
      protected javax.swing.tree.DefaultMutableTreeNode getRootNode()
      This method initializes rootNode
      void initParam​(java.lang.Object obj)
      Initialises all panels with the given object.
      boolean isParamPanelOrChildSelected​(java.lang.String panelName)
      Tells whether or not the given param panel, or one of its child panels, is selected.
      boolean isParamPanelSelected​(java.lang.String panelName)
      Tells whether or not the given param panel is selected.
      void printTree()  
      void removeParamPanel​(AbstractParamPanel panel)
      Removes the given panel.
      void renamePanel​(AbstractParamPanel panel, java.lang.String newPanelName)  
      void saveParam()
      Saves the data of all panels, throwing an exception if there's any error.
      void showDialog​(boolean showRoot)  
      void showDialog​(boolean showRoot, java.lang.String panel)  
      void showParamPanel​(java.lang.String name)
      Shows the panel with the given name.
      void showParamPanel​(java.lang.String parent, java.lang.String child)  
      void showParamPanel​(AbstractParamPanel panel, java.lang.String name)
      Shows the panel with the given name.
      void validateParam()
      Validates all panels, throwing an exception if there's any validation error.
      • Methods inherited from class javax.swing.JSplitPane

        addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, 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, paint, paintBorder, 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, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, 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, 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DEFAULT_ROOT_NODE_NAME

        public static final java.lang.String DEFAULT_ROOT_NODE_NAME
        The default name used for the root node of the tree showing the option panel names.
        Since:
        2.7.0
        See Also:
        Constant Field Values
      • paramObject

        protected java.lang.Object paramObject
    • Constructor Detail

      • AbstractParamContainerPanel

        public AbstractParamContainerPanel()
        Constructs an AbstractParamContainerPanel with a default root node's name ("Root").
      • AbstractParamContainerPanel

        public AbstractParamContainerPanel​(java.lang.String rootName)
        Constructs an AbstractParamContainerPanel with the given root node's name.
        Parameters:
        rootName - the name of the root node
    • Method Detail

      • getRootNode

        protected javax.swing.tree.DefaultMutableTreeNode getRootNode()
        This method initializes rootNode
        Returns:
        javax.swing.tree.DefaultMutableTreeNode
      • addParamPanel

        public void addParamPanel​(java.lang.String[] parentParams,
                                  java.lang.String name,
                                  AbstractParamPanel panel,
                                  boolean sort)
        Adds the given panel with the given name positioned under the given parents (or root node if none given).

        If not sorted the panel is appended to existing panels.

        Parameters:
        parentParams - the name of the parent nodes of the panel, might be null.
        name - the name of the panel, must not be null.
        panel - the panel, must not be null.
        sort - true if the panel should be added in alphabetic order, false otherwise
      • addParamPanel

        public void addParamPanel​(java.lang.String[] parentParams,
                                  AbstractParamPanel panel,
                                  boolean sort)
        Adds the given panel, with its own name, positioned under the given parents (or root node if none given).

        If not sorted the panel is appended to existing panels.

        Parameters:
        parentParams - the name of the parent nodes of the panel, might be null.
        panel - the panel, must not be null.
        sort - true if the panel should be added in alphabetic order, false otherwise
      • removeParamPanel

        public void removeParamPanel​(AbstractParamPanel panel)
        Removes the given panel.
        Parameters:
        panel - the panel that will be removed
      • showParamPanel

        public void showParamPanel​(java.lang.String parent,
                                   java.lang.String child)
      • showParamPanel

        public void showParamPanel​(java.lang.String name)
        Shows the panel with the given name.

        Nothing happens if there's no panel with the given name (or the name is empty or null).

        The previously shown panel (if any) is notified that it will be hidden.

        Parameters:
        name - the name of the panel to be shown
      • showParamPanel

        public void showParamPanel​(AbstractParamPanel panel,
                                   java.lang.String name)
        Shows the panel with the given name.

        The previously shown panel (if any) is notified that it will be hidden.

        Parameters:
        panel - the panel that will be notified that is now shown, must not be null.
        name - the name of the panel that will be shown, must not be null.
        See Also:
        AbstractParamPanel.onHide(), AbstractParamPanel.onShow()
      • initParam

        public void initParam​(java.lang.Object obj)
        Initialises all panels with the given object.
        Parameters:
        obj - the object that contains the data to be shown in the panels and save them
        See Also:
        validateParam(), saveParam()
      • validateParam

        public void validateParam()
                           throws java.lang.Exception
        Validates all panels, throwing an exception if there's any validation error.

        The message of the exception can be shown in GUI components (for example, an error dialogue) callers can expect an internationalised message.

        Throws:
        java.lang.Exception - if there's any validation error.
        See Also:
        initParam(Object), saveParam()
      • saveParam

        public void saveParam()
                       throws java.lang.Exception
        Saves the data of all panels, throwing an exception if there's any error.

        The message of the exception can be shown in GUI components (for example, an error dialogue) callers can expect an internationalised message.

        Throws:
        java.lang.Exception - if there's any error while saving the data.
        See Also:
        initParam(Object), validateParam()
      • expandRoot

        public void expandRoot()
      • expandParamPanelNode

        public void expandParamPanelNode​(java.lang.String panelName)
        Expands the node of the param panel with the given name.
        Parameters:
        panelName - the name of the panel whose node should be expanded, should not be null.
        Since:
        2.8.0
      • isParamPanelSelected

        public boolean isParamPanelSelected​(java.lang.String panelName)
        Tells whether or not the given param panel is selected.
        Parameters:
        panelName - the name of the panel to check if it is selected, should not be null.
        Returns:
        true if the panel is selected, false otherwise.
        Since:
        2.8.0
        See Also:
        isParamPanelOrChildSelected(String)
      • isParamPanelOrChildSelected

        public boolean isParamPanelOrChildSelected​(java.lang.String panelName)
        Tells whether or not the given param panel, or one of its child panels, is selected.
        Parameters:
        panelName - the name of the panel to check, should not be null.
        Returns:
        true if the panel or one of its child panels is selected, false otherwise.
        Since:
        2.8.0
        See Also:
        isParamPanelSelected(String)
      • showDialog

        public void showDialog​(boolean showRoot)
      • showDialog

        public void showDialog​(boolean showRoot,
                               java.lang.String panel)
      • getPanels

        protected java.util.Collection<AbstractParamPanel> getPanels()
        Gets the panels shown on this dialog.
        Returns:
        the panels
      • printTree

        public void printTree()
      • renamePanel

        public void renamePanel​(AbstractParamPanel panel,
                                java.lang.String newPanelName)