Class ScheduleManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.locations.schedules.ScheduleManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class ScheduleManager
extends PropertyChangeSupport
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize, PropertyChangeListener
Manages schedules.
-
Field Summary
FieldsFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopySchedule(Schedule schedule, String newScheduleName) voidderegister(Schedule schedule) Forget a NamedBean Object created outside the manager.voiddispose()Gets a JComboBox loaded with schedules.getListSpurs(Schedule schedule) getScheduleByName(String name) Sort by schedule id numberSort by schedule namegetSpursByScheduleComboBox(Schedule schedule) Gets a JComboBox with a list of spurs that use this schedule.voidPerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidload(org.jdom2.Element root) newSchedule(String name) Finds an existing schedule or creates a new schedule if needed requires schedule's name creates a unique id for this scheduleintvoidCheck for car type and road name changes.voidRemember a NamedBean Object created outside the manager.voidreplaceLoad(String type, String oldLoad, String newLoad) Replaces car loads in all schedules with specific car type.voidreplaceRoad(String oldRoad, String newRoad) Replaces car roads in all schedules.voidreplaceTrack(Track oldTrack, Track newTrack) voidreplaceType(String oldType, String newType) Replaces car type in all schedules.voidprotected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidstore(org.jdom2.Element root) voidupdateComboBox(JComboBox<Schedule> box) Update a JComboBox with the latest schedules.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:
-
_scheduleHashTable
-
-
Constructor Details
-
ScheduleManager
public ScheduleManager()
-
-
Method Details
-
dispose
-
numEntries
- Returns:
- Number of schedules
-
getScheduleByName
- Parameters:
name- The string name for the schedule- Returns:
- requested Schedule object or null if none exists
-
getScheduleById
-
newSchedule
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 for this schedule- Returns:
- new schedule or existing schedule
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
schedule- The Schedule to add.
-
deregister
Forget a NamedBean Object created outside the manager.- Parameters:
schedule- The Schedule to delete.
-
getSchedulesByNameList
Sort by schedule name- Returns:
- list of schedules ordered by name
-
getSchedulesByIdList
Sort by schedule id number- Returns:
- list of schedules ordered by id number
-
copySchedule
-
resetHitCounts
-
getComboBox
Gets a JComboBox loaded with schedules.- Returns:
- JComboBox with a list of schedules.
-
updateComboBox
Update a JComboBox with the latest schedules.- Parameters:
box- the JComboBox needing an update.
-
replaceType
Replaces car type in all schedules.- Parameters:
oldType- car type to be replaced.newType- replacement car type.
-
replaceRoad
Replaces car roads in all schedules.- Parameters:
oldRoad- car road to be replaced.newRoad- replacement car road.
-
replaceLoad
Replaces car loads in all schedules with specific car type.- Parameters:
type- car type.oldLoad- car load to be replaced.newLoad- replacement car load.
-
replaceTrack
-
getSpursByScheduleComboBox
Gets a JComboBox with a list of spurs that use this schedule.- Parameters:
schedule- The schedule for this JComboBox.- Returns:
- JComboBox with a list of spurs using schedule.
-
getListSpurs
-
load
-
store
-
propertyChange
Check for car type and road name changes.- 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
-