Class MatrixSignalMastAddPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, JmriServiceProviderInterface

A pane for configuring MatrixSignalMast objects.
Since:
4.11.2
See Also:
  • Field Details

    • MAXMATRIXBITS

      public static final int MAXMATRIXBITS
      Set the maximum number of outputs for Matrix Signal Masts. Used in combobox and for loops.
      See Also:
  • Constructor Details

  • Method Details

    • init

      final void init()
    • getPaneName

      Specified by:
      getPaneName in class SignalMastAddPane
      Returns:
      human-preferred name for type of signal mast, in local language
    • setAspectNames

      Provide a new list of aspects in the signal system. Must be done at startup before the pane is shown. May be done later, to update to a newly selected system.
      Specified by:
      setAspectNames in class SignalMastAddPane
      Parameters:
      newMap - the signal appearance map.
      sigSystem - the signal system.
    • canHandleMast

      public boolean canHandleMast(@Nonnull SignalMast mast)
      Can this pane edit a specific mast object, i.e. an object of its type?
      Specified by:
      canHandleMast in class SignalMastAddPane
      Parameters:
      mast - the SignalMast to possibly display
      Returns:
      true if this pane can handle that mast type; false if can't
    • setMast

      public void setMast(SignalMast mast)
      Load this pane with information from a mast. Do not invoke this if SignalMastAddPane.canHandleMast(SignalMast) on that mast returns false.
      Specified by:
      setMast in class SignalMastAddPane
      Parameters:
      mast - the SignalMast to display or null to reset a previous setting
    • createMast

      public boolean createMast(@Nonnull String sigsysname, @Nonnull String mastname, @Nonnull String username)
      Called to either "create and register" a new, or "update" an existing mast from the given information.
      Specified by:
      createMast in class SignalMastAddPane
      Parameters:
      sigsysname - the name of the signal system in use
      mastname - the mast type name
      username - user name value
      Returns:
      false if the operation failed, in which case the user should have already been notified
    • makeOutputPanel

      JPanel makeOutputPanel(JPanel turnoutPanel, int index)
      Index is 1-based here: 1..MAXMATRIXBITS
      Parameters:
      turnoutPanel - The panel to convert to an output panel
      index - The 1..MAXMATRIXBITS index of the one to be set visible
      Returns:
      An output panel containing the selected turnout panel