Package jmri.implementation
Class TurnoutSignalMast
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSignalMast
-
- jmri.implementation.TurnoutSignalMast
-
- All Implemented Interfaces:
java.beans.VetoableChangeListener,java.lang.Comparable<NamedBean>,java.util.EventListener,PropertyChangeProvider,NamedBean,Signal,SignalMast
public class TurnoutSignalMast extends AbstractSignalMast
SignalMast implemented via Turnout objects.A SignalMast that is built up using turnouts to control a specific appearance. System name specifies the creation information:
IF$tsm:basic:one-searchlight(IT1)(IT2)
The name is a colon-separated series of terms:- IF$tsm - defines signal masts of this type
- basic - name of the signaling system
- one-searchlight - name of the particular aspect map
- (IT1)(IT2) - colon-separated list of names for Turnouts
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description protected static intlastRefOrdinal of all TurnoutSignalMasts to create unique system name.-
Fields inherited from class jmri.implementation.AbstractSignalMast
aspect, disabledAspects, disablePermissiveSignalMastLogic, map, mastType, speed, systemDefn
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.Signal
PROPERTY_HELD, PROPERTY_LIT
-
Fields inherited from interface jmri.SignalMast
PROPERTY_ASPECT, PROPERTY_ASPECT_DISABLED, PROPERTY_ASPECT_ENABLED, PROPERTY_PERMISSIVE_SML_DISABLED
-
-
Constructor Summary
Constructors Constructor Description TurnoutSignalMast(java.lang.String systemName)TurnoutSignalMast(java.lang.String systemName, java.lang.String userName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<NamedBeanHandle<Turnout>>getHeadsUsed()static intgetLastRef()java.lang.StringgetTurnoutName(java.lang.String appearance)intgetTurnoutState(java.lang.String appearance)TurnoutgetUnLitTurnout()java.lang.StringgetUnLitTurnoutName()intgetUnLitTurnoutState()booleanisTurnoutUsed(Turnout t)booleanresetPreviousStates()voidresetPreviousStates(boolean boo)If the signal mast driver requires the previous state to be cleared down before the next state is set.voidsetAspect(java.lang.String aspect)Set aspect to a valid name in the current signal system definition.protected static voidsetLastRef(int newVal)voidsetLit(boolean newLit)Set the lit property.voidsetTurnout(java.lang.String appearance, java.lang.String turn, int state)voidsetUnLitTurnout(java.lang.String turnoutName, int turnoutState)voidvetoableChange(java.beans.PropertyChangeEvent evt)-
Methods inherited from class jmri.implementation.AbstractSignalMast
allowUnLit, configureAspectTable, configureSignalSystemDefinition, getAllKnownAspects, getAppearanceMap, getAspect, getBeanType, getDisabledAspects, getHeld, getLit, getMastType, getSignalSystem, getSpeed, getState, getUsageReport, getValidAspects, isAspectDisabled, isAtStop, isCleared, isPermissiveSmlDisabled, isShowingRestricting, setAllowUnLit, setAspectDisabled, setAspectEnabled, setHeld, setMastType, setPermissiveSmlDisabled, setState
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
lastRef
protected static volatile int lastRef
Ordinal of all TurnoutSignalMasts to create unique system name.
-
-
Constructor Detail
-
TurnoutSignalMast
public TurnoutSignalMast(java.lang.String systemName, java.lang.String userName)
-
TurnoutSignalMast
public TurnoutSignalMast(java.lang.String systemName)
-
-
Method Detail
-
setAspect
public void setAspect(@Nonnull java.lang.String aspect)
Description copied from interface:SignalMastSet aspect to a valid name in the current signal system definition.- Specified by:
setAspectin interfaceSignalMast- Overrides:
setAspectin classAbstractSignalMast- Parameters:
aspect- the new aspect shown
-
setUnLitTurnout
public void setUnLitTurnout(java.lang.String turnoutName, int turnoutState)
-
getUnLitTurnoutName
public java.lang.String getUnLitTurnoutName()
-
getUnLitTurnout
public Turnout getUnLitTurnout()
-
getUnLitTurnoutState
public int getUnLitTurnoutState()
-
setLit
public void setLit(boolean newLit)
Description copied from class:AbstractSignalMastSet the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLitin interfaceSignal- Specified by:
setLitin interfaceSignalMast- Overrides:
setLitin classAbstractSignalMast- Parameters:
newLit- the new value of lit
-
getTurnoutName
public java.lang.String getTurnoutName(java.lang.String appearance)
-
getTurnoutState
public int getTurnoutState(java.lang.String appearance)
-
setTurnout
public void setTurnout(java.lang.String appearance, java.lang.String turn, int state)
-
resetPreviousStates
public void resetPreviousStates(boolean boo)
If the signal mast driver requires the previous state to be cleared down before the next state is set.- Parameters:
boo- true if prior states should be cleared; false otherwise
-
resetPreviousStates
public boolean resetPreviousStates()
-
isTurnoutUsed
public boolean isTurnoutUsed(Turnout t)
-
getHeadsUsed
public java.util.List<NamedBeanHandle<Turnout>> getHeadsUsed()
-
setLastRef
protected static void setLastRef(int newVal)
- Parameters:
newVal- for ordinal of all TurnoutSignalMasts in use
-
getLastRef
public static int getLastRef()
- Returns:
- highest ordinal of all TurnoutSignalMasts in use
-
vetoableChange
public void vetoableChange(java.beans.PropertyChangeEvent evt) throws java.beans.PropertyVetoException
Description copied from class:AbstractNamedBean- Specified by:
vetoableChangein interfaceNamedBean- Specified by:
vetoableChangein interfacejava.beans.VetoableChangeListener- Overrides:
vetoableChangein classAbstractSignalMast- Throws:
java.beans.PropertyVetoException
-
-