Class EngineModels
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.rollingstock.RollingStockAttribute
-
- jmri.jmrit.operations.rollingstock.engines.EngineModels
-
- All Implemented Interfaces:
PropertyChangeFirer
,PropertyChangeProvider
public class EngineModels extends RollingStockAttribute
Represents the various engine models a railroad can have. Each model has a type, horsepower rating, length, and weight that is kept here. The program provides some default models for the user. These values can be overridden by the user.- Model Horsepower Length Weight Type
- E8 2250 70 150 Diesel
- FT 1350 50 115 Diesel
- F3 1500 50 115 Diesel
- F7 1500 50 115 Diesel
- F9 1750 50 115 Diesel
- GP20 2000 56 120 Diesel
- GP30 2250 56 130 Diesel
- GP35 2500 56 130 Diesel
- GP38 2000 59 125 Diesel
- GP40 3000 59 122 Diesel
- RS1 1000 51 124 Diesel
- RS2 1500 52 115 Diesel
- RS3 1600 51 114 Diesel
- RS11 1800 53 125 Diesel
- RS18 1800 52 118 Diesel
- RS27 2400 57 132 Diesel
- RSD4 1600 52 179 Diesel
- SD26 2650 61 164 Diesel
- SD45 3600 66 195 Diesel
- SW1200 1200 45 124 Diesel
- SW1500 1500 45 124 Diesel
- SW8 800 44 115 Diesel
- TRAINMASTER 2400 66 188 Diesel
- U28B 2800 60 126 Diesel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EngineModels.Initializer
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Hashtable<java.lang.String,java.lang.Boolean>
_engineBunitHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String>
_engineHorsepowerHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String>
_engineLengthHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String>
_engineTypeHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String>
_engineWeightHashTable
static java.lang.String
ENGINEMODELS_CHANGED_PROPERTY
static java.lang.String
ENGINEMODELS_NAME_CHANGED_PROPERTY
-
Fields inherited from class jmri.jmrit.operations.rollingstock.RollingStockAttribute
list, maxName, maxNameLength, maxNameSubStringLength, MIN_NAME_LENGTH
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description EngineModels()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addName(java.lang.String model)
void
deleteName(java.lang.String model)
void
dispose()
protected java.lang.String
getDefaultNames()
java.lang.String
getModelHorsepower(java.lang.String model)
java.lang.String
getModelLength(java.lang.String model)
java.lang.String
getModelType(java.lang.String model)
java.lang.String
getModelWeight(java.lang.String model)
boolean
isModelBunit(java.lang.String model)
void
load(org.jdom2.Element root)
void
replaceName(java.lang.String oldName, java.lang.String newName)
protected void
setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
setModelBunit(java.lang.String model, boolean bUnit)
void
setModelHorsepower(java.lang.String model, java.lang.String horsepower)
void
setModelLength(java.lang.String model, java.lang.String horsepower)
void
setModelType(java.lang.String model, java.lang.String type)
void
setModelWeight(java.lang.String model, java.lang.String type)
void
store(org.jdom2.Element root)
Create an XML element to represent this Entry.-
Methods inherited from class jmri.jmrit.operations.rollingstock.RollingStockAttribute
containsName, getComboBox, getMaxNameLength, getMaxNameSubStringLength, getMinNameLength, getNames, load, setNames, setValues, sort, store, updateComboBox
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
ENGINEMODELS_CHANGED_PROPERTY
public static final java.lang.String ENGINEMODELS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
ENGINEMODELS_NAME_CHANGED_PROPERTY
public static final java.lang.String ENGINEMODELS_NAME_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
_engineHorsepowerHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String> _engineHorsepowerHashTable
-
_engineLengthHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String> _engineLengthHashTable
-
_engineTypeHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String> _engineTypeHashTable
-
_engineWeightHashTable
protected java.util.Hashtable<java.lang.String,java.lang.String> _engineWeightHashTable
-
_engineBunitHashTable
protected java.util.Hashtable<java.lang.String,java.lang.Boolean> _engineBunitHashTable
-
-
Constructor Detail
-
EngineModels
public EngineModels()
-
-
Method Detail
-
getDefaultNames
protected java.lang.String getDefaultNames()
- Overrides:
getDefaultNames
in classRollingStockAttribute
-
dispose
public void dispose()
- Overrides:
dispose
in classRollingStockAttribute
-
addName
public void addName(java.lang.String model)
- Overrides:
addName
in classRollingStockAttribute
-
deleteName
public void deleteName(java.lang.String model)
- Overrides:
deleteName
in classRollingStockAttribute
-
replaceName
public void replaceName(java.lang.String oldName, java.lang.String newName)
-
setModelHorsepower
public void setModelHorsepower(java.lang.String model, java.lang.String horsepower)
-
getModelHorsepower
public java.lang.String getModelHorsepower(java.lang.String model)
-
setModelLength
public void setModelLength(java.lang.String model, java.lang.String horsepower)
-
getModelLength
public java.lang.String getModelLength(java.lang.String model)
-
setModelType
public void setModelType(java.lang.String model, java.lang.String type)
-
getModelType
public java.lang.String getModelType(java.lang.String model)
-
setModelBunit
public void setModelBunit(java.lang.String model, boolean bUnit)
-
isModelBunit
public boolean isModelBunit(java.lang.String model)
-
setModelWeight
public void setModelWeight(java.lang.String model, java.lang.String type)
-
getModelWeight
public java.lang.String getModelWeight(java.lang.String model)
- Parameters:
model
- The engine model (example GP20)- Returns:
- This model's weight in tons
-
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-engines.dtd.- Parameters:
root
- The common Element for operations-engines.dtd.
-
load
public void load(org.jdom2.Element root)
-
setDirtyAndFirePropertyChange
protected void setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
-