Package jmri.jmrit.ctc
Class NBHSignal
- java.lang.Object
-
- jmri.jmrit.ctc.NBHSignal
-
public class NBHSignal extends java.lang.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 Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_BOOLEAN_RV
static int
DEFAULT_INT_RV
static java.lang.Object
DEFAULT_OBJECT_RV
static java.lang.String
DEFAULT_STRING_RV
-
Constructor Summary
Constructors Constructor Description NBHSignal(java.lang.String signal)
Create the named bean handle for either a signal mast or signal head.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener l)
void
allowPermissiveSML()
int
getAppearance()
SignalAppearanceMap
getAppearanceMap()
java.lang.String
getAspect()
Function to insure that a non null aspect value is always returned to the caller.java.lang.Object
getBean()
java.lang.Object
getBeanHandle()
java.lang.String
getDisplayName()
java.lang.String
getHandleName()
boolean
getHeld()
java.lang.String[]
getValidStateKeys()
Get an array of non-localized appearance keys valid for the mast type.java.lang.String[]
getValidStateNames()
Get an array of localized appearance descriptions valid for the mast type.int[]
getValidStates()
Get an array of appearance indexes valid for the mast type.boolean
isDanger()
void
removePropertyChangeListener(java.beans.PropertyChangeListener l)
void
setAppearance(int newAppearance)
void
setCTCHeld(boolean held)
void
setHeld(boolean newHeld)
boolean
valid()
-
-
-
Field Detail
-
DEFAULT_OBJECT_RV
public static final java.lang.Object DEFAULT_OBJECT_RV
-
DEFAULT_BOOLEAN_RV
public static final boolean DEFAULT_BOOLEAN_RV
- See Also:
- Constant Field Values
-
DEFAULT_INT_RV
public static final int DEFAULT_INT_RV
- See Also:
- Constant Field Values
-
DEFAULT_STRING_RV
public static final java.lang.String DEFAULT_STRING_RV
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NBHSignal
public NBHSignal(java.lang.String signal)
Create the named bean handle for either a signal mast or signal head.- Parameters:
signal
- The signal name.
-
-
Method Detail
-
valid
public boolean valid()
-
getBean
public java.lang.Object getBean()
-
getBeanHandle
public java.lang.Object getBeanHandle()
-
getHandleName
public java.lang.String getHandleName()
- Returns:
- The signal's handle name.
-
getDisplayName
public java.lang.String 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
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
-
getAspect
public java.lang.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
public SignalAppearanceMap 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
public java.lang.String[] 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
public java.lang.String[] 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
-
-