Package jmri.jmrix.openlcb
Class OlcbSystemConnectionMemo
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.jmrix.DefaultSystemConnectionMemo
-
- jmri.jmrix.can.CanSystemConnectionMemo
-
- jmri.jmrix.openlcb.OlcbSystemConnectionMemo
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,Disposable
,ConfiguringSystemConnectionMemo
,SystemConnectionMemo
public class OlcbSystemConnectionMemo extends CanSystemConnectionMemo
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
cf
protected org.openlcb.OlcbInterface
olcbInterface
protected OlcbProgrammerManager
programmerManager
protected OlcbSensorManager
sensorManager
protected OlcbThrottleManager
throttleManager
protected OlcbTurnoutManager
turnoutManager
-
Fields inherited from class jmri.jmrix.can.CanSystemConnectionMemo
_progModeSwitch, _protocol, _subProtocol, _supportsCVHints, DEFAULT_USERNAME, tm
-
Fields inherited from class jmri.jmrix.DefaultSystemConnectionMemo
classObjectMap
-
Fields inherited from class jmri.beans.Bean
propertyChangeSupport
-
Fields inherited from interface jmri.SystemConnectionMemo
DISABLED, INTERVAL, SYSTEM_PREFIX, USER_NAME
-
-
Constructor Summary
Constructors Constructor Description OlcbSystemConnectionMemo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
compareSystemNameSuffix(java.lang.String suffix1, java.lang.String suffix2)
void
configureManagers()
Configure the common managers for the connection.void
dispose()
Dispose of System Connection.<T> T
get(java.lang.Class<?> T)
Get a manager for a specific type.protected java.util.ResourceBundle
getActionModelResourceBundle()
org.openlcb.OlcbInterface
getInterface()
OlcbProgrammerManager
getProgrammerManager()
OlcbSensorManager
getSensorManager()
OlcbThrottleManager
getThrottleManager()
OlcbTurnoutManager
getTurnoutManager()
boolean
provides(java.lang.Class<?> type)
Tells which managers this class provides.void
setInterface(org.openlcb.OlcbInterface iface)
void
setProgrammerManager(OlcbProgrammerManager p)
-
Methods inherited from class jmri.jmrix.can.CanSystemConnectionMemo
getDefaultOutputInterval, getFromMap, getNamedBeanComparator, getProgModeSwitch, getProtocol, getProtocolAllOptions, getProtocolOption, getProtocolsWithOptions, getSubProtocol, getTrafficController, hasMultipleThrottles, isDirty, isRestartRequired, powerOnArst, setMultipleThrottles, setPowerOnArst, setProgModeSwitch, setProtocol, setProtocolOption, setSubProtocol, setSupportsCVHints, setTrafficController, storeCanMemotoInstance, supportsCVHints
-
Methods inherited from class jmri.jmrix.DefaultSystemConnectionMemo
deregister, getActionFactory, getConsistManager, getDisabled, getOutputInterval, getSystemPrefix, getUserName, 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, getDisabled, getOutputInterval, getSystemPrefix, getUserName, register, setDisabled, setOutputInterval, setSystemPrefix, setUserName
-
-
-
-
Field Detail
-
cf
final ComponentFactory cf
-
programmerManager
protected OlcbProgrammerManager programmerManager
-
turnoutManager
protected OlcbTurnoutManager turnoutManager
-
throttleManager
protected OlcbThrottleManager throttleManager
-
sensorManager
protected OlcbSensorManager sensorManager
-
olcbInterface
protected org.openlcb.OlcbInterface olcbInterface
-
-
Constructor Detail
-
OlcbSystemConnectionMemo
public OlcbSystemConnectionMemo()
-
-
Method Detail
-
provides
public boolean provides(java.lang.Class<?> type)
Tells which managers this class provides.- Specified by:
provides
in interfaceSystemConnectionMemo
- Overrides:
provides
in classCanSystemConnectionMemo
- 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)
Description copied from class:CanSystemConnectionMemo
Get a manager for a specific type. This method must return a non-null value ifDefaultSystemConnectionMemo.provides(java.lang.Class)
is true for the type, and must return null if provides() is false for the type. Searches ConfigurationManager for class before super.- Specified by:
get
in interfaceSystemConnectionMemo
- Overrides:
get
in classCanSystemConnectionMemo
- 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 the connection. This puts the common manager config in one place.- Specified by:
configureManagers
in interfaceConfiguringSystemConnectionMemo
- Overrides:
configureManagers
in classCanSystemConnectionMemo
-
getProgrammerManager
public OlcbProgrammerManager getProgrammerManager()
-
setProgrammerManager
public void setProgrammerManager(OlcbProgrammerManager p)
-
getTurnoutManager
public OlcbTurnoutManager getTurnoutManager()
-
getThrottleManager
public OlcbThrottleManager getThrottleManager()
-
getSensorManager
public OlcbSensorManager getSensorManager()
-
getInterface
public org.openlcb.OlcbInterface getInterface()
-
setInterface
public void setInterface(org.openlcb.OlcbInterface iface)
-
getActionModelResourceBundle
protected java.util.ResourceBundle getActionModelResourceBundle()
Description copied from class:CanSystemConnectionMemo
- Overrides:
getActionModelResourceBundle
in classCanSystemConnectionMemo
-
dispose
public void dispose()
Description copied from class:CanSystemConnectionMemo
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 classCanSystemConnectionMemo
-
compareSystemNameSuffix
@CheckReturnValue public static int compareSystemNameSuffix(@Nonnull java.lang.String suffix1, @Nonnull java.lang.String suffix2)
SeeNamedBean.compareSystemNameSuffix(java.lang.String, java.lang.String, jmri.NamedBean)
for background. This is a common implementation for OpenLCB Sensors and Turnouts of the comparison method.- Parameters:
suffix1
- 1st suffix to compare.suffix2
- 2nd suffix to compare.- Returns:
- true if suffixes match, else false.
-
-