Class FamilyItemPanel

    • Nested Class Summary

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

        javax.swing.JPanel.AccessibleJPanel
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      FamilyItemPanel​(DisplayFrame parentFrame, java.lang.String type, java.lang.String family)
      Constructor types with multiple families and multiple icon families.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addCreateDeleteFamilyButtons​(javax.swing.JPanel panel)  
      protected void addFamilyPanels​(boolean hasMaps)  
      void closeDialogs()  
      protected void deleteFamilySet()
      Action item for deletion of an icon family.
      protected void dialogDoneAction​(java.lang.String family, java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
      IconDialog calls this method to make any changes 'permanent'.
      void dispose()  
      protected java.lang.String findFamilyOfMap​(java.lang.String exemptFamily, java.util.HashMap<java.lang.String,​NamedIcon> newMap, java.util.HashMap<java.lang.String,​java.util.HashMap<java.lang.String,​NamedIcon>> families)
      Find the family name of the map in a families HashMap.
      javax.swing.JPanel getBottomPanel()
      Needed by CPE ConvertDialog.java
      protected abstract java.lang.String getDisplayKey()
      Get the key to display the icon to be used for dragging to the panel
      protected javax.swing.JLabel getDragger​(java.awt.datatransfer.DataFlavor flavor, java.util.HashMap<java.lang.String,​NamedIcon> map, NamedIcon icon)  
      java.lang.String getFamilyName()  
      java.util.HashMap<java.lang.String,​NamedIcon> getIconMap()
      Create icon set to panel icon display class.
      javax.swing.JButton getUpdateButton()  
      protected java.lang.String getValidFamilyName​(java.lang.String family, java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
      Check that family name proposed by user for an icon family 1. name is not a duplicate key 2. icon family is already stored.
      protected void hideIcons()  
      void init()
      Initialize panel for selecting a new Control Panel item or for updating an existing item.
      void init​(java.awt.event.ActionListener doneAction, java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
      Init for update of existing palette item type.
      void init​(javax.swing.JPanel bottomPanel)
      Initialization for conversion of plain track to indicator track by CircuitBuilder.
      protected javax.swing.JPanel instructions()  
      protected boolean isUpdate()  
      protected void makeDndIcon​(java.util.HashMap<java.lang.String,​NamedIcon> iconMap)  
      protected void makeDragIconPanel()
      Position initial Preview component on _iconFamilyPanel.
      protected void makeFamiliesPanel()
      Part of the initialization and reseting of an ItemPanel.
      protected void makeFamilyButtons​(java.util.Set<java.lang.String> keySet)
      Make the _familyButtonPanel panel of buttons to select a family.
      protected javax.swing.JPanel makeIconDisplayPanel​(java.lang.String key, java.util.HashMap<java.lang.String,​NamedIcon> iconMap, boolean dropIcon)
      Utility for above method.
      protected javax.swing.JPanel makeItemButtonPanel()
      Make a button panel to populate editing an ItemPanel
      protected javax.swing.JButton makeShowIconsButton()  
      protected javax.swing.JPanel makeSpecialBottomPanel​(boolean update)
      Replacement panel for _bottomPanel when no icon families exist for _itemType.
      protected javax.swing.JButton makeUpdateButton​(java.awt.event.ActionListener doneAction)
      Add [Update] button to _bottomPanel.
      protected boolean namesStoredMap​(java.lang.String family)  
      protected void openDialog​(java.lang.String type, java.lang.String family)  
      protected void previewColorChange()  
      protected void setControlDown​(boolean b)  
      protected void setFamily()
      Recover from cancelled Add Family dialog
      protected void setFamily​(java.lang.String family)
      Action of family radio button.
      protected void setFamilyButton()  
      protected void setFamilyMaps()  
      protected void showIcons()  
      protected void updateFamiliesPanel()  
      • 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, setVisible, 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
      • Methods inherited from class java.lang.Object

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

      • FamilyItemPanel

        public FamilyItemPanel​(DisplayFrame parentFrame,
                               java.lang.String type,
                               java.lang.String family)
        Constructor types with multiple families and multiple icon families.
        Parameters:
        parentFrame - enclosing parentFrame
        type - bean type
        family - icon family
    • Method Detail

      • init

        public void init()
        Description copied from class: ItemPanel
        Initialize panel for selecting a new Control Panel item or for updating an existing item. Adds table if item is a bean. i.e. customizes for the item type. Called by enclosing TabbedPanel on change of displayed tab Pane.
        Overrides:
        init in class ItemPanel
      • init

        public void init​(java.awt.event.ActionListener doneAction,
                         java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
        Init for update of existing palette item type.
        Parameters:
        doneAction - doneAction
        iconMap - iconMap
      • init

        public void init​(javax.swing.JPanel bottomPanel)
        Initialization for conversion of plain track to indicator track by CircuitBuilder.
        Parameters:
        bottomPanel - button panel
      • getBottomPanel

        public javax.swing.JPanel getBottomPanel()
        Needed by CPE ConvertDialog.java
        Returns:
        JPanel
      • makeUpdateButton

        protected javax.swing.JButton makeUpdateButton​(java.awt.event.ActionListener doneAction)
        Add [Update] button to _bottomPanel.
        Overrides:
        makeUpdateButton in class ItemPanel
        Parameters:
        doneAction - Action for button
        Returns:
        button with doneAction Action
      • makeSpecialBottomPanel

        protected javax.swing.JPanel makeSpecialBottomPanel​(boolean update)
        Replacement panel for _bottomPanel when no icon families exist for _itemType.
        Specified by:
        makeSpecialBottomPanel in class ItemPanel
        Parameters:
        update - edit icons on a panel
        Returns:
        the panel
      • getValidFamilyName

        protected java.lang.String getValidFamilyName​(java.lang.String family,
                                                      java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
        Check that family name proposed by user for an icon family 1. name is not a duplicate key 2. icon family is already stored. (Sets "_isUnstoredMap" flag.)
        Parameters:
        family - name for icon set
        iconMap - map the family name refers to.
        Returns:
        valid family name or null if user declines to provide a valid name.
      • findFamilyOfMap

        protected java.lang.String findFamilyOfMap​(java.lang.String exemptFamily,
                                                   java.util.HashMap<java.lang.String,​NamedIcon> newMap,
                                                   java.util.HashMap<java.lang.String,​java.util.HashMap<java.lang.String,​NamedIcon>> families)
        Find the family name of the map in a families HashMap.
        Parameters:
        exemptFamily - exclude from matching
        newMap - iconMap
        families - families of itemType
        Returns:
        null if map is not in the family
      • namesStoredMap

        protected boolean namesStoredMap​(java.lang.String family)
      • makeFamilyButtons

        protected void makeFamilyButtons​(java.util.Set<java.lang.String> keySet)
        Make the _familyButtonPanel panel of buttons to select a family. Create and set actions of radioButtons to change family on pane.
        Parameters:
        keySet - of icon family names
      • makeDragIconPanel

        protected void makeDragIconPanel()
        Position initial Preview component on _iconFamilyPanel. If already present, keep and clear it.
      • makeIconDisplayPanel

        protected javax.swing.JPanel makeIconDisplayPanel​(java.lang.String key,
                                                          java.util.HashMap<java.lang.String,​NamedIcon> iconMap,
                                                          boolean dropIcon)
        Description copied from class: ItemPanel
        Utility for above method. Implementation returns a JPanel extension containing a bordered JLabel extension of icon and labels
        Specified by:
        makeIconDisplayPanel in class ItemPanel
        Parameters:
        key - name of icon
        iconMap - containing icon for possible replacement
        dropIcon - JLabel extension may be replaceable or dragable.
        Returns:
        the JPanel
      • getDragger

        protected javax.swing.JLabel getDragger​(java.awt.datatransfer.DataFlavor flavor,
                                                java.util.HashMap<java.lang.String,​NamedIcon> map,
                                                NamedIcon icon)
      • makeDndIcon

        protected void makeDndIcon​(java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
      • getDisplayKey

        protected abstract java.lang.String getDisplayKey()
        Get the key to display the icon to be used for dragging to the panel
        Returns:
        key for desired icon
      • deleteFamilySet

        protected void deleteFamilySet()
        Action item for deletion of an icon family.
      • openDialog

        protected void openDialog​(java.lang.String type,
                                  java.lang.String family)
      • dialogDoneAction

        protected void dialogDoneAction​(java.lang.String family,
                                        java.util.HashMap<java.lang.String,​NamedIcon> iconMap)
        IconDialog calls this method to make any changes 'permanent'. It is responsible for testing that the changes are valid.
        Parameters:
        family - family name, possibly changed
        iconMap - family map, possibly changed
      • isUpdate

        protected boolean isUpdate()
      • setFamily

        protected void setFamily()
        Recover from cancelled Add Family dialog
      • setFamily

        protected void setFamily​(java.lang.String family)
        Action of family radio button. MultiSensorItemPanel and IndicatorTOItemPanel must override.
        Parameters:
        family - icon family name
      • getIconMap

        public java.util.HashMap<java.lang.String,​NamedIcongetIconMap()
        Create icon set to panel icon display class.
        Returns:
        updated icon map