Class NBHSignal

java.lang.Object
jmri.jmrit.ctc.NBHSignal

public class NBHSignal extends Object
Provide access to both signal masts and signal heads for the CTC system.

This class combines the NBHAbstractSignalCommon, NBHSignalMast and NBHSignalHead classes. OtherData _mSignalSystemType determines whether masts or heads are enabled.

  • Field Details

  • Constructor Details

    • NBHSignal

      public NBHSignal(String signal)
      Create the named bean handle for either a signal mast or signal head.
      Parameters:
      signal - The signal name.
  • Method Details

    • valid

      public boolean valid()
    • getBean

      public Object getBean()
    • getBeanHandle

    • getHandleName

      Returns:
      The signal's handle name.
    • getDisplayName

    • isDanger

      public boolean isDanger()
    • setCTCHeld

      public void setCTCHeld(boolean held)
    • getHeld

      public boolean getHeld()
    • setHeld

      public void setHeld(boolean newHeld)
    • allowPermissiveSML

      public void allowPermissiveSML()
    • addPropertyChangeListener

    • removePropertyChangeListener

    • getAspect

      public String getAspect()
      Function to insure that a non null aspect value is always returned to the caller. Background (regarding the value contained in "_mDangerAppearance"): In this objects constructor, "_mDangerAppearance" is set to getAppearanceMap().getSpecificAppearance(SignalAppearanceMap.DANGER). If "...getSpecificAppearance..." returns "null" (undocumented in JMRI documents as of 9/18/2019), "_mDangerAppearance" is set to "Stop" for safety. So "_mDangerAppearance" will NEVER be null for use as follows: SignalMast.getAspect() can return "null" (undocumented in JMRI documents as of 9/18/2019) if (for instance) the signal has no rules (i.e. no "Discover" done yet, or the signal is shown on the screen as a big red "X"). In this case, we return "_mDangerAppearance".
      Returns:
      Return a guaranteed non null aspect name.
    • getAppearanceMap

    • getAppearance

      public int getAppearance()
    • setAppearance

      public void setAppearance(int newAppearance)
    • getValidStates

      public int[] getValidStates()
      Get an array of appearance indexes valid for the mast type.
      Returns:
      array of appearance state values available on this mast type
    • getValidStateKeys

      Get an array of non-localized appearance keys valid for the mast type. For GUI application consider using (capitalized) getValidStateNames()
      Returns:
      array of translated appearance names available on this mast type
    • getValidStateNames

      Get an array of localized appearance descriptions valid for the mast type. For persistance and comparison consider using getValidStateKeys()
      Returns:
      array of translated appearance names