Package jmri.managers
Class DefaultLogixManager
- All Implemented Interfaces:
PropertyChangeListener,VetoableChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,SilenceablePropertyChangeProvider,VetoableChangeFirer,VetoableChangeProvider,LogixManager,Manager<Logix>
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
FieldsModifier and TypeFieldDescription(package private) booleanSupport for loading Logixs in a disabled state to debug loopsFields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, lastAutoNamedBeanRef, memo, paddedNumber, silenceableProperties, silencedPropertiesFields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupportFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields 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, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidActivate all Logixs that are not currently active This method is called after a configuration file is loaded.createNewLogix(String userName) For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.createNewLogix(String systemName, String userName) Create a new Logix if the Logix does not exist.voiddeleteLogix(Logix x) Remove an existing Logix and delete all its conditionals.getBeanTypeHandled(boolean plural) Get the user-readable name of the type of NamedBean handled by this manager.Get an existing Logix.Get the class of NamedBean supported by this Manager.intDetermine the order that types should be written when storing panel files.voidsetLoadDisabled(boolean s) Support for loading Logixs in a disabled state to debug loopscharMethods 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, vetoableChangeMethods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.LogixManager
getBySystemName, getByUserNameMethods 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, validSystemNameFormatMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilencedMethods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Field Details
-
loadDisabled
boolean loadDisabledSupport for loading Logixs in a disabled state to debug loops
-
-
Constructor Details
-
DefaultLogixManager
-
-
Method Details
-
getXMLOrder
Description copied from interface:ManagerDetermine 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:
getXMLOrderin interfaceManager<Logix>- Returns:
- write order for this Manager; larger is later.
-
typeLetter
- Specified by:
typeLetterin interfaceManager<Logix>- Returns:
- The type letter for a specific implementation
-
createNewLogix
Create a new Logix if the Logix does not exist.- Specified by:
createNewLogixin 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
Description copied from interface:LogixManagerFor use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.- Specified by:
createNewLogixin interfaceLogixManager- Parameters:
userName- the user name- Returns:
- a new Logix or null if unable to create
-
deleteLogix
Remove an existing Logix and delete all its conditionals. Logix must have been deactivated before invoking this.- Specified by:
deleteLogixin interfaceLogixManager- Parameters:
x- the Logix to delete
-
activateAllLogixs
Activate all Logixs that are not currently active This method is called after a configuration file is loaded.- Specified by:
activateAllLogixsin interfaceLogixManager
-
getLogix
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:
getLogixin interfaceLogixManager- Parameters:
name- User name or system name to match- Returns:
- null if no match found
-
setLoadDisabled
Description copied from interface:LogixManagerSupport for loading Logixs in a disabled state to debug loops- Specified by:
setLoadDisabledin interfaceLogixManager- Parameters:
s- true if Logix should be loadable while disabled
-
getBeanTypeHandled
Description copied from interface:ManagerGet 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:
getBeanTypeHandledin 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
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClassin interfaceManager<Logix>- Returns:
- the class supported by this Manager.
-