Class CarLoads
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.rollingstock.RollingStockAttribute
jmri.jmrit.operations.rollingstock.cars.CarLoads
- All Implemented Interfaces:
PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault
Represents the loads that cars can have.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String(package private) intstatic final StringFields inherited from class jmri.jmrit.operations.rollingstock.RollingStockAttribute
list, maxName, maxNameLength, maxNameSubStringLength, MIN_NAME_LENGTHFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a load name for the car type.voidAdd a car type with specific loadsbooleancontainsName(String type, String name) Determines if a car type can have a specific load name.voiddeleteName(String type, String name) voiddispose()getComboBox(String type) Gets the appropriate car loads for the car's type.getDropComment(String type, String name) getList()getLoadType(String type, String name) Get the load type, empty or load.Gets a ComboBox with the available load types: empty and loadintintGets a sorted list of load names for a given car typegetPickupComment(String type, String name) getPriority(String type, String name) Get's a load's priority.Gets a ComboBox with the available prioritiesgetSelectComboBox(String type) Gets the appropriate car loads for the car's type.booleanisHazardous(String type, String name) voidload(org.jdom2.Element e) voidreplaceName(String type, String oldName, String newName) voidreplaceType(String oldType, String newType) Replace a car type.voidsetDefaultEmptyName(String name) voidsetDefaultLoadName(String name) protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidsetDropComment(String type, String name, String comment) voidsetHazardous(String type, String name, boolean isHazardous) voidsetLoadType(String type, String name, String loadType) Sets the load type, empty or load.voidsetPickupComment(String type, String name, String comment) Sets the comment for a car type's loadvoidsetPriority(String type, String name, String priority) Sets a loads priority.voidstore(org.jdom2.Element root) Create an XML element to represent this Entry.voidupdateComboBox(String type, JComboBox<String> box) voidupdateComboBox(JComboBox<String> box) Update a JComboBox with all load names for every type of car.voidupdateRweComboBox(String type, JComboBox<String> box) voidupdateRwlComboBox(String type, JComboBox<String> box) Methods inherited from class jmri.jmrit.operations.rollingstock.RollingStockAttribute
addName, containsName, deleteName, getComboBox, getDefaultNames, getMaxNameSubStringLength, getMinNameLength, getNames, load, setNames, setValues, sort, storeMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
listCarLoads
-
_emptyName
-
_loadName
-
NONE
- See Also:
-
LOAD_CHANGED_PROPERTY
- See Also:
-
LOAD_TYPE_CHANGED_PROPERTY
- See Also:
-
LOAD_PRIORITY_CHANGED_PROPERTY
- See Also:
-
LOAD_NAME_CHANGED_PROPERTY
- See Also:
-
LOAD_COMMENT_CHANGED_PROPERTY
- See Also:
-
LOAD_HAZARDOUS_CHANGED_PROPERTY
- See Also:
-
maxCommentLength
int maxCommentLength
-
-
Constructor Details
-
CarLoads
public CarLoads()
-
-
Method Details
-
addType
Add a car type with specific loads- Parameters:
type- car type
-
replaceType
Replace a car type. Transfers load type, priority, isHardous, drop and load comments.- Parameters:
oldType- old car typenewType- new car type
-
getSelectComboBox
Gets the appropriate car loads for the car's type.- Parameters:
type- Car type- Returns:
- JComboBox with car loads starting with empty string.
-
getComboBox
Gets the appropriate car loads for the car's type.- Parameters:
type- Car type- Returns:
- JComboBox with car loads.
-
getPriorityComboBox
Gets a ComboBox with the available priorities- Returns:
- JComboBox with car priorities.
-
getHazardousComboBox
-
getLoadTypesComboBox
Gets a ComboBox with the available load types: empty and load- Returns:
- JComboBox with load types: LOAD_TYPE_EMPTY and LOAD_TYPE_LOAD
-
getNames
Gets a sorted list of load names for a given car type- Parameters:
type- car type- Returns:
- list of load names
-
addName
Add a load name for the car type.- Parameters:
type- car type.name- load name.
-
deleteName
-
containsName
Determines if a car type can have a specific load name.- Parameters:
type- car type.name- load name.- Returns:
- true if car can have this load name.
-
updateComboBox
-
updateComboBox
Update a JComboBox with all load names for every type of car.- Overrides:
updateComboBoxin classRollingStockAttribute- Parameters:
box- the combo box to update
-
updateRweComboBox
-
updateRwlComboBox
-
replaceName
-
getDefaultLoadName
-
setDefaultLoadName
-
getDefaultEmptyName
-
setDefaultEmptyName
-
setLoadType
Sets the load type, empty or load.- Parameters:
type- car type.name- load name.loadType- load type: LOAD_TYPE_EMPTY or LOAD_TYPE_LOAD.
-
getLoadType
Get the load type, empty or load.- Parameters:
type- car type.name- load name.- Returns:
- load type, LOAD_TYPE_EMPTY or LOAD_TYPE_LOAD.
-
setPriority
Sets a loads priority.- Parameters:
type- car type.name- load name.priority- load priority, PRIORITY_LOW, PRIORITY_MEDIUM or PRIORITY_HIGH.
-
getPriority
Get's a load's priority.- Parameters:
type- car type.name- load name.- Returns:
- load priority, PRIORITY_LOW, PRIORITY_MEDIUM or PRIORITY_HIGH.
-
setHazardous
-
isHazardous
-
setPickupComment
Sets the comment for a car type's load- Parameters:
type- the car typename- the load namecomment- the comment
-
getPickupComment
-
setDropComment
-
getDropComment
-
getMaxNameLength
- Overrides:
getMaxNameLengthin classRollingStockAttribute
-
getMaxLoadCommentLength
-
getList
-
dispose
- Overrides:
disposein classRollingStockAttribute
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-cars.dtd.- Parameters:
root- The common Element for operations-cars.dtd.
-
load
-
setDirtyAndFirePropertyChange
-