Class FnMapPanelESU

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

    public final class FnMapPanelESU
    extends javax.swing.JPanel
    Provide a graphical representation of the ESU mapping table. Each row represents a possible mapping between input conditions (function keys, etc.) and logical, physical or sound outputs.

    Uses data from the "model" and "family" elements from the decoder definition file to configure the number of rows and set up any custom item names:

    extFnsESU
    Uses the ESU-style function map rather than the NMRA style.
       extFnsESU="V4" for generation 4 decoders.
       extFnsESU="V5" for generation 5 decoders.
     
    numOuts
    Number of physical outputs (information only, not used by the code).
     
    numOutsFromDefinition
    Number of physical outputs read from decoder definition.
     
    numFns
    Number of mapping rows to display.
    Only use this parameter if the specific decoder definition implements less rows than the default for that decoder generation (V4/V5), for example the LokPilot V4.
     
    output (in "family" or "model")
    name="blockNo,itemNo" label="theName"
     - Set name of block "blockNo", item "itemNo" to "theName".
     
    name="blockNo,itemNo" label="theName|OnChoice|OffChoice"
     - Set name of block "blockNo", item "itemNo" to "theName" and replace the default "On and "Off" choices for enumChoice items.
     
    name="blockNo,itemNo" label="|"
     - Cause item block "blockNo", item "itemNo" to be suppressed from the table.
     
    name="itemNo" label="..."
     - As above, but using an absolute "itemNo" (not recommended).
     
    name="theName" label="OnChoice|OffChoice"
     - Set name of the nth item to "theName" and replace the default "On and "Off" choices for enumChoice items, where this line is the nth "output" element of the "model" element in the decoder definition file (not recommended).
    Default item headings:
    Coded in String array itemDescESU[] of this class.
    Item headings can be overridden by the "output" elements documented above.
    Items will be suppressed if any of the following are true:
    No variables are found for that item.
    The item output name is of the form name="n" label="|".
    Item number is > numOuts.
    Variable definitions:
    Are of the form "ESU Function Row xx Item yy" and are created "on the fly" by this class. Many thousands of variables are needed to populate the function map. It is more efficient to create these in code than to use XML in the decoder file. DO NOT specify them in the decoder file.

    The "tooltip" & "label" attributes on a fnmapping variable are ignored. Expanded internationalized tooltips are generated in the code.
    See Also:
    Serialized Form
    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void addOutputElements​(java.util.List<org.jdom2.Element> input, java.util.List<org.jdom2.Element> accumulate)
      Adds a list of "output" or "outputs" elements to an existing list.
      (package private) void addRowMoveButtons()
      Adds the Row Move buttons at top and bottom.
      (package private) void configOutputs​(org.jdom2.Element model)
      Use the "model" and "family" elements from the decoder definition file to configure the number of rows and columns and set up any custom column names.
      void dispose()
      Clean up at end.
      (package private) void loadModelAttributes​(org.jdom2.Element model)
      Use the "model" element from the decoder definition file to fetch attributes relevant to building this function map.
      (package private) void loadSplitLabel​(int item, java.lang.String theLabel)
      Splits a label as per documentation at FnMapPanelESU.
      (package private) void moveRow​(int increment)
      Moves rows up or down.
      (package private) void parseLoadLabel​(int item, java.lang.String name, java.lang.String label)
      Loads labels as per documentation at FnMapPanelESU.
      (package private) int priorityValue​(AbstractValue.ValueState state)
      Assigns a priority value to a specified state.
      (package private) void saveAt​(int row, int column, javax.swing.JComponent j)
      Saves an item at the specified row and column.
      (package private) void setupDefaultNamesLabels()
      Set up the default names and labels.
      (package private) void updateAllSummaryLines()
      Updates all summary lines, including setting appropriate states.
      (package private) void updateSummaryLine​(int row, int block)
      Updates a summary line at the specified location, including setting appropriate state.
      • 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