Package jmri.jmrit.operations.automation
Class AutomationManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.automation.AutomationManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class AutomationManager
extends PropertyChangeSupport
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize, PropertyChangeListener
Manages automations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Hashtable<String,Automation> protected Automationstatic final StringFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyAutomation(Automation automation, String newName) Makes a new copy of automationvoidderegister(Automation automation) Forget a NamedBean Object created outside the manager.voiddispose()getAutomationByName(String name) Sort by automation id numberSort by automation nameGets a JComboBox loaded with automations.intgetSize()protected StringvoidPerform 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.newAutomation(String name) Finds an existing automation or creates a new automation if needed requires automation's name creates a unique id for this automationvoidvoidregister(Automation automation) Remember a NamedBean Object created outside the manager.voidRestarts all automations that were running when the operations program was last saved.voidprotected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidsetStartupAutomation(Automation automation) voidstore(org.jdom2.Element root) Create an XML element to represent this Entry.voidUpdate a JComboBox with the latest automations.Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
LISTLENGTH_CHANGED_PROPERTY
- See Also:
-
_automationHashTable
-
_startupAutomation
-
-
Constructor Details
-
AutomationManager
public AutomationManager()
-
-
Method Details
-
getSize
- Returns:
- Number of automations
-
getAutomationByName
- Parameters:
name- The string name of the automation to be returned.- Returns:
- requested Automation object or null if none exists
-
getAutomationById
-
newAutomation
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
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
automation- The automation that is being registered.
-
deregister
Forget a NamedBean Object created outside the manager.- Parameters:
automation- The automation to be deleted.
-
getAutomationsByNameList
Sort by automation name- Returns:
- list of automations ordered by name
-
getAutomationsByIdList
Sort by automation id number- Returns:
- list of automations ordered by id number
-
getComboBox
Gets a JComboBox loaded with automations.- Returns:
- JComboBox with a list of automations.
-
updateComboBox
Update a JComboBox with the latest automations.- Parameters:
box- the JComboBox needing an update.
-
resumeAutomations
Restarts all automations that were running when the operations program was last saved. -
copyAutomation
Makes a new copy of automation- Parameters:
automation- the automation to copynewName- name for the copy of automation- Returns:
- new copy of automation
-
getStartupAutomation
-
getStartupAutomationId
-
setStartupAutomation
-
runStartupAutomation
-
dispose
-
load
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-trains.dtd- Parameters:
root- Consist XML element
-
store
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
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
setDirtyAndFirePropertyChange
-
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 interfaceInstanceManagerAutoInitialize
-