Class CombinedLocoSelPane

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
CombinedLocoSelListPane, CombinedLocoSelTreePane

Provide GUI controls to select a known loco and/or new decoder.

When the "open programmer" button is pushed, i.e. the user is ready to continue, the startProgrammer method is invoked. This should be overridden (e.g. in a local anonymous class) to create the programmer frame you're interested in.

To override this class to use a different decoder-selection GUI, replace members:

  • layoutDecoderSelection
  • updateForDecoderTypeID
  • updateForDecoderMfgID
  • updateForDecoderNotID
  • resetDecoder
  • isDecoderSelected
  • selectedDecoderName
See Also:
  • Field Details

  • Constructor Details

    • CombinedLocoSelPane

      Provide GUI controls to select a known loco and/or new decoder.
      Parameters:
      s - Reference to a JLabel that should be updated with status information as identification happens.
      selector - Reference to a ProgModeSelector panel that configures the programming mode.
  • Method Details

    • layoutDecoderSelection

      Create the panel used to select the decoder.
      Returns:
      a JPanel for handling the decoder-selection GUI
    • addDecoderIdentButton

      Add a decoder identification button.
      Returns:
      the button
    • setDecoderSelectionFromLoco

      Set the decoder GUI back to having no selection.
      Parameters:
      loco - the loco name
    • isDecoderSelected

      Has the user selected a decoder type, either manually or via a successful event?
      Returns:
      true if a decoder type is selected
    • selectedDecoderType

      Convert the decoder selection UI result into a name.
      Returns:
      The selected decoder type name, or null if none selected.
    • layoutRosterSelection

      Create the panel used to select an existing entry.
      Returns:
      a JPanel for handling the entry-selection GUI
    • init

      protected void init()
      Initialize the GUI.
    • createProgrammerSelection

      Creates a Programmer Selection panel.
      Returns:
      the panel
    • startIdentifyLoco

      protected void startIdentifyLoco()
      Identify loco button pressed, start the identify operation This defines what happens when the identify is done.
    • startIdentifyDecoder

      protected void startIdentifyDecoder()
      Identify loco button pressed, start the identify operation. This defines what happens when the identify is done.
    • propertyChange

      Notification that the Roster has changed, so the locomotive selection list has to be changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      ev - Ignored.
    • selectLoco

      protected void selectLoco(int dccAddress)
      Identify locomotive complete, act on it by setting the GUI. This will fire "GUI changed" events which will reset the decoder GUI.
      Parameters:
      dccAddress - the address to select
    • selectDecoder

      protected void selectDecoder(int mfgID, int modelID, int productID)
      Identify decoder complete, act on it by setting the GUI This will fire "GUI changed" events which will reset the locomotive GUI.
      Parameters:
      mfgID - the decoder's manufacturer ID value from CV8
      modelID - the decoder's model ID value from CV7
      productID - the decoder's product ID
    • updateForDecoderTypeID

      Decoder identify has matched one or more specific types.
      Parameters:
      pList - a list of decoders
    • updateForDecoderMfgID

      void updateForDecoderMfgID(String pMfg, int pMfgID, int pModelID)
      Decoder identify has not matched specific types, but did find manufacturer match.
      Parameters:
      pMfg - Manufacturer name. This is passed to save time, as it has already been determined once.
      pMfgID - Manufacturer ID number (CV8)
      pModelID - Model ID number (CV7)
    • updateForDecoderNotID

      void updateForDecoderNotID(int pMfgID, int pModelID)
      Decoder identify did not match anything, warn and show all.
      Parameters:
      pMfgID - Manufacturer ID number (CV8)
      pModelID - Model ID number (CV7)
    • openButton

      protected void openButton()
      handle pushing the open programmer button by finding names, then calling a template method.
    • openKnownLoco

      protected void openKnownLoco()
      Start with a locomotive selected, so we're opening an existing RosterEntry.
    • openNewLoco

      protected void openNewLoco()
      Start with a decoder selected, so we're going to create a new RosterEntry.
    • startProgrammer

      protected void startProgrammer(@CheckForNull DecoderFile decoderFile, @Nonnull RosterEntry r, @Nonnull String progName)
      Start the desired type of programmer.
      Parameters:
      decoderFile - defines the type of decoder installed; if null, check the RosterEntry re for that
      r - Existing roster entry defining this locomotive
      progName - name of the programmer (Layout connection) being used