Class CarRoads
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.rollingstock.RollingStockAttribute
-
- jmri.jmrit.operations.rollingstock.cars.CarRoads
-
- All Implemented Interfaces:
PropertyChangeFirer
,PropertyChangeProvider
,InstanceManagerAutoDefault
public class CarRoads extends RollingStockAttribute implements InstanceManagerAutoDefault
Represents the road names that cars can have.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CARROADS_CHANGED_PROPERTY
static java.lang.String
CARROADS_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 CarRoads()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addName(java.lang.String road)
void
deleteName(java.lang.String road)
protected java.lang.String
getDefaultNames()
int
getMaxNameLength()
Get the maximum character length of a road name when printing on a manifest or switch list.java.util.List<java.lang.String>
getNames(java.lang.String type)
Gets a sorted list of road names for a given car typevoid
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
store(org.jdom2.Element root)
Create an XML element to represent this Entry.-
Methods inherited from class jmri.jmrit.operations.rollingstock.RollingStockAttribute
containsName, dispose, getComboBox, 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
-
CARROADS_CHANGED_PROPERTY
public static final java.lang.String CARROADS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
CARROADS_NAME_CHANGED_PROPERTY
public static final java.lang.String CARROADS_NAME_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CarRoads
public CarRoads()
-
-
Method Detail
-
getDefaultNames
protected java.lang.String getDefaultNames()
- Overrides:
getDefaultNames
in classRollingStockAttribute
-
addName
public void addName(java.lang.String road)
- Overrides:
addName
in classRollingStockAttribute
-
deleteName
public void deleteName(java.lang.String road)
- Overrides:
deleteName
in classRollingStockAttribute
-
replaceName
public void replaceName(java.lang.String oldName, java.lang.String newName)
-
getMaxNameLength
public int getMaxNameLength()
Get the maximum character length of a road name when printing on a manifest or switch list. Characters after the hyphen are ignored.- Overrides:
getMaxNameLength
in classRollingStockAttribute
- Returns:
- the maximum character length of a car road name
-
getNames
public java.util.List<java.lang.String> getNames(java.lang.String type)
Gets a sorted list of road names for a given car type- Parameters:
type
- car type- Returns:
- list of road names
-
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-cars.dtd.- Parameters:
root
- The common Element for operations-cars.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)
-
-