Class RollingStockAttribute
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.rollingstock.RollingStockAttribute
-
- All Implemented Interfaces:
PropertyChangeFirer
,PropertyChangeProvider
- Direct Known Subclasses:
CarColors
,CarLengths
,CarLoads
,CarOwners
,CarRoads
,CarTypes
,EngineLengths
,EngineModels
,EngineTypes
public abstract class RollingStockAttribute extends PropertyChangeSupport
Represents an attribute a rolling stock can have. Some attributes are length, color, type, load, road, owner, model etc.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>
list
protected java.lang.String
maxName
protected int
maxNameLength
protected int
maxNameSubStringLength
protected static int
MIN_NAME_LENGTH
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description RollingStockAttribute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addName(java.lang.String name)
boolean
containsName(java.lang.String name)
void
deleteName(java.lang.String name)
void
dispose()
javax.swing.JComboBox<java.lang.String>
getComboBox()
protected java.lang.String
getDefaultNames()
int
getMaxNameLength()
int
getMaxNameSubStringLength()
protected int
getMinNameLength()
java.lang.String[]
getNames()
void
load(org.jdom2.Element root, java.lang.String eNames, java.lang.String eName, java.lang.String oldName)
void
setNames(java.lang.String[] names)
void
setValues(java.lang.String[] lengths)
Performs number sort before adding to listvoid
sort()
void
store(org.jdom2.Element root, java.lang.String eNames, java.lang.String eName)
Create an XML element to represent this Entry.void
updateComboBox(javax.swing.JComboBox<java.lang.String> box)
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
MIN_NAME_LENGTH
protected static final int MIN_NAME_LENGTH
- See Also:
- Constant Field Values
-
list
protected java.util.List<java.lang.String> list
-
maxName
protected java.lang.String maxName
-
maxNameLength
protected int maxNameLength
-
maxNameSubStringLength
protected int maxNameSubStringLength
-
-
Constructor Detail
-
RollingStockAttribute
public RollingStockAttribute()
-
-
Method Detail
-
dispose
public void dispose()
-
getNames
public java.lang.String[] getNames()
-
getDefaultNames
protected java.lang.String getDefaultNames()
-
setNames
public void setNames(java.lang.String[] names)
-
setValues
public void setValues(java.lang.String[] lengths)
Performs number sort before adding to list- Parameters:
lengths
- The set of strings to be ordered.
-
sort
public void sort()
-
addName
public void addName(java.lang.String name)
-
deleteName
public void deleteName(java.lang.String name)
-
containsName
public boolean containsName(java.lang.String name)
-
getComboBox
public javax.swing.JComboBox<java.lang.String> getComboBox()
-
updateComboBox
public void updateComboBox(javax.swing.JComboBox<java.lang.String> box)
-
getMaxNameLength
public int getMaxNameLength()
-
getMaxNameSubStringLength
public int getMaxNameSubStringLength()
-
getMinNameLength
protected int getMinNameLength()
-
store
public void store(org.jdom2.Element root, java.lang.String eNames, java.lang.String eName)
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-cars.dtd and operations-engines.dtd.- Parameters:
root
- Common Element for storage.eNames
- New format Element group nameeName
- New format Element name
-
load
public void load(org.jdom2.Element root, java.lang.String eNames, java.lang.String eName, java.lang.String oldName)
-
-