Package jmri.jmrit.ctc
Class NBHSignal
java.lang.Object
jmri.jmrit.ctc.NBHSignal
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintFunction to insure that a non null aspect value is always returned to the caller.getBean()booleangetHeld()String[]Get an array of non-localized appearance keys valid for the mast type.String[]Get an array of localized appearance descriptions valid for the mast type.int[]Get an array of appearance indexes valid for the mast type.booleanisDanger()voidvoidsetAppearance(int newAppearance) voidsetCTCHeld(boolean held) voidsetHeld(boolean newHeld) booleanvalid()
-
Field Details
-
DEFAULT_OBJECT_RV
-
DEFAULT_BOOLEAN_RV
- See Also:
-
DEFAULT_INT_RV
- See Also:
-
DEFAULT_STRING_RV
- See Also:
-
-
Constructor Details
-
NBHSignal
Create the named bean handle for either a signal mast or signal head.- Parameters:
signal- The signal name.
-
-
Method Details
-
valid
-
getBean
-
getBeanHandle
-
getHandleName
- Returns:
- The signal's handle name.
-
getDisplayName
-
isDanger
-
setCTCHeld
-
getHeld
-
setHeld
-
allowPermissiveSML
-
addPropertyChangeListener
-
removePropertyChangeListener
-
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
-
setAppearance
-
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 usinggetValidStateKeys()- Returns:
- array of translated appearance names
-