Class AutomationManager

    • Method Detail

      • getSize

        public int getSize()
        Returns:
        Number of automations
      • getAutomationByName

        public 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
      • newAutomation

        public 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
      • register

        public void register​(Automation automation)
        Remember a NamedBean Object created outside the manager.
        Parameters:
        automation - The automation that is being registered.
      • deregister

        public void deregister​(Automation automation)
        Forget a NamedBean Object created outside the manager.
        Parameters:
        automation - The automation to be deleted.
      • getAutomationsByIdList

        public java.util.List<AutomationgetAutomationsByIdList()
        Sort by automation id number
        Returns:
        list of automations ordered by id number
      • getComboBox

        public javax.swing.JComboBox<AutomationgetComboBox()
        Gets a JComboBox loaded with automations.
        Returns:
        JComboBox with a list of automations.
      • updateComboBox

        public void updateComboBox​(javax.swing.JComboBox<Automation> box)
        Update a JComboBox with the latest automations.
        Parameters:
        box - the JComboBox needing an update.
      • resumeAutomations

        public void resumeAutomations()
        Restarts all automations that were running when the operations program was last saved.
      • copyAutomation

        public 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
      • load

        public 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
      • store

        public 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
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • setDirtyAndFirePropertyChange

        protected void setDirtyAndFirePropertyChange​(java.lang.String p,
                                                     java.lang.Object old,
                                                     java.lang.Object n)