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 Modifier and Type Class Description (package private) static class
TurnoutSignalMast.TurnoutAspect
-
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 int
lastRef
Ordinal of all TurnoutSignalMasts to create unique system name.(package private) java.util.HashMap<java.lang.String,TurnoutSignalMast.TurnoutAspect>
turnouts
-
Fields inherited from class jmri.implementation.AbstractSignalMast
allowUnLit, 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_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
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 int
getLastRef()
java.lang.String
getTurnoutName(java.lang.String appearance)
int
getTurnoutState(java.lang.String appearance)
Turnout
getUnLitTurnout()
java.lang.String
getUnLitTurnoutName()
int
getUnLitTurnoutState()
boolean
isTurnoutUsed(Turnout t)
boolean
resetPreviousStates()
void
resetPreviousStates(boolean boo)
If the signal mast driver requires the previous state to be cleared down before the next state is set.void
setAspect(java.lang.String aspect)
Set aspect to a valid name in the current signal system definition.protected static void
setLastRef(int newVal)
void
setLit(boolean newLit)
Set the lit property.void
setTurnout(java.lang.String appearance, java.lang.String turn, int state)
void
setUnLitTurnout(java.lang.String turnoutName, int turnoutState)
void
vetoableChange(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, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
turnouts
java.util.HashMap<java.lang.String,TurnoutSignalMast.TurnoutAspect> turnouts
-
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:SignalMast
Set aspect to a valid name in the current signal system definition.- Specified by:
setAspect
in interfaceSignalMast
- Overrides:
setAspect
in 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:AbstractSignalMast
Set the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLit
in interfaceSignal
- Specified by:
setLit
in interfaceSignalMast
- Overrides:
setLit
in 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:
vetoableChange
in interfaceNamedBean
- Specified by:
vetoableChange
in interfacejava.beans.VetoableChangeListener
- Overrides:
vetoableChange
in classAbstractSignalMast
- Throws:
java.beans.PropertyVetoException
-
-