Package jmri.jmrix.sprog
Class SprogSystemConnectionMemo
- java.lang.Object
-
- jmri.beans.UnboundBean
-
- jmri.beans.Bean
-
- jmri.jmrix.DefaultSystemConnectionMemo
-
- jmri.jmrix.sprog.SprogSystemConnectionMemo
-
- All Implemented Interfaces:
BeanInterface,PropertyChangeFirer,PropertyChangeProvider,Disposable,ConfiguringSystemConnectionMemo,SystemConnectionMemo
public class SprogSystemConnectionMemo 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) ComponentFactorycf-
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 SprogSystemConnectionMemo()SprogSystemConnectionMemo(SprogConstants.SprogMode sm)SprogSystemConnectionMemo(SprogConstants.SprogMode sm, SprogType type)SprogSystemConnectionMemo(SprogTrafficController st, SprogConstants.SprogMode sm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureCommandStation()voidconfigureCommandStation(boolean powerOption)Configure the programming manager and "command station" objects.voidconfigureCommandStation(int slots)Configure the programming manager and "command station" objects.voidconfigureCommandStation(int slots, java.lang.String powerOption)Configure the programming manager and "command station" objects.voidconfigureManagers()Configure the common managers for Sprog connections.voiddispose()Dispose of System Connection.protected java.util.ResourceBundlegetActionModelResourceBundle()SprogCommandStationgetCommandStation()Get the command station object associated with this connection.<B extends NamedBean>
java.util.Comparator<B>getNamedBeanComparator(java.lang.Class<B> type)Get the Comparator to be used for two NamedBeans.intgetNumSlots()Get the number of command station slotsSprogPowerManagergetPowerManager()SprogProgrammerManagergetProgrammerManager()java.lang.ThreadgetSlotThread()SprogConstants.SprogModegetSprogMode()Return the SPROG mode for this connection.SprogTrafficControllergetSprogTrafficController()Provide access to the TrafficController for this particular connection.SprogTypegetSprogType()Return the type of SPROG connected.SprogVersiongetSprogVersion()Return the SPROG version object for this connection.SprogVersionQuerygetSprogVersionQuery()ThrottleManagergetThrottleManager()TurnoutManagergetTurnoutManager()booleanprovides(java.lang.Class<?> type)Check if this connection provides a specific manager type.voidsetProgrammerManager(SprogProgrammerManager p)voidsetSprogMode(SprogConstants.SprogMode mode)Set the SPROG mode for this connection.voidsetSprogTrafficController(SprogTrafficController st)voidsetSprogVersion(SprogVersion version)Set the SPROG version object for this connection.-
Methods inherited from class jmri.jmrix.DefaultSystemConnectionMemo
deregister, get, 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
get, getActionFactory, getDefaultOutputInterval, getDisabled, getOutputInterval, getSystemPrefix, getUserName, isDirty, isRestartRequired, register, setDisabled, setOutputInterval, setSystemPrefix, setUserName
-
-
-
-
Constructor Detail
-
SprogSystemConnectionMemo
public SprogSystemConnectionMemo(SprogTrafficController st, SprogConstants.SprogMode sm)
-
SprogSystemConnectionMemo
public SprogSystemConnectionMemo(SprogConstants.SprogMode sm)
-
SprogSystemConnectionMemo
public SprogSystemConnectionMemo(SprogConstants.SprogMode sm, SprogType type)
-
SprogSystemConnectionMemo
public SprogSystemConnectionMemo()
-
-
Method Detail
-
setSprogMode
public void setSprogMode(SprogConstants.SprogMode mode)
Set the SPROG mode for this connection.- Parameters:
mode- selected mode
-
getSprogMode
public SprogConstants.SprogMode getSprogMode()
Return the SPROG mode for this connection.- Returns:
- SprogMode
-
getSprogVersion
public SprogVersion getSprogVersion()
Return the SPROG version object for this connection.- Returns:
- SprogVersion
-
setSprogVersion
public void setSprogVersion(SprogVersion version)
Set the SPROG version object for this connection.- Parameters:
version- type and version class
-
getSprogType
public SprogType getSprogType()
Return the type of SPROG connected.- Returns:
- SprogType set
-
getSprogTrafficController
public SprogTrafficController getSprogTrafficController()
Provide access to the TrafficController for this particular connection.- Returns:
- current tc for this connection
-
setSprogTrafficController
public void setSprogTrafficController(SprogTrafficController st)
-
getSlotThread
public java.lang.Thread getSlotThread()
-
getNumSlots
public int getNumSlots()
Get the number of command station slots- Returns:
- The number fo slots
-
configureCommandStation
public void configureCommandStation(boolean powerOption)
Configure the programming manager and "command station" objects.- Parameters:
powerOption- true if track power at startup is ON
-
configureCommandStation
public void configureCommandStation()
-
configureCommandStation
public void configureCommandStation(int slots)
Configure the programming manager and "command station" objects.- Parameters:
slots- number of command station slots
-
configureCommandStation
public void configureCommandStation(int slots, java.lang.String powerOption)
Configure the programming manager and "command station" objects.- Parameters:
slots- number of command station slotspowerOption- true if track power at startup is ON
-
getCommandStation
public SprogCommandStation getCommandStation()
Get the command station object associated with this connection.- Returns:
- the command station
-
provides
public boolean provides(java.lang.Class<?> type)
Description copied from class:DefaultSystemConnectionMemoCheck 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:
providesin interfaceSystemConnectionMemo- Overrides:
providesin 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)
-
configureManagers
public void configureManagers()
Configure the common managers for Sprog connections.- Specified by:
configureManagersin interfaceConfiguringSystemConnectionMemo
-
getProgrammerManager
public SprogProgrammerManager getProgrammerManager()
-
setProgrammerManager
public void setProgrammerManager(SprogProgrammerManager p)
-
getPowerManager
public SprogPowerManager getPowerManager()
-
getThrottleManager
public ThrottleManager getThrottleManager()
-
getTurnoutManager
public TurnoutManager getTurnoutManager()
-
getActionModelResourceBundle
protected java.util.ResourceBundle getActionModelResourceBundle()
- Specified by:
getActionModelResourceBundlein classDefaultSystemConnectionMemo
-
getNamedBeanComparator
public <B extends NamedBean> java.util.Comparator<B> getNamedBeanComparator(java.lang.Class<B> type)
Description copied from class:DefaultSystemConnectionMemoGet 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:
getNamedBeanComparatorin interfaceSystemConnectionMemo- Specified by:
getNamedBeanComparatorin classDefaultSystemConnectionMemo- Type Parameters:
B- the type of NamedBean- Parameters:
type- the class of NamedBean- Returns:
- the Comparator
-
dispose
public void dispose()
Description copied from class:DefaultSystemConnectionMemoDispose of System Connection.Removes objects from classObjectMap after calling dispose if Disposable. Removes these objects from InstanceManager.
- Specified by:
disposein interfaceDisposable- Specified by:
disposein interfaceSystemConnectionMemo- Overrides:
disposein classDefaultSystemConnectionMemo
-
getSprogVersionQuery
public SprogVersionQuery getSprogVersionQuery()
- Returns:
- a SprogVersionQuery object for this connection
-
-