Package jmri.jmrix.bidib
Class BiDiBSystemConnectionMemo
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.jmrix.DefaultSystemConnectionMemo
-
- jmri.jmrix.bidib.BiDiBSystemConnectionMemo
-
- All Implemented Interfaces:
BeanInterface
,PropertyChangeFirer
,PropertyChangeProvider
,Disposable
,SystemConnectionMemo
public class BiDiBSystemConnectionMemo extends DefaultSystemConnectionMemo
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 BiDiBPredefinedMeters
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 BiDiBSystemConnectionMemo()
BiDiBSystemConnectionMemo(BiDiBTrafficController tc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureManagers()
Configure the common managers for BiDiB connections.BiDiBPredefinedMeters
createPredefinedMeters()
void
dispose()
Dispose of System Connection.<T> T
get(java.lang.Class<T> T)
Get a manager for a specific type.protected java.util.ResourceBundle
getActionModelResourceBundle()
BiDiBTrafficController
getBiDiBTrafficController()
Provide access to the TrafficController for this particular connection.CommandStation
getCommandStation()
LightManager
getLightManager()
<B extends NamedBean>
java.util.Comparator<B>getNamedBeanComparator(java.lang.Class<B> type)
Get the Comparator to be used for two NamedBeans.PowerManager
getPowerManager()
BiDiBProgrammerManager
getProgrammerManager()
Provides access to the Programmer for this particular connection.ReporterManager
getReporterManager()
SensorManager
getSensorManager()
ThrottleManager
getThrottleManager()
TurnoutManager
getTurnoutManager()
void
postConfigure()
Called after all components (Sensors, Lights, ...) have been loaded Used to get some data from the device in one run NOT USED ANYMOREboolean
provides(java.lang.Class<?> type)
Check if this connection provides a specific manager type.void
setBiDiBTrafficController(BiDiBTrafficController tc)
Set the traffic controller instance associated with this connection memo.void
setLightManager(LightManager l)
void
setPowerManager(PowerManager p)
void
setProgrammerManager(BiDiBProgrammerManager p)
void
setReporterManager(ReporterManager s)
void
setSensorManager(SensorManager s)
void
setThrottleManager(ThrottleManager t)
void
setTurnoutManager(TurnoutManager t)
-
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
-
-
-
-
Field Detail
-
predefinedMeters
protected BiDiBPredefinedMeters predefinedMeters
-
-
Constructor Detail
-
BiDiBSystemConnectionMemo
public BiDiBSystemConnectionMemo(@Nonnull BiDiBTrafficController tc)
-
BiDiBSystemConnectionMemo
public BiDiBSystemConnectionMemo()
-
-
Method Detail
-
getBiDiBTrafficController
public BiDiBTrafficController getBiDiBTrafficController()
Provide access to the TrafficController for this particular connection.- Returns:
- BiDiB Traffic Controller
-
setBiDiBTrafficController
public void setBiDiBTrafficController(@Nonnull BiDiBTrafficController tc)
Set the traffic controller instance associated with this connection memo.- Parameters:
tc
- theBiDiBTrafficController
object to use.
-
configureManagers
public void configureManagers()
Configure the common managers for BiDiB connections. This puts the common manager config in one place. This method is static so that it can be referenced from classes that don't inherit.
-
postConfigure
public void postConfigure()
Called after all components (Sensors, Lights, ...) have been loaded Used to get some data from the device in one run NOT USED ANYMORE
-
getProgrammerManager
public BiDiBProgrammerManager getProgrammerManager()
Provides access to the Programmer for this particular connection.- Returns:
- programmer manager
-
setProgrammerManager
public void setProgrammerManager(BiDiBProgrammerManager p)
-
getThrottleManager
public ThrottleManager getThrottleManager()
-
setThrottleManager
public void setThrottleManager(ThrottleManager t)
-
getPowerManager
public PowerManager getPowerManager()
-
setPowerManager
public void setPowerManager(@Nonnull PowerManager p)
-
getSensorManager
public SensorManager getSensorManager()
-
setSensorManager
public void setSensorManager(@Nonnull SensorManager s)
-
getReporterManager
public ReporterManager getReporterManager()
-
setReporterManager
public void setReporterManager(@Nonnull ReporterManager s)
-
getTurnoutManager
public TurnoutManager getTurnoutManager()
-
setTurnoutManager
public void setTurnoutManager(@Nonnull TurnoutManager t)
-
getLightManager
public LightManager getLightManager()
-
setLightManager
public void setLightManager(@Nonnull LightManager l)
-
createPredefinedMeters
public BiDiBPredefinedMeters createPredefinedMeters()
-
getCommandStation
public CommandStation getCommandStation()
-
provides
public boolean provides(java.lang.Class<?> type)
Check if this connection provides a specific manager type. This method must return false if a manager for the specific type is not provided, and must return true if a manager for the specific type is provided.- 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)
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.- 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)
-
getActionModelResourceBundle
@Nonnull 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)
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
-
dispose
public void dispose()
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
-
-