Class DefaultDigitalBooleanActionManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractManager<E>
-
- jmri.jmrit.logixng.implementation.AbstractBaseManager<MaleDigitalBooleanActionSocket>
-
- jmri.jmrit.logixng.implementation.DefaultDigitalBooleanActionManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.beans.VetoableChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,BaseManager<MaleDigitalBooleanActionSocket>
,DigitalBooleanActionManager
,Manager<MaleDigitalBooleanActionSocket>
public class DefaultDigitalBooleanActionManager extends AbstractBaseManager<MaleDigitalBooleanActionSocket> implements DigitalBooleanActionManager
Class providing the basic logic of the DigitalBooleanActionManager interface.
-
-
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) static DefaultDigitalBooleanActionManager
_instance
-
Fields inherited from class jmri.jmrit.logixng.implementation.AbstractBaseManager
_maleSocketFactories
-
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 DefaultDigitalBooleanActionManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MaleDigitalBooleanActionSocket
castBean(MaleSocket maleSocket)
Cast the maleSocket to E This method is needed since SpotBugs @SuppressWarnings("unchecked") does not work for the cast: (E)socket.FemaleDigitalBooleanActionSocket
createFemaleSocket(Base parent, FemaleSocketListener listener, java.lang.String socketName)
protected MaleDigitalBooleanActionSocket
createMaleActionSocket(DigitalBooleanActionBean action)
void
deleteDigitalBooleanAction(MaleDigitalBooleanActionSocket x)
Delete DigitalBooleanAction by removing it from the manager.java.util.Map<Category,java.util.List<java.lang.Class<? extends Base>>>
getActionClasses()
Get a set of classes that implements the DigitalBooleanActionBean interface.java.lang.String
getBeanTypeHandled(boolean plural)
Get the user-readable name of the type of NamedBean handled by this manager.MaleSocket
getLastRegisteredMaleSocket()
Get the last item registered in the mananger.java.lang.Class<? extends MaleSocket>
getMaleSocketClass()
Get the default male socket classjava.lang.Class<MaleDigitalBooleanActionSocket>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.int
getXMLOrder()
Determine the order that types should be written when storing panel files.static DefaultDigitalBooleanActionManager
instance()
MaleDigitalBooleanActionSocket
registerAction(DigitalBooleanActionBean action)
Remember a NamedBean Object created outside the manager.MaleDigitalBooleanActionSocket
registerBean(MaleDigitalBooleanActionSocket maleSocket)
Remember a NamedBean Object created outside the manager.char
typeLetter()
-
Methods inherited from class jmri.jmrit.logixng.implementation.AbstractBaseManager
deleteBean, deleteBean, deregister, fireVetoableChange, getOuterBean, register, registerMaleSocketFactory, validSystemNameFormat
-
Methods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getBySystemName, getByUserName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, 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.jmrit.logixng.BaseManager
deleteBean, registerMaleSocketFactory
-
Methods inherited from interface jmri.jmrit.logixng.DigitalBooleanActionManager
getAutoSystemName, getSubSystemNamePrefix
-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getBySystemName, getByUserName, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, 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
-
_instance
static volatile DefaultDigitalBooleanActionManager _instance
-
-
Constructor Detail
-
DefaultDigitalBooleanActionManager
public DefaultDigitalBooleanActionManager()
-
-
Method Detail
-
getMaleSocketClass
public java.lang.Class<? extends MaleSocket> getMaleSocketClass()
Get the default male socket class- Specified by:
getMaleSocketClass
in interfaceBaseManager<MaleDigitalBooleanActionSocket>
- Returns:
- the class
-
createMaleActionSocket
protected MaleDigitalBooleanActionSocket createMaleActionSocket(DigitalBooleanActionBean action)
-
getLastRegisteredMaleSocket
public MaleSocket getLastRegisteredMaleSocket()
Get the last item registered in the mananger.- Specified by:
getLastRegisteredMaleSocket
in interfaceBaseManager<MaleDigitalBooleanActionSocket>
- Returns:
- the last item
-
registerBean
public MaleDigitalBooleanActionSocket registerBean(MaleDigitalBooleanActionSocket maleSocket)
Remember a NamedBean Object created outside the manager.The non-system-specific SignalHeadManagers use this method extensively.
- Specified by:
registerBean
in interfaceBaseManager<MaleDigitalBooleanActionSocket>
- Overrides:
registerBean
in classAbstractBaseManager<MaleDigitalBooleanActionSocket>
- Parameters:
maleSocket
- the bean- Returns:
- the registered bean with attached male sockets
-
registerAction
public MaleDigitalBooleanActionSocket registerAction(@Nonnull DigitalBooleanActionBean action) throws java.lang.IllegalArgumentException
Remember a NamedBean Object created outside the manager. This method creates a MaleDigitalBooleanActionSocket for the action.- Specified by:
registerAction
in interfaceDigitalBooleanActionManager
- Parameters:
action
- the bean- Returns:
- the male socket for this action
- Throws:
java.lang.IllegalArgumentException
- if the action has an invalid system name
-
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<MaleDigitalBooleanActionSocket>
- Returns:
- write order for this Manager; larger is later.
-
typeLetter
public char typeLetter()
- Specified by:
typeLetter
in interfaceManager<MaleDigitalBooleanActionSocket>
- Returns:
- The type letter for a specific implementation
-
createFemaleSocket
public FemaleDigitalBooleanActionSocket createFemaleSocket(Base parent, FemaleSocketListener listener, java.lang.String socketName)
- Specified by:
createFemaleSocket
in interfaceDigitalBooleanActionManager
-
getActionClasses
public java.util.Map<Category,java.util.List<java.lang.Class<? extends Base>>> getActionClasses()
Description copied from interface:DigitalBooleanActionManager
Get a set of classes that implements the DigitalBooleanActionBean interface.- Specified by:
getActionClasses
in interfaceDigitalBooleanActionManager
- Returns:
- a set of entries with category and class
-
getBeanTypeHandled
public java.lang.String getBeanTypeHandled(boolean plural)
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<MaleDigitalBooleanActionSocket>
- 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
-
deleteDigitalBooleanAction
public void deleteDigitalBooleanAction(MaleDigitalBooleanActionSocket x)
Delete DigitalBooleanAction by removing it from the manager. The DigitalBooleanActionBean must first be deactivated so it stops processing.- Specified by:
deleteDigitalBooleanAction
in interfaceDigitalBooleanActionManager
- Parameters:
x
- the DigitalBooleanAction to delete
-
instance
@InvokeOnGuiThread public static DefaultDigitalBooleanActionManager instance()
-
getNamedBeanClass
public java.lang.Class<MaleDigitalBooleanActionSocket> getNamedBeanClass()
Description copied from interface:Manager
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<MaleDigitalBooleanActionSocket>
- Returns:
- the class supported by this Manager.
-
castBean
protected MaleDigitalBooleanActionSocket castBean(MaleSocket maleSocket)
Description copied from class:AbstractBaseManager
Cast the maleSocket to E This method is needed since SpotBugs @SuppressWarnings("unchecked") does not work for the cast: (E)socket.- Specified by:
castBean
in classAbstractBaseManager<MaleDigitalBooleanActionSocket>
- Parameters:
maleSocket
- the maleSocket to cast- Returns:
- the maleSocket as E
-
-