|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.symbolicprog.AbstractValue
jmri.jmrit.symbolicprog.VariableValue
jmri.jmrit.symbolicprog.EnumVariableValue
public class EnumVariableValue
Extends VariableValue to represent a enumerated variable.
| Nested Class Summary | |
|---|---|
class |
EnumVariableValue.VarComboBox
|
| Field Summary |
|---|
| Fields inherited from class jmri.jmrit.symbolicprog.VariableValue |
|---|
_cvVector, _status, _tooltipText |
| Fields inherited from class jmri.jmrit.symbolicprog.AbstractValue |
|---|
DIFF, EDITED, FROMFILE, READ, SAME, STORED, UNKNOWN |
| Constructor Summary | |
|---|---|
EnumVariableValue()
Create a null object. |
|
EnumVariableValue(String name,
String comment,
String cvName,
boolean readOnly,
boolean infoOnly,
boolean writeOnly,
boolean opsOnly,
int cvNum,
String mask,
int minVal,
int maxVal,
Vector<CvValue> v,
JLabel status,
String stdname)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addItem(String s)
Create a new item in the enumeration, with an associated value one more than the last item (or zero if this is the first one added) |
void |
addItem(String s,
int value)
Create a new item in the enumeration, with a specified associated value. |
void |
dispose()
|
Component |
getCommonRep()
|
int |
getIntValue()
Get the value as a single number. |
Component |
getNewRep(String format)
|
String |
getTextValue()
|
Object |
getValueObject()
|
String |
getValueString()
|
boolean |
isChanged()
Determine whether this Variable is "changed", so that "read changes" and "write changes" will act on it. |
void |
lastItem()
|
void |
nItems(int n)
|
void |
propertyChange(PropertyChangeEvent e)
|
Object |
rangeVal()
|
void |
readAll()
Always read the contents of this Variable |
void |
readChanges()
Read the contents of this Variable if it's in a state that indicates it was "changed" |
protected void |
selectValue(int value)
Set to a specific value. |
void |
setAvailable(boolean a)
|
void |
setCvState(int state)
Notify the connected CVs of a state change from above |
void |
setIntValue(int i)
Set the value from a single number. |
void |
setToolTipText(String t)
Set tooltip text to be used by both the "value" and representations of this Variable. |
void |
setValue(int value)
|
CvValue[] |
usesCVs()
Provide access to CVs referenced by this operation |
void |
writeAll()
Always write the contents of this Variable |
void |
writeChanges()
Write the contents of this Variable if it's in a state that indicates it was "changed" |
| Methods inherited from class jmri.jmrit.symbolicprog.VariableValue |
|---|
confirmAll, considerChanged, cvName, getComment, getCvNum, getInfoOnly, getMask, getOpsOnly, getReadOnly, getState, getWriteOnly, isBusy, isToRead, isToWrite, item, label, maskVal, newValue, offsetVal, setBusy, setState, setToRead, setToWrite, updateRepresentation |
| Methods inherited from class jmri.jmrit.symbolicprog.AbstractValue |
|---|
addPropertyChangeListener, getAvailable, removePropertyChangeListener, stateNameFromValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnumVariableValue(String name,
String comment,
String cvName,
boolean readOnly,
boolean infoOnly,
boolean writeOnly,
boolean opsOnly,
int cvNum,
String mask,
int minVal,
int maxVal,
Vector<CvValue> v,
JLabel status,
String stdname)
public EnumVariableValue()
| Method Detail |
|---|
public CvValue[] usesCVs()
VariableValue
usesCVs in class VariableValuepublic void nItems(int n)
public void addItem(String s)
s - Name of the enumeration item
public void addItem(String s,
int value)
s - Name of the enumeration itempublic void lastItem()
public void setToolTipText(String t)
VariableValueThis is expected to be overridden in subclasses to change their internal info.
setToolTipText in class VariableValueVariableValue.updateRepresentation(javax.swing.JComponent)public void setAvailable(boolean a)
setAvailable in class AbstractValuepublic Object rangeVal()
rangeVal in class VariableValuepublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic String getValueString()
getValueString in class VariableValuepublic void setIntValue(int i)
VariableValue
setIntValue in class VariableValuepublic String getTextValue()
getTextValue in class VariableValuepublic Object getValueObject()
getValueObject in class VariableValueprotected void selectValue(int value)
This searches for the displayed value, and sets the enum to that particular one. It used to work off an index, but now it looks for the value.
If the value is larger than any defined, a new one is created.
value - public int getIntValue()
VariableValue
getIntValue in class VariableValuepublic Component getCommonRep()
getCommonRep in class VariableValuepublic void setValue(int value)
public Component getNewRep(String format)
getNewRep in class VariableValuepublic void setCvState(int state)
setCvState in class VariableValuestate - public boolean isChanged()
VariableValue
isChanged in class VariableValueVariableValue.considerChanged(jmri.jmrit.symbolicprog.CvValue)public void readChanges()
VariableValue
readChanges in class VariableValueVariableValue.isChanged()public void writeChanges()
VariableValue
writeChanges in class VariableValueVariableValue.isChanged()public void readAll()
VariableValue
readAll in class VariableValuepublic void writeAll()
VariableValue
writeAll in class VariableValuepublic void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpropertyChange in class VariableValuepublic void dispose()
dispose in class VariableValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||