Package jmri.jmrit.operations.automation
Class AutomationManager
- java.lang.Object
- 
- jmri.beans.PropertyChangeSupport
- 
- jmri.jmrit.operations.automation.AutomationManager
 
 
- 
- All Implemented Interfaces:
- java.beans.PropertyChangeListener,- java.util.EventListener,- PropertyChangeFirer,- PropertyChangeProvider,- InstanceManagerAutoDefault,- InstanceManagerAutoInitialize
 
 public class AutomationManager extends PropertyChangeSupport implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize, java.beans.PropertyChangeListener Manages automations.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.util.Hashtable<java.lang.String,Automation>_automationHashTableprotected Automation_startupAutomationstatic java.lang.StringLISTLENGTH_CHANGED_PROPERTY- 
Fields inherited from class jmri.beans.PropertyChangeSupportpropertyChangeSupport
 
- 
 - 
Constructor SummaryConstructors Constructor Description AutomationManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description AutomationcopyAutomation(Automation automation, java.lang.String newName)Makes a new copy of automationvoidderegister(Automation automation)Forget a NamedBean Object created outside the manager.voiddispose()AutomationgetAutomationById(java.lang.String id)AutomationgetAutomationByName(java.lang.String name)java.util.List<Automation>getAutomationsByIdList()Sort by automation id numberjava.util.List<Automation>getAutomationsByNameList()Sort by automation namejavax.swing.JComboBox<Automation>getComboBox()Gets a JComboBox loaded with automations.intgetSize()AutomationgetStartupAutomation()protected java.lang.StringgetStartupAutomationId()voidinitialize()Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidload(org.jdom2.Element root)Construct this Entry from XML.AutomationnewAutomation(java.lang.String name)Finds an existing automation or creates a new automation if needed requires automation's name creates a unique id for this automationvoidpropertyChange(java.beans.PropertyChangeEvent e)voidregister(Automation automation)Remember a NamedBean Object created outside the manager.voidresumeAutomations()Restarts all automations that were running when the operations program was last saved.voidrunStartupAutomation()protected voidsetDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)voidsetStartupAutomation(Automation automation)voidstore(org.jdom2.Element root)Create an XML element to represent this Entry.voidupdateComboBox(javax.swing.JComboBox<Automation> box)Update a JComboBox with the latest automations.- 
Methods inherited from class jmri.beans.PropertyChangeSupportaddPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
- 
 
- 
- 
- 
Field Detail- 
LISTLENGTH_CHANGED_PROPERTYpublic static final java.lang.String LISTLENGTH_CHANGED_PROPERTY - See Also:
- Constant Field Values
 
 - 
_automationHashTableprotected java.util.Hashtable<java.lang.String,Automation> _automationHashTable 
 - 
_startupAutomationprotected Automation _startupAutomation 
 
- 
 - 
Constructor Detail- 
AutomationManagerpublic AutomationManager() 
 
- 
 - 
Method Detail- 
getSizepublic int getSize() - Returns:
- Number of automations
 
 - 
getAutomationByNamepublic Automation getAutomationByName(java.lang.String name) - Parameters:
- name- The string name of the automation to be returned.
- Returns:
- requested Automation object or null if none exists
 
 - 
getAutomationByIdpublic Automation getAutomationById(java.lang.String id) 
 - 
newAutomationpublic Automation newAutomation(java.lang.String name) Finds an existing automation or creates a new automation if needed requires automation's name creates a unique id for this automation- Parameters:
- name- The string name of the automation.
- Returns:
- new automation or existing automation
 
 - 
registerpublic void register(Automation automation) Remember a NamedBean Object created outside the manager.- Parameters:
- automation- The automation that is being registered.
 
 - 
deregisterpublic void deregister(Automation automation) Forget a NamedBean Object created outside the manager.- Parameters:
- automation- The automation to be deleted.
 
 - 
getAutomationsByNameListpublic java.util.List<Automation> getAutomationsByNameList() Sort by automation name- Returns:
- list of automations ordered by name
 
 - 
getAutomationsByIdListpublic java.util.List<Automation> getAutomationsByIdList() Sort by automation id number- Returns:
- list of automations ordered by id number
 
 - 
getComboBoxpublic javax.swing.JComboBox<Automation> getComboBox() Gets a JComboBox loaded with automations.- Returns:
- JComboBox with a list of automations.
 
 - 
updateComboBoxpublic void updateComboBox(javax.swing.JComboBox<Automation> box) Update a JComboBox with the latest automations.- Parameters:
- box- the JComboBox needing an update.
 
 - 
resumeAutomationspublic void resumeAutomations() Restarts all automations that were running when the operations program was last saved.
 - 
copyAutomationpublic Automation copyAutomation(Automation automation, java.lang.String newName) Makes a new copy of automation- Parameters:
- automation- the automation to copy
- newName- name for the copy of automation
- Returns:
- new copy of automation
 
 - 
getStartupAutomationpublic Automation getStartupAutomation() 
 - 
getStartupAutomationIdprotected java.lang.String getStartupAutomationId() 
 - 
setStartupAutomationpublic void setStartupAutomation(Automation automation) 
 - 
runStartupAutomationpublic void runStartupAutomation() 
 - 
disposepublic void dispose() 
 - 
loadpublic void load(org.jdom2.Element root) Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-trains.dtd- Parameters:
- root- Consist XML element
 
 - 
storepublic void store(org.jdom2.Element root) Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-trains.dtd.- Parameters:
- root- Contents in a JDOM Element
 
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent e) - Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
 
 - 
setDirtyAndFirePropertyChangeprotected void setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n) 
 - 
initializepublic void initialize() Description copied from interface:InstanceManagerAutoInitializePerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.- Specified by:
- initializein interface- InstanceManagerAutoInitialize
 
 
- 
 
-