Class EngineManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.rollingstock.RollingStockManager<Engine>
jmri.jmrit.operations.rollingstock.engines.EngineManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class EngineManager
extends RollingStockManager<Engine>
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
Manages the engines.
-
Field Summary
FieldsFields inherited from class jmri.jmrit.operations.rollingstock.RollingStockManager
_hashTable, BY_BLOCKING, BY_BUILT, BY_COLOR, BY_COMMENT, BY_DESTINATION, BY_LAST, BY_LOCATION, BY_MOVES, BY_NUMBER, BY_OWNER, BY_RFID, BY_ROAD, BY_TRAIN, BY_TYPE, BY_VALUE, LISTLENGTH_CHANGED_PROPERTY, NONEFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(Engine engine) Unload RollingStock.getAvailableTrainList(Train train) Returns a list of available engines (no assigned train).Sort by engine consistSort by engine modelgetByTrainBlockingList(Train train) Returns a list of locos sorted by blocking number for a train.protected Comparator<Engine>getComparator(int attribute) getEngineRoadNames(String model) Get a list of engine road names.intvoidPerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidload(org.jdom2.Element root) Finds an existing engine or creates a new engine if needed requires engine's road and numbervoidprotected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidstore(org.jdom2.Element root) Create an XML element to represent this Entry.voidupdateEngineRoadComboBox(String engineModel, JComboBox<String> roadEngineBox) Methods inherited from class jmri.jmrit.operations.rollingstock.RollingStockManager
convertBuildDate, deleteAll, dispose, getByBuiltList, getByColorList, getByCommentList, getByDestinationList, getById, getByIdList, getByLastDateList, getByLastDateList, getByList, getByLocationList, getByMovesList, getByNumberList, getByOwnerList, getByRfid, getByRfidList, getByRoadAndNumber, getByRoadNameList, getByTrainList, getByTrainList, getByTypeAndRoad, getByTypeList, getByTypeList, getByValueList, getList, getList, getList, getList, getNumEntries, register, resetMoves, resetMoves, sortByTrackPriorityMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
_commentLength
int _commentLength
-
-
Constructor Details
-
EngineManager
public EngineManager()
-
-
Method Details
-
newRS
Finds an existing engine or creates a new engine if needed requires engine's road and number- Specified by:
newRSin classRollingStockManager<Engine>- Parameters:
engineRoad- The engine's road initialsengineNumber- The engine's road number- Returns:
- new engine or existing engine
-
deregister
Description copied from class:RollingStockManagerUnload RollingStock.- Overrides:
deregisterin classRollingStockManager<Engine>- Parameters:
engine- The RollingStock to delete.
-
getByModelList
Sort by engine model- Returns:
- list of engines ordered by engine model
-
getByConsistList
Sort by engine consist- Returns:
- list of engines ordered by engine consist
-
getByHpList
-
getComparator
- Overrides:
getComparatorin classRollingStockManager<Engine>
-
getAvailableTrainList
Returns a list of available engines (no assigned train). Engines are ordered by track priority and least recently moved to most recently moved.- Parameters:
train- The Train requesting this list.- Returns:
- Ordered list of engines not assigned to a train
-
getByTrainBlockingList
Returns a list of locos sorted by blocking number for a train. This returns a list of consisted locos in the order that they were entered in.- Parameters:
train- The Train requesting this list.- Returns:
- A list of sorted locos.
-
getEngineRoadNames
Get a list of engine road names.- Parameters:
model- The string model name, can be NONE.- Returns:
- List of engine road names.
-
updateEngineRoadComboBox
-
getMaxCommentLength
-
load
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-engines.dtd.- Parameters:
root- The common Element for operations-engines.dtd.
-
setDirtyAndFirePropertyChange
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classRollingStockManager<Engine>
-
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
-