Package jmri.managers
Class ProxyAnalogIOManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractProxyManager<AnalogIO>
-
- jmri.managers.ProxyAnalogIOManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,AnalogIOManager
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,Manager<AnalogIO>
,Manager.ManagerDataListener<AnalogIO>
,ProxyManager<AnalogIO>
public class ProxyAnalogIOManager extends AbstractProxyManager<AnalogIO> implements AnalogIOManager
Implementation of a AnalogIOManager that can serve as a proxy for multiple system-specific implementations.
-
-
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.managers.AbstractProxyManager
defaultManager, listeners, 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 ProxyAnalogIOManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBeanType(java.lang.Class<? extends AnalogIO> clazz, Manager<? extends NamedBean> manager)
Add a type of NamedBean, for example VariableLight, that should be also registred in AnalogIOManager.void
dispose()
Free resources when no longer used.java.lang.String
getBeanTypeHandled(boolean plural)
Get the user-readable name of the type of NamedBean handled by this manager.AnalogIO
getBySystemName(java.lang.String systemName)
Locate an existing instance based on a system name.AnalogIO
getByUserName(java.lang.String userName)
Locate an existing instance based on a user name.java.lang.Class<AnalogIO>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.int
getXMLOrder()
Determine the order that types should be written when storing panel files.ProxyAnalogIOManager
init()
protected AbstractManager<AnalogIO>
makeInternalManager()
Create specific internal manager as needed for concrete type.void
propertyChange(java.beans.PropertyChangeEvent e)
void
removeBeanType(java.lang.Class<? extends AnalogIO> clazz, Manager<? extends NamedBean> manager)
Remove a type of NamedBean, for example VariableLight, from beeing registred in AnalogIOManager.-
Methods inherited from class jmri.managers.AbstractProxyManager
addDataListener, addManager, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, contentsChanged, createSystemManager, createSystemName, createSystemName, deleteBean, deregister, getDefaultManager, getDisplayOrderManagerList, getEntryToolTip, getInternalManager, getKnownBeanProperties, getManager, getManagerList, getManagerOrDefault, getMemo, getNamedBean, getNamedBeanSet, getNextValidSystemName, getObjectCount, getSystemPrefix, initInternal, intervalAdded, intervalRemoved, makeSystemName, recomputeNamedBeanSet, register, removeDataListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener, setDataListenerMute, setPropertyChangesSilenced, typeLetter, validateSystemNameFormat, validSystemNameFormat
-
Methods inherited from class jmri.beans.VetoableChangeSupport
fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners
-
Methods inherited from class jmri.beans.PropertyChangeSupport
fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners
-
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, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, typeLetter, 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
-
-
-
-
Constructor Detail
-
ProxyAnalogIOManager
public ProxyAnalogIOManager()
-
-
Method Detail
-
init
@Nonnull public ProxyAnalogIOManager init()
-
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<AnalogIO>
- Returns:
- write order for this Manager; larger is later.
-
makeInternalManager
protected AbstractManager<AnalogIO> makeInternalManager()
Description copied from class:AbstractProxyManager
Create specific internal manager as needed for concrete type.- Specified by:
makeInternalManager
in classAbstractProxyManager<AnalogIO>
- Returns:
- an internal manager
-
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<AnalogIO>
- 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<AnalogIO> 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<AnalogIO>
- Returns:
- the class supported by this Manager.
-
getBySystemName
@CheckReturnValue @CheckForNull public AnalogIO getBySystemName(@Nonnull java.lang.String systemName)
Description copied from class:AbstractProxyManager
Locate an existing instance based on a system name.- Specified by:
getBySystemName
in interfaceManager<AnalogIO>
- Overrides:
getBySystemName
in classAbstractProxyManager<AnalogIO>
- Parameters:
systemName
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
@CheckForNull public AnalogIO getByUserName(@Nonnull java.lang.String userName)
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<AnalogIO>
- Overrides:
getByUserName
in classAbstractProxyManager<AnalogIO>
- Parameters:
userName
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:AbstractProxyManager
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classAbstractProxyManager<AnalogIO>
-
dispose
public void dispose()
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.
-
addBeanType
public void addBeanType(java.lang.Class<? extends AnalogIO> clazz, Manager<? extends NamedBean> manager)
Add a type of NamedBean, for example VariableLight, that should be also registred in AnalogIOManager.- Specified by:
addBeanType
in interfaceAnalogIOManager
- Parameters:
clazz
- the NamedBean class that should be registered in this managermanager
- the manager that managers the NamedBeans of type clazz
-
removeBeanType
public void removeBeanType(java.lang.Class<? extends AnalogIO> clazz, Manager<? extends NamedBean> manager)
Remove a type of NamedBean, for example VariableLight, from beeing registred in AnalogIOManager.- Specified by:
removeBeanType
in interfaceAnalogIOManager
- Parameters:
clazz
- the NamedBean class that should be registered in this managermanager
- the manager that managers the NamedBeans of type clazz
-
-