Package jmri.managers
Class DefaultLogixManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<Logix>
-
- jmri.managers.DefaultLogixManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,LogixManager
,Manager<Logix>
public class DefaultLogixManager extends AbstractManager<Logix> implements LogixManager
Basic Implementation of a LogixManager.Note that Logix system names must begin with system prefix and type character, usually IX, and be followed by a string, usually, but not always, a number. This is enforced when a Logix is created.
The system names of Conditionals belonging to a Logix begin with the Logix's system name, then there is a capital C and a number.
-
-
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 Modifier and Type Field Description (package private) boolean
loadDisabled
Support for loading Logixs in a disabled state to debug loops-
Fields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, lastAutoNamedBeanRef, memo, paddedNumber, 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 DefaultLogixManager(InternalSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateAllLogixs()
Activate all Logixs that are not currently active This method is called after a configuration file is loaded.Logix
createNewLogix(java.lang.String userName)
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.Logix
createNewLogix(java.lang.String systemName, java.lang.String userName)
Create a new Logix if the Logix does not exist.void
deleteLogix(Logix x)
Remove an existing Logix and delete all its conditionals.java.lang.String
getBeanTypeHandled(boolean plural)
Get the user-readable name of the type of NamedBean handled by this manager.Logix
getLogix(java.lang.String name)
Get an existing Logix.java.lang.Class<Logix>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.int
getXMLOrder()
Determine the order that types should be written when storing panel files.void
setLoadDisabled(boolean s)
Support for loading Logixs in a disabled state to debug loopschar
typeLetter()
-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, setRegisterSelf, updateAutoNumber, validSystemNameFormat, 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.LogixManager
getBySystemName, getByUserName
-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormat
-
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.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Field Detail
-
loadDisabled
boolean loadDisabled
Support for loading Logixs in a disabled state to debug loops
-
-
Constructor Detail
-
DefaultLogixManager
public DefaultLogixManager(InternalSystemConnectionMemo memo)
-
-
Method Detail
-
getXMLOrder
public int getXMLOrder()
Description copied from interface:Manager
Determine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrder
in interfaceManager<Logix>
- Returns:
- write order for this Manager; larger is later.
-
typeLetter
public char typeLetter()
- Specified by:
typeLetter
in interfaceManager<Logix>
- Returns:
- The type letter for a specific implementation
-
createNewLogix
public Logix createNewLogix(java.lang.String systemName, java.lang.String userName)
Create a new Logix if the Logix does not exist.- Specified by:
createNewLogix
in interfaceLogixManager
- Parameters:
systemName
- the system nameuserName
- the user name- Returns:
- null if a Logix with the same systemName or userName already exists, or if there is trouble creating a new Logix
-
createNewLogix
public Logix createNewLogix(java.lang.String userName)
Description copied from interface:LogixManager
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.- Specified by:
createNewLogix
in interfaceLogixManager
- Parameters:
userName
- the user name- Returns:
- a new Logix or null if unable to create
-
deleteLogix
public void deleteLogix(Logix x)
Remove an existing Logix and delete all its conditionals. Logix must have been deactivated before invoking this.- Specified by:
deleteLogix
in interfaceLogixManager
- Parameters:
x
- the Logix to delete
-
activateAllLogixs
public void activateAllLogixs()
Activate all Logixs that are not currently active This method is called after a configuration file is loaded.- Specified by:
activateAllLogixs
in interfaceLogixManager
-
getLogix
public Logix getLogix(java.lang.String name)
Get an existing Logix. First looks up assuming name is a User Name. If this fails looks up assuming name is a System Name. If both fail, returns null.- Specified by:
getLogix
in interfaceLogixManager
- Parameters:
name
- User name or system name to match- Returns:
- null if no match found
-
setLoadDisabled
public void setLoadDisabled(boolean s)
Description copied from interface:LogixManager
Support for loading Logixs in a disabled state to debug loops- Specified by:
setLoadDisabled
in interfaceLogixManager
- Parameters:
s
- true if Logix should be loadable while disabled
-
getBeanTypeHandled
@Nonnull public java.lang.String getBeanTypeHandled(boolean plural)
Description copied from interface:Manager
Get the user-readable name of the type of NamedBean handled by this manager.For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.
- Specified by:
getBeanTypeHandled
in interfaceManager<Logix>
- Parameters:
plural
- true to return plural form of the type; false to return singular form- Returns:
- a string of the bean type that the manager handles, eg Turnout, Sensor etc
-
getNamedBeanClass
public java.lang.Class<Logix> getNamedBeanClass()
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClass
in interfaceManager<Logix>
- Returns:
- the class supported by this Manager.
-
-