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) ComponentFactory
cf
-
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 void
configureCommandStation()
void
configureCommandStation(boolean powerOption)
Configure the programming manager and "command station" objects.void
configureCommandStation(int slots)
Configure the programming manager and "command station" objects.void
configureCommandStation(int slots, java.lang.String powerOption)
Configure the programming manager and "command station" objects.void
configureManagers()
Configure the common managers for Sprog connections.void
dispose()
Dispose of System Connection.protected java.util.ResourceBundle
getActionModelResourceBundle()
SprogCommandStation
getCommandStation()
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.int
getNumSlots()
Get the number of command station slotsSprogPowerManager
getPowerManager()
SprogProgrammerManager
getProgrammerManager()
java.lang.Thread
getSlotThread()
SprogConstants.SprogMode
getSprogMode()
Return the SPROG mode for this connection.SprogTrafficController
getSprogTrafficController()
Provide access to the TrafficController for this particular connection.SprogType
getSprogType()
Return the type of SPROG connected.SprogVersion
getSprogVersion()
Return the SPROG version object for this connection.SprogVersionQuery
getSprogVersionQuery()
ThrottleManager
getThrottleManager()
TurnoutManager
getTurnoutManager()
boolean
provides(java.lang.Class<?> type)
Check if this connection provides a specific manager type.void
setProgrammerManager(SprogProgrammerManager p)
void
setSprogMode(SprogConstants.SprogMode mode)
Set the SPROG mode for this connection.void
setSprogTrafficController(SprogTrafficController st)
void
setSprogVersion(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:DefaultSystemConnectionMemo
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)
-
configureManagers
public void configureManagers()
Configure the common managers for Sprog connections.- Specified by:
configureManagers
in 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:
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
-
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
-
getSprogVersionQuery
public SprogVersionQuery getSprogVersionQuery()
- Returns:
- a SprogVersionQuery object for this connection
-
-