Class Z21XNetTurnoutManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<Turnout>
-
- jmri.managers.AbstractTurnoutManager
-
- jmri.jmrix.lenz.XNetTurnoutManager
-
- jmri.jmrix.roco.z21.Z21XNetTurnoutManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,AbstractMRListener
,XNetListener
,Manager<Turnout>
,NameIncrementingManager
,ProvidingManager<Turnout>
,TurnoutManager
public class Z21XNetTurnoutManager extends XNetTurnoutManager
Implement z21 turnout manager.System names are "XTnnn", where X is the user-configurable system prefix, nnn is the turnout number without padding.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.lenz.XNetTurnoutManager
tc
-
Fields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, memo, silenceableProperties, silencedProperties
-
Fields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupport
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Constructor Summary
Constructors Constructor Description Z21XNetTurnoutManager(XNetSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowMultipleAdditions(java.lang.String systemName)
Determines if it is possible to add a range of NamedBeans in numerical order for a particular system implementation.protected Turnout
createNewTurnout(java.lang.String systemName, java.lang.String userName)
Create a new Turnout based on the system name.protected void
forwardMessageToTurnout(java.lang.String s, XNetReply l)
void
message(XNetReply l)
Listen for turnouts, creating them as needed.java.lang.String
validateSystemNameFormat(java.lang.String systemName, java.util.Locale locale)
Validate the format of name, returning it unchanged if valid.-
Methods inherited from class jmri.jmrix.lenz.XNetTurnoutManager
getClosedText, getEntryToolTip, getMemo, getThrownText, message, notifyTimeout, validSystemNameFormat
-
Methods inherited from class jmri.managers.AbstractTurnoutManager
askControlType, askNumControlBits, createSystemName, dispose, getBeanTypeHandled, getDefaultClosedSpeed, getDefaultThrownSpeed, getNamedBeanClass, getOutputInterval, getTurnout, getValidOperationTypes, getXMLOrder, isControlTypeSupported, isNumControlBitsSupported, newTurnout, outputIntervalEnds, provideTurnout, setDefaultClosedSpeed, setDefaultThrownSpeed, setOutputInterval, typeLetter
-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, deleteBean, deregister, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, updateAutoNumber, vetoableChange
-
Methods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, getBeanTypeHandled, getKnownBeanProperties, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat
-
Methods inherited from interface jmri.NameIncrementingManager
getNextValidSystemName
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.TurnoutManager
getBySystemName, getByUserName, provide
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Constructor Detail
-
Z21XNetTurnoutManager
public Z21XNetTurnoutManager(XNetSystemConnectionMemo memo)
-
-
Method Detail
-
createNewTurnout
@Nonnull protected Turnout createNewTurnout(@Nonnull java.lang.String systemName, java.lang.String userName) throws java.lang.IllegalArgumentException
Create a new Turnout based on the system name. Assumes calling method has checked that a Turnout with this system name does not already exist. Internal method to invoke the factory, after all the logic for returning an existing Turnout has been invoked.- Overrides:
createNewTurnout
in classXNetTurnoutManager
- Parameters:
systemName
- the system name to use for the new TurnoutuserName
- the user name to use for the new Turnout- Returns:
- the new Turnout or
- Throws:
java.lang.IllegalArgumentException
- if unsuccessful
-
allowMultipleAdditions
public boolean allowMultipleAdditions(@Nonnull java.lang.String systemName)
Description copied from interface:NameIncrementingManager
Determines if it is possible to add a range of NamedBeans in numerical order for a particular system implementation.Default is not providing this service. Systems should override this method if they do provide the service.
- Specified by:
allowMultipleAdditions
in interfaceNameIncrementingManager
- Overrides:
allowMultipleAdditions
in classXNetTurnoutManager
- Parameters:
systemName
- the system name to check against; appears to be ignored in all implementations- Returns:
- true if possible; false otherwise
-
message
public void message(XNetReply l)
Description copied from class:XNetTurnoutManager
Listen for turnouts, creating them as needed.- Specified by:
message
in interfaceXNetListener
- Overrides:
message
in classXNetTurnoutManager
- Parameters:
l
- The received XNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
forwardMessageToTurnout
protected void forwardMessageToTurnout(java.lang.String s, XNetReply l)
- Overrides:
forwardMessageToTurnout
in classXNetTurnoutManager
-
validateSystemNameFormat
@Nonnull public java.lang.String validateSystemNameFormat(@Nonnull java.lang.String systemName, @Nonnull java.util.Locale locale)
Validate the format of name, returning it unchanged if valid.Although further restrictions may be added by system-specific implementations, at a minimum, the implementation must consider a name that does not start with the System Name prefix for this manager to be invalid, and must consider a name that is the same as the System Name prefix to be invalid.
Overriding implementations may rely on
Manager.validSystemNameFormat(java.lang.String)
, however they must provide an actionable message in the thrown exception if that method does not returnManager.NameValidity.VALID
. When overriding implementations of this method rely on validSystemNameFormat(), implementations of that method must not throw an exception, log an error, or otherwise disrupt the user.- Specified by:
validateSystemNameFormat
in interfaceManager<Turnout>
- Overrides:
validateSystemNameFormat
in classXNetTurnoutManager
- Parameters:
systemName
- the system name to validatelocale
- the locale for a localized exception; this is needed for the JMRI web server, which supports multiple locales- Returns:
- the unchanged value of the name parameter
-
-