Class TrainManualBuildManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.trains.manualtrainbuilder.TrainManualBuildManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class TrainManualBuildManager
extends PropertyChangeSupport
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize, PropertyChangeListener
Manages train manual builds
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Hashtable<String,TrainManualBuild> static final StringFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyManualBuild(TrainManualBuild manualBuild, String newManualBuildName) voidderegister(TrainManualBuild manualBuild) Forget a NamedBean Object created outside the manager.voiddispose()getManualBuildByTrainId(String trainId) Sort by manual build id numberSort by manual build train namesvoidPerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidload(org.jdom2.Element root) newManualBuild(String trainId) Finds an existing manual build or creates a new manual build if needed.intvoidCheck for car type and road name changes.voidregister(TrainManualBuild manualBuild) Remember a NamedBean Object created outside the manager.voidreplaceLoad(String type, String oldLoad, String newLoad) Replaces car loads in all manual builds with specific car type.voidreplaceRoad(String oldRoad, String newRoad) Replaces car roads in all manual builds.voidreplaceTrack(Track oldTrack, Track newTrack) voidreplaceType(String oldType, String newType) Replaces car type in all manual builds.protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidstore(org.jdom2.Element root) 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:
-
_manualBuildHashTable
-
-
Constructor Details
-
TrainManualBuildManager
public TrainManualBuildManager()
-
-
Method Details
-
dispose
-
numEntries
- Returns:
- Number of manual builds
-
getManualBuildByTrainId
- Parameters:
trainId- The train id for the manual build- Returns:
- requested ManualBuild object or null if none exists
-
getManualBuildById
-
newManualBuild
Finds an existing manual build or creates a new manual build if needed.- Parameters:
trainId- The train id for this manual build- Returns:
- new manual build or existing manual build
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
manualBuild- The ManualBuild to add.
-
deregister
Forget a NamedBean Object created outside the manager.- Parameters:
manualBuild- The ManualBuild to delete.
-
getManualBuildsByTrainNameList
Sort by manual build train names- Returns:
- list of manual builds ordered by train names
-
getManualBuildsByIdList
Sort by manual build id number- Returns:
- list of manual builds ordered by id number
-
copyManualBuild
-
replaceType
Replaces car type in all manual builds.- Parameters:
oldType- car type to be replaced.newType- replacement car type.
-
replaceRoad
Replaces car roads in all manual builds.- Parameters:
oldRoad- car road to be replaced.newRoad- replacement car road.
-
replaceLoad
Replaces car loads in all manual builds with specific car type.- Parameters:
type- car type.oldLoad- car load to be replaced.newLoad- replacement car load.
-
replaceTrack
-
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
-