Package jmri.jmrix.roco.z21
Class Z21SystemConnectionMemo
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.jmrix.DefaultSystemConnectionMemo
-
- jmri.jmrix.roco.z21.Z21SystemConnectionMemo
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,Disposable
,ConfiguringSystemConnectionMemo
,SystemConnectionMemo
public class Z21SystemConnectionMemo extends DefaultSystemConnectionMemo implements ConfiguringSystemConnectionMemo
Lightweight class to denote that a system is active, and provide general information.Objects of specific subtypes are registered in the instance manager to activate their particular system.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) ComponentFactory
componentFactory
protected Z21PredefinedMeters
predefinedMeters
-
Fields inherited from class jmri.jmrix.DefaultSystemConnectionMemo
classObjectMap
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
Fields inherited from interface jmri.SystemConnectionMemo
DEREGISTER, DISABLED, INTERVAL, STORE, SYSTEM_PREFIX, USER_NAME
-
-
Constructor Summary
Constructors Constructor Description Z21SystemConnectionMemo()
Z21SystemConnectionMemo(java.lang.String prefix, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureManagers()
Configure the common managers for z21 connections.Z21PredefinedMeters
createPredefinedMeters()
Provide access to the Roco Z21 MultiMeter for this particular connection.void
dispose()
Dispose of System Connection.<T> T
get(java.lang.Class<T> T)
Provide manager by class.protected java.util.ResourceBundle
getActionModelResourceBundle()
CommandStation
getCommandStation()
Provide access to the Command Station for this particular connection.Z21HeartBeat
getHeartBeat()
Provide access to the Z21HeartBeat instance for this connection.<B extends NamedBean>
java.util.Comparator<B>getNamedBeanComparator(java.lang.Class<B> type)
Get the Comparator to be used for two NamedBeans.XNetProgrammerManager
getProgrammerManager()
Z21ReporterManager
getReporterManager()
RocoZ21CommandStation
getRocoZ21CommandStation()
Provide access to the Roco Z21 Command Station for this particular connection.Z21SensorManager
getSensorManager()
Z21TrafficController
getTrafficController()
protected void
init()
boolean
provides(java.lang.Class<?> type)
Tells which managers this class provides.void
setCommandStation(CommandStation c)
void
setProgrammerManager(XNetProgrammerManager p)
void
setReporterManager(Z21ReporterManager rm)
Reporter Manager for this instance.void
setRocoZ21CommandStation(RocoZ21CommandStation c)
void
setSensorManager(Z21SensorManager sm)
SensorManager for this instance.void
setTrafficController(Z21TrafficController newtc)
Traffic Controller for this instance.(package private) void
shutdownTunnel()
-
Methods inherited from class jmri.jmrix.DefaultSystemConnectionMemo
deregister, getActionFactory, getConsistManager, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setConsistManager, setDisabled, setOutputInterval, setSystemPrefix, setUserName, store
-
Methods inherited from class jmri.beans.Bean
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, isNotifyOnEDT, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class jmri.beans.UnboundBean
getIndexedProperty, getProperty, getPropertyNames, hasIndexedProperty, hasProperty, setIndexedProperty, setProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.SystemConnectionMemo
getActionFactory, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setDisabled, setOutputInterval, setSystemPrefix, setUserName
-
-
-
-
Field Detail
-
componentFactory
ComponentFactory componentFactory
-
predefinedMeters
protected Z21PredefinedMeters predefinedMeters
-
-
Constructor Detail
-
Z21SystemConnectionMemo
public Z21SystemConnectionMemo()
-
Z21SystemConnectionMemo
public Z21SystemConnectionMemo(java.lang.String prefix, java.lang.String userName)
-
-
Method Detail
-
init
protected void init()
-
setTrafficController
public void setTrafficController(Z21TrafficController newtc)
Traffic Controller for this instance.- Parameters:
newtc
- Z21 traffic controller.
-
getTrafficController
public Z21TrafficController getTrafficController()
-
setReporterManager
public void setReporterManager(Z21ReporterManager rm)
Reporter Manager for this instance.- Parameters:
rm
- reporter manager.
-
getReporterManager
public Z21ReporterManager getReporterManager()
-
setSensorManager
public void setSensorManager(Z21SensorManager sm)
SensorManager for this instance.- Parameters:
sm
- sensor manager.
-
getSensorManager
public Z21SensorManager getSensorManager()
-
getProgrammerManager
public XNetProgrammerManager getProgrammerManager()
-
setProgrammerManager
public void setProgrammerManager(XNetProgrammerManager p)
-
provides
public boolean provides(java.lang.Class<?> type)
Tells which managers this class provides.- Specified by:
provides
in interfaceSystemConnectionMemo
- Overrides:
provides
in classDefaultSystemConnectionMemo
- Parameters:
type
- The class type for the manager to be provided- Returns:
- true if the specified manager is provided
- See Also:
DefaultSystemConnectionMemo.get(java.lang.Class)
-
get
public <T> T get(java.lang.Class<T> T)
Provide manager by class.- Specified by:
get
in interfaceSystemConnectionMemo
- Overrides:
get
in classDefaultSystemConnectionMemo
- Type Parameters:
T
- Type of manager to get- Parameters:
T
- Type of manager to get- Returns:
- The manager or null if provides() is false for T
- See Also:
DefaultSystemConnectionMemo.provides(java.lang.Class)
-
configureManagers
public void configureManagers()
Configure the common managers for z21 connections. This puts the common manager config in one place.- Specified by:
configureManagers
in interfaceConfiguringSystemConnectionMemo
-
getActionModelResourceBundle
protected java.util.ResourceBundle getActionModelResourceBundle()
- Specified by:
getActionModelResourceBundle
in classDefaultSystemConnectionMemo
-
getNamedBeanComparator
public <B extends NamedBean> java.util.Comparator<B> getNamedBeanComparator(java.lang.Class<B> type)
Description copied from class:DefaultSystemConnectionMemo
Get the Comparator to be used for two NamedBeans. This is typically anNamedBeanComparator
, but may be any Comparator that works for this connection type.- Specified by:
getNamedBeanComparator
in interfaceSystemConnectionMemo
- Specified by:
getNamedBeanComparator
in classDefaultSystemConnectionMemo
- Type Parameters:
B
- the type of NamedBean- Parameters:
type
- the class of NamedBean- Returns:
- the Comparator
-
getCommandStation
public CommandStation getCommandStation()
Provide access to the Command Station for this particular connection.NOTE: Command Station defaults to NULL
- Returns:
- command station, may be null.
-
setCommandStation
public void setCommandStation(CommandStation c)
-
getRocoZ21CommandStation
public RocoZ21CommandStation getRocoZ21CommandStation()
Provide access to the Roco Z21 Command Station for this particular connection.NOTE: Command Station defaults to NULL
- Returns:
- Roco Z21 Command Station, may be null.
-
setRocoZ21CommandStation
public void setRocoZ21CommandStation(RocoZ21CommandStation c)
-
createPredefinedMeters
public Z21PredefinedMeters createPredefinedMeters()
Provide access to the Roco Z21 MultiMeter for this particular connection.NOTE: PredefinedMeters defaults to NULL
- Returns:
- PredefinedMeters, creates new if null.
-
getHeartBeat
public Z21HeartBeat getHeartBeat()
Provide access to the Z21HeartBeat instance for this connection.NOTE: HeartBeat defaults to NULL
- Returns:
- the HeartBeat, creates new if null.
-
shutdownTunnel
void shutdownTunnel()
-
dispose
public void dispose()
Description copied from class:DefaultSystemConnectionMemo
Dispose of System Connection.Removes objects from classObjectMap after calling dispose if Disposable. Removes these objects from InstanceManager.
- Specified by:
dispose
in interfaceDisposable
- Specified by:
dispose
in interfaceSystemConnectionMemo
- Overrides:
dispose
in classDefaultSystemConnectionMemo
-
-