Package jmri.managers
Class ProxyMeterManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.beans.VetoableChangeSupport
-
- jmri.managers.AbstractProxyManager<Meter>
-
- jmri.managers.ProxyMeterManager
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeFirer
,VetoableChangeProvider
,Manager<Meter>
,Manager.ManagerDataListener<Meter>
,MeterManager
,ProxyManager<Meter>
public class ProxyMeterManager extends AbstractProxyManager<Meter> implements MeterManager
Implementation of a MeterManager 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 ProxyMeterManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Manager<Meter>
createSystemManager(SystemConnectionMemo memo)
Try to create a system manager.If this proxy manager is able to create a system manager, the concrete class must implement this method.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.Meter
getBySystemName(java.lang.String systemName)
Locate an existing instance based on a system name.Meter
getByUserName(java.lang.String userName)
Locate an existing instance based on a user name.java.lang.Class<Meter>
getNamedBeanClass()
Get the class of NamedBean supported by this Manager.int
getXMLOrder()
Determine the order that types should be written when storing panel files.protected AbstractManager<Meter>
makeInternalManager()
Create specific internal manager as needed for concrete type.void
propertyChange(java.beans.PropertyChangeEvent e)
-
Methods inherited from class jmri.managers.AbstractProxyManager
addDataListener, addManager, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, contentsChanged, 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
-
ProxyMeterManager
public ProxyMeterManager()
-
-
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<Meter>
- Returns:
- write order for this Manager; larger is later.
-
makeInternalManager
protected AbstractManager<Meter> makeInternalManager()
Description copied from class:AbstractProxyManager
Create specific internal manager as needed for concrete type.- Specified by:
makeInternalManager
in classAbstractProxyManager<Meter>
- 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<Meter>
- 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<Meter> 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<Meter>
- Returns:
- the class supported by this Manager.
-
getBySystemName
@CheckReturnValue @CheckForNull public Meter 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<Meter>
- Overrides:
getBySystemName
in classAbstractProxyManager<Meter>
- Parameters:
systemName
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
@CheckForNull public Meter getByUserName(@Nonnull java.lang.String userName)
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<Meter>
- Overrides:
getByUserName
in classAbstractProxyManager<Meter>
- Parameters:
userName
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
createSystemManager
protected Manager<Meter> createSystemManager(@Nonnull SystemConnectionMemo memo)
Try to create a system manager.If this proxy manager is able to create a system manager, the concrete class must implement this method.- Overrides:
createSystemManager
in classAbstractProxyManager<Meter>
- Parameters:
memo
- the system connection memo for this connection- Returns:
- the new manager or null if it's not possible to create the manager
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:AbstractProxyManager
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classAbstractProxyManager<Meter>
-
-