Class TrainScheduleManager

    • Method Detail

      • numEntries

        public int numEntries()
        Returns:
        Number of schedules
      • setTrainScheduleActiveId

        public void setTrainScheduleActiveId​(java.lang.String id)
        Sets the selected schedule id
        Parameters:
        id - Selected schedule id
      • getScheduleByName

        public TrainSchedule getScheduleByName​(java.lang.String name)
        Parameters:
        name - The schedule string name to search for.
        Returns:
        requested TrainSchedule object or null if none exists
      • newSchedule

        public TrainSchedule newSchedule​(java.lang.String name)
        Finds an existing schedule or creates a new schedule if needed requires schedule's name creates a unique id for this schedule
        Parameters:
        name - The string name of the schedule.
        Returns:
        new TrainSchedule or existing TrainSchedule
      • register

        public void register​(TrainSchedule schedule)
        Remember a NamedBean Object created outside the manager.
        Parameters:
        schedule - The TrainSchedule to add.
      • deregister

        public void deregister​(TrainSchedule schedule)
        Forget a NamedBean Object created outside the manager.
        Parameters:
        schedule - The TrainSchedule to delete.
      • getSchedulesByIdList

        public java.util.List<TrainSchedulegetSchedulesByIdList()
        Sort by train schedule id numbers
        Returns:
        list of train schedules ordered by id numbers
      • getComboBox

        public javax.swing.JComboBox<TrainSchedulegetComboBox()
        Gets a JComboBox loaded with schedules starting with null.
        Returns:
        JComboBox with a list of schedules.
      • getSelectComboBox

        public javax.swing.JComboBox<TrainSchedulegetSelectComboBox()
        Gets a JComboBox loaded with schedules starting with null.
        Returns:
        JComboBox with a list of schedules starting with null.
      • updateComboBox

        public void updateComboBox​(javax.swing.JComboBox<TrainSchedule> box)
        Update a JComboBox with the latest schedules.
        Parameters:
        box - the JComboBox needing an update.
        Throws:
        java.lang.IllegalArgumentException - if box is null
      • 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 - The common Element for operations-trains.dtd.
      • load

        public void load​(org.jdom2.Element root)
      • 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)