Class PaneProgPane

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
    Direct Known Subclasses:
    PaneProgDp3Action.ThisProgPane

    public class PaneProgPane
    extends javax.swing.JPanel
    implements java.beans.PropertyChangeListener
    Provide the individual panes for the TabbedPaneProgrammer.

    Note that this is not only the panes carrying variables, but also the special purpose panes for the CV table, etc.

    This class implements PropertyChangeListener so that it can be notified when a variable changes its busy status at the end of a programming read/write operation. There are four read and write operation types, all of which have to be handled carefully:

    Write Changes
    This must write changes that occur after the operation starts, because the act of writing a variable/CV may change another. For example, writing CV 1 will mark CV 29 as changed.

    The definition of "changed" is operationally in the VariableValue.isChanged() member function.

    Write All
    Like write changes, this might have to go back and re-write a variable depending on what has previously happened. It should write every variable (at least) once.
    Read All
    This should read every variable once. UML Sequence diagram
    Read Changes
    This should read every variable that's marked as changed. Currently, we use a common definition of changed with the write operations, and that someday might have to change.
    See Also:
    VariableValue.isChanged(), Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  PaneProgPane.GridGlobals  
      • 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CvTableModel _cvModel  
      (package private) boolean _cvTable  
      (package private) CvValue _programmingCV  
      (package private) VariableValue _programmingVar  
      (package private) boolean _read  
      protected VariableTableModel _varModel  
      protected javax.swing.JPanel bottom  
      (package private) javax.swing.JToggleButton confirmAllButton  
      (package private) javax.swing.JToggleButton confirmChangesButton  
      protected PaneContainer container  
      protected java.util.TreeSet<java.lang.Integer> cvList
      This remembers the CVs on this pane for the Read/Write sheet operation.
      protected java.util.Iterator<java.lang.Integer> cvListIterator  
      (package private) java.util.ArrayList<FnMapPanel> fnMapList
      list of fnMapping objects to dispose
      (package private) java.util.ArrayList<FnMapPanelESU> fnMapListESU  
      (package private) boolean isCvTablePane  
      (package private) boolean justChanges  
      (package private) java.awt.event.ItemListener l1  
      protected java.awt.event.ItemListener l2  
      (package private) java.awt.event.ItemListener l3  
      protected java.awt.event.ItemListener l4  
      (package private) java.awt.event.ItemListener l5  
      (package private) java.awt.event.ItemListener l6  
      (package private) static java.lang.String LAST_GRIDX  
      (package private) static java.lang.String LAST_GRIDY  
      (package private) java.lang.String mName
      Store name of this programmer Tab (pane)
      (package private) java.util.ArrayList<javax.swing.JPanel> panelList
      list of JPanel objects to removeAll
      (package private) boolean print  
      protected javax.swing.JToggleButton readAllButton  
      protected javax.swing.JToggleButton readChangesButton  
      protected RosterEntry rosterEntry  
      (package private) java.util.List<java.lang.Integer> varList
      This remembers the variables on this pane for the Read/Write sheet operation.
      (package private) int varListIndex  
      protected javax.swing.JToggleButton writeAllButton  
      protected javax.swing.JToggleButton writeChangesButton  
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean confirmPaneAll()
      Invoked by "Compare Full Sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables and CVs in the Pane.
      boolean confirmPaneChanges()
      Invoked by "Compare changes on sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables and CVs in the Pane.
      int countOpsNeeded​(boolean read, boolean changes)
      Estimate the number of CVs that will be accessed when reading or writing the contents of this pane.
      void dispose()  
      (package private) void enableButtons​(boolean stat)  
      (package private) void enableConfirmButtons()
      Enable the compare all and compare changes button if possible.
      (package private) void enableReadButtons()
      Enable the read all and read changes button if possible.
      (package private) void executeRead​(VariableValue var)  
      (package private) void executeWrite​(VariableValue var)  
      java.lang.String getName()  
      (package private) javax.swing.JComponent getRep​(int i, java.lang.String format)  
      javax.swing.JComponent getRepresentation​(java.lang.String name, Element var)
      Get a GUI representation of a particular variable for display.
      boolean includeInPrint()  
      void includeInPrint​(boolean inc)  
      boolean isBusy()  
      boolean isEmpty()
      Check if varList and cvList, and thus the tab, is empty.
      (package private) void makeCvTable​(java.awt.GridBagConstraints cs, java.awt.GridBagLayout g, javax.swing.JPanel c)  
      protected void makeLabel​(Element e, javax.swing.JPanel c, java.awt.GridBagLayout g, java.awt.GridBagConstraints cs)
      Create label from Element.
      java.util.Set<java.lang.Integer> makeOpsNeededSet​(boolean read, boolean changes, java.util.Set<java.lang.Integer> set)
      Produce a set of CVs that will be accessed when reading or writing the contents of this pane.
      protected void makeSoundLabel​(Element e, javax.swing.JPanel c, java.awt.GridBagLayout g, java.awt.GridBagConstraints cs)
      Create sound label from Element.
      (package private) java.lang.String modifyToolTipText​(java.lang.String start, VariableValue variable)
      Takes default tool tip text, e.g. from the decoder element, and modifies it as needed.
      javax.swing.JPanel newColumn​(Element element, boolean showStdName, Element modelElem)
      Create a single column from the JDOM column Element.
      javax.swing.JPanel newGrid​(Element element, boolean showStdName, Element modelElem)
      Create a grid from the JDOM Element.
      protected void newGridGroup​(Element element, javax.swing.JPanel c, java.awt.GridBagLayout g, PaneProgPane.GridGlobals globs, boolean showStdName, Element modelElem)
      Create a new grid group from the JDOM group Element.
      javax.swing.JPanel newGridItem​(Element element, boolean showStdName, Element modelElem, PaneProgPane.GridGlobals globs)
      Create a grid item from the JDOM Element
      protected javax.swing.JPanel newGroup​(Element element, boolean showStdName, Element modelElem)
      Create a new group from the JDOM group Element
      javax.swing.JPanel newRow​(Element element, boolean showStdName, Element modelElem)
      Create a single row from the JDOM column Element
      void newVariable​(Element var, javax.swing.JComponent col, java.awt.GridBagLayout g, java.awt.GridBagConstraints cs, boolean showStdName)
      Add the representation of a single variable.
      (package private) boolean nextConfirm()
      If there are any more compare operations to be done on this pane, do the next one.
      (package private) boolean nextRead()
      If there are any more read operations to be done on this pane, do the next one.
      (package private) boolean nextWrite()  
      (package private) void pickFnMapPanel​(javax.swing.JPanel c, java.awt.GridBagLayout g, java.awt.GridBagConstraints cs, Element modelElem)
      Pick an appropriate function map panel depending on model attribute.
      void prepConfirmPane​(boolean onlyChanges)
      Prepare this pane for a compare operation.
      void prepReadPane​(boolean onlyChanges)
      Prepare this pane for a read operation.
      void prepWritePane​(boolean onlyChanges)
      Prepare a "write full sheet" operation.
      void printPane​(HardcopyWriter w)  
      void propertyChange​(java.beans.PropertyChangeEvent e)
      Get notification of a variable property change, specifically "busy" going to false at the end of a programming operation.
      boolean readPaneAll()
      Invoked by "Read Full Sheet" button, this sets in motion a continuing sequence of "read" operations on the variables and CVs in the Pane.
      boolean readPaneChanges()
      Invoked by "Read changes on sheet" button, this sets in motion a continuing sequence of "read" operations on the variables and CVs in the Pane.
      void replyWhileProgrammingCV()  
      void replyWhileProgrammingVar()  
      (package private) void restartProgramming()  
      protected void setBusy​(boolean busy)  
      (package private) void setCvListFromTable()  
      (package private) void setToRead​(boolean justChanges, boolean startProcess)
      Set the "ToRead" parameter in all variables and CVs on this pane.
      (package private) void setToWrite​(boolean justChanges, boolean startProcess)
      Set the "ToWrite" parameter in all variables and CVs on this pane
      protected void stopProgramming()  
      java.lang.String toString()  
      boolean writePaneAll()
      Invoked by "Write full sheet" button to write all CVs.
      boolean writePaneChanges()
      Invoked by "Write changes on sheet" button, this sets in motion a continuing sequence of "write" operations on the variables in the Pane.
      • 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

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

      • PaneProgPane

        public PaneProgPane()
        Construct a null object.

        Normally only used for tests and to pre-load classes.

      • PaneProgPane

        public PaneProgPane​(PaneContainer parent,
                            java.lang.String name,
                            Element pane,
                            CvTableModel cvModel,
                            VariableTableModel varModel,
                            Element modelElem,
                            RosterEntry pRosterEntry,
                            boolean isProgPane)
        Construct the Pane from the XML definition element.
        Parameters:
        parent - The parent pane
        name - Name to appear on tab of pane
        pane - The JDOM Element for the pane definition
        cvModel - Already existing TableModel containing the CV definitions
        varModel - Already existing TableModel containing the variable definitions
        modelElem - "model" element from the Decoder Index, used to check what decoder options are present.
        pRosterEntry - The current roster entry, used to get sound labels.
        isProgPane - True if the pane is a default programmer pane
    • Method Detail

      • getName

        public java.lang.String getName()
        Overrides:
        getName in class java.awt.Component
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.awt.Component
      • enableReadButtons

        void enableReadButtons()
        Enable the read all and read changes button if possible. This checks to make sure this is appropriate, given the attached programmer's capability.
      • enableConfirmButtons

        void enableConfirmButtons()
        Enable the compare all and compare changes button if possible. This checks to make sure this is appropriate, given the attached programmer's capability.
      • countOpsNeeded

        public int countOpsNeeded​(boolean read,
                                  boolean changes)
        Estimate the number of CVs that will be accessed when reading or writing the contents of this pane.
        Parameters:
        read - true if counting for read, false for write
        changes - true if counting for a *Changes operation; false, if counting for a *All operation
        Returns:
        the total number of CV reads/writes needed for this pane
      • makeOpsNeededSet

        public java.util.Set<java.lang.Integer> makeOpsNeededSet​(boolean read,
                                                                 boolean changes,
                                                                 java.util.Set<java.lang.Integer> set)
        Produce a set of CVs that will be accessed when reading or writing the contents of this pane.
        Parameters:
        read - true if counting for read, false for write
        changes - true if counting for a *Changes operation; false, if counting for a *All operation
        set - The set to fill. Any CVs already in here will not be duplicated, which provides a way to aggregate a set of CVs across multiple panes.
        Returns:
        the same set as the parameter, for convenient chaining of operations.
      • readPaneChanges

        public boolean readPaneChanges()
        Invoked by "Read changes on sheet" button, this sets in motion a continuing sequence of "read" operations on the variables and CVs in the Pane. Only variables in states marked as "changed" will be read.
        Returns:
        true is a read has been started, false if the pane is complete.
      • prepReadPane

        public void prepReadPane​(boolean onlyChanges)
        Prepare this pane for a read operation.

        The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD via this method

        Parameters:
        onlyChanges - true if only reading changes; false if reading all
      • readPaneAll

        public boolean readPaneAll()
        Invoked by "Read Full Sheet" button, this sets in motion a continuing sequence of "read" operations on the variables and CVs in the Pane. The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD in prepReadPaneAll, then starting the execution.
        Returns:
        true is a read has been started, false if the pane is complete
      • setToRead

        void setToRead​(boolean justChanges,
                       boolean startProcess)
        Set the "ToRead" parameter in all variables and CVs on this pane.
        Parameters:
        justChanges - true if this is read changes, false if read all
        startProcess - true if this is the start of processing, false if cleaning up at end
      • setToWrite

        void setToWrite​(boolean justChanges,
                        boolean startProcess)
        Set the "ToWrite" parameter in all variables and CVs on this pane
        Parameters:
        justChanges - true if this is read changes, false if read all
        startProcess - true if this is the start of processing, false if cleaning up at end
      • nextRead

        boolean nextRead()
        If there are any more read operations to be done on this pane, do the next one.

        Each invocation of this method reads one variable or CV; completion of that request will cause it to happen again, reading the next one, until there's nothing left to read.

        Returns:
        true is a read has been started, false if the pane is complete.
      • nextConfirm

        boolean nextConfirm()
        If there are any more compare operations to be done on this pane, do the next one.

        Each invocation of this method compares one CV; completion of that request will cause it to happen again, reading the next one, until there's nothing left to read.

        Returns:
        true is a compare has been started, false if the pane is complete.
      • writePaneChanges

        public boolean writePaneChanges()
        Invoked by "Write changes on sheet" button, this sets in motion a continuing sequence of "write" operations on the variables in the Pane. Only variables in isChanged states are written; other states don't need to be.
        Returns:
        true if a write has been started, false if the pane is complete
      • writePaneAll

        public boolean writePaneAll()
        Invoked by "Write full sheet" button to write all CVs.
        Returns:
        true if a write has been started, false if the pane is complete
      • prepWritePane

        public void prepWritePane​(boolean onlyChanges)
        Prepare a "write full sheet" operation.
        Parameters:
        onlyChanges - true if only writing changes; false if writing all
      • prepConfirmPane

        public void prepConfirmPane​(boolean onlyChanges)
        Prepare this pane for a compare operation.

        The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD via this method

        Parameters:
        onlyChanges - true if only confirming changes; false if confirming all
      • confirmPaneChanges

        public boolean confirmPaneChanges()
        Invoked by "Compare changes on sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables and CVs in the Pane. Only variables in states marked as "changed" will be checked.
        Returns:
        true is a confirm has been started, false if the pane is complete.
      • confirmPaneAll

        public boolean confirmPaneAll()
        Invoked by "Compare Full Sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables and CVs in the Pane. The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD in prepReadPaneAll, then starting the execution.
        Returns:
        true is a confirm has been started, false if the pane is complete.
      • isBusy

        public boolean isBusy()
      • setBusy

        protected void setBusy​(boolean busy)
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Get notification of a variable property change, specifically "busy" going to false at the end of a programming operation. If we're in a programming operation, we then continue it by reinvoking the nextRead/writePane operation.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Parameters:
        e - the event to respond to
      • newGroup

        protected javax.swing.JPanel newGroup​(Element element,
                                              boolean showStdName,
                                              Element modelElem)
        Create a new group from the JDOM group Element
        Parameters:
        element - element containing group contents
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
        Returns:
        a panel containing the group
      • newGridGroup

        protected void newGridGroup​(Element element,
                                    javax.swing.JPanel c,
                                    java.awt.GridBagLayout g,
                                    PaneProgPane.GridGlobals globs,
                                    boolean showStdName,
                                    Element modelElem)
        Create a new grid group from the JDOM group Element.
        Parameters:
        element - element containing group contents
        c - the panel to create the grid in
        g - the layout manager for the panel
        globs - properties to configure g
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
      • newColumn

        public javax.swing.JPanel newColumn​(Element element,
                                            boolean showStdName,
                                            Element modelElem)
        Create a single column from the JDOM column Element.
        Parameters:
        element - element containing column contents
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
        Returns:
        a panel containing the group
      • newRow

        public javax.swing.JPanel newRow​(Element element,
                                         boolean showStdName,
                                         Element modelElem)
        Create a single row from the JDOM column Element
        Parameters:
        element - element containing row contents
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
        Returns:
        a panel containing the group
      • newGrid

        public javax.swing.JPanel newGrid​(Element element,
                                          boolean showStdName,
                                          Element modelElem)
        Create a grid from the JDOM Element.
        Parameters:
        element - element containing group contents
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
        Returns:
        a panel containing the group
      • newGridItem

        public javax.swing.JPanel newGridItem​(Element element,
                                              boolean showStdName,
                                              Element modelElem,
                                              PaneProgPane.GridGlobals globs)
        Create a grid item from the JDOM Element
        Parameters:
        element - element containing grid item contents
        showStdName - show the name following the rules for the nameFmt element
        modelElem - element containing the decoder model
        globs - properties to configure the layout
        Returns:
        a panel containing the group
      • makeLabel

        protected void makeLabel​(Element e,
                                 javax.swing.JPanel c,
                                 java.awt.GridBagLayout g,
                                 java.awt.GridBagConstraints cs)
        Create label from Element.
        Parameters:
        e - element containing label contents
        c - panel to insert label into
        g - panel layout manager
        cs - constraints on layout manager
      • makeSoundLabel

        protected void makeSoundLabel​(Element e,
                                      javax.swing.JPanel c,
                                      java.awt.GridBagLayout g,
                                      java.awt.GridBagConstraints cs)
        Create sound label from Element.
        Parameters:
        e - element containing label contents
        c - panel to insert label into
        g - panel layout manager
        cs - constraints on layout manager
      • makeCvTable

        void makeCvTable​(java.awt.GridBagConstraints cs,
                         java.awt.GridBagLayout g,
                         javax.swing.JPanel c)
      • pickFnMapPanel

        void pickFnMapPanel​(javax.swing.JPanel c,
                            java.awt.GridBagLayout g,
                            java.awt.GridBagConstraints cs,
                            Element modelElem)
        Pick an appropriate function map panel depending on model attribute.
        If attribute extFnsESU="yes":
        Invoke FnMapPanelESU(VariableTableModel v, List<Integer> varsUsed, Element model)
        Otherwise:
        Invoke FnMapPanel(VariableTableModel v, List<Integer> varsUsed, Element model)
        Parameters:
        modelElem - element containing model attributes
        c - panel to add function map panel to
        g - panel layout manager
        cs - constraints on layout manager
      • newVariable

        public void newVariable​(Element var,
                                javax.swing.JComponent col,
                                java.awt.GridBagLayout g,
                                java.awt.GridBagConstraints cs,
                                boolean showStdName)
        Add the representation of a single variable. The variable is defined by a JDOM variable Element from the XML file.
        Parameters:
        var - element containing variable
        col - column to insert label into
        g - panel layout manager
        cs - constraints on layout manager
        showStdName - show the name following the rules for the nameFmt element
      • getRepresentation

        public javax.swing.JComponent getRepresentation​(java.lang.String name,
                                                        Element var)
        Get a GUI representation of a particular variable for display.
        Parameters:
        name - Name used to look up the Variable object
        var - XML Element which might contain a "format" attribute to be used in the VariableValue.getNewRep(java.lang.String) call from the Variable object; "tooltip" elements are also processed here.
        Returns:
        JComponent representing this variable
      • modifyToolTipText

        java.lang.String modifyToolTipText​(java.lang.String start,
                                           VariableValue variable)
        Takes default tool tip text, e.g. from the decoder element, and modifies it as needed.

        Intended to handle e.g. adding CV numbers to variables.

        Parameters:
        start - existing tool tip text
        variable - the CV
        Returns:
        new tool tip text
      • getRep

        javax.swing.JComponent getRep​(int i,
                                      java.lang.String format)
      • isEmpty

        public boolean isEmpty()
        Check if varList and cvList, and thus the tab, is empty.
        Returns:
        true if empty