|
||||||||||
| 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
jmri.jmrit.symbolicprog.CompositeVariableValue
public class CompositeVariableValue
Extends EnumVariableValue to represent a composition of variable values.
Internally, each "choice" is stored as a list of "setting" items. Numerical values for this type of variable (itself) are strictly sequential, because they are arbitrary.
This version of the class has certain limitations:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrit.symbolicprog.EnumVariableValue |
|---|
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 | |
|---|---|
CompositeVariableValue()
Create a null object. |
|
CompositeVariableValue(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 |
addChoice(String name)
Create a new possible selection. |
void |
addSetting(String choice,
String varName,
VariableValue variable,
String value)
Add a setting to an existing choice. |
protected void |
continueRead()
See if there's anything to read, and if so do it. |
protected void |
continueWrite()
See if there's anything to write, and if so do it. |
void |
dispose()
|
Component |
getCommonRep()
|
int |
getIntValue()
Get the value as a single number. |
boolean |
isChanged()
Determine whether this Variable is "changed", so that "read changes" and "write changes" will act on it. |
boolean |
isToRead()
This variable needs to be read if any of it's subsidiary variables needs to be read. |
boolean |
isToWrite()
This variable needs to be written if any of it's subsidiary variables needs to be written. |
void |
lastItem()
Do end of initialization processing. |
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 |
setCvState(int state)
Notify the connected CVs of a state change from above by way of the variables (e.g. not direct to CVs) |
void |
setState(int state)
This variable doesn't change state, hence doesn't change color. |
void |
setToolTipText(String t)
Set tooltip text to be used by both the "value" and representations of this Variable. |
void |
setToRead(boolean state)
Simple implementation for the case of a single CV. |
void |
setToWrite(boolean state)
Simple implementation for the case of a single CV. |
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.EnumVariableValue |
|---|
addItem, addItem, getNewRep, getTextValue, getValueObject, getValueString, nItems, setAvailable, setIntValue |
| Methods inherited from class jmri.jmrit.symbolicprog.VariableValue |
|---|
confirmAll, considerChanged, cvName, getComment, getCvNum, getInfoOnly, getMask, getOpsOnly, getReadOnly, getState, getWriteOnly, isBusy, item, label, maskVal, newValue, offsetVal, setBusy, 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 CompositeVariableValue(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 CompositeVariableValue()
| Method Detail |
|---|
public CvValue[] usesCVs()
VariableValue
usesCVs in class EnumVariableValuepublic void addChoice(String name)
name - Name of the choice being added
public void addSetting(String choice,
String varName,
VariableValue variable,
String value)
public void lastItem()
lastItem in class EnumVariableValuepublic void setToolTipText(String t)
VariableValueThis is expected to be overridden in subclasses to change their internal info.
setToolTipText in class EnumVariableValueVariableValue.updateRepresentation(javax.swing.JComponent)public Object rangeVal()
rangeVal in class EnumVariableValuepublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListeneractionPerformed in class EnumVariableValuepublic void setState(int state)
setState in class VariableValueprotected void selectValue(int value)
Does this by delegating to the SettingList
selectValue in class EnumVariableValuevalue - public int getIntValue()
VariableValue
getIntValue in class EnumVariableValuepublic Component getCommonRep()
getCommonRep in class EnumVariableValuepublic void setValue(int value)
setValue in class EnumVariableValuepublic void setCvState(int state)
setCvState in class EnumVariableValuestate - public boolean isChanged()
VariableValue
isChanged in class EnumVariableValueVariableValue.considerChanged(jmri.jmrit.symbolicprog.CvValue)public void setToRead(boolean state)
VariableValue
setToRead in class VariableValuepublic boolean isToRead()
isToRead in class VariableValuepublic void setToWrite(boolean state)
VariableValue
setToWrite in class VariableValuepublic boolean isToWrite()
isToWrite in class VariableValuepublic void readChanges()
VariableValue
readChanges in class EnumVariableValueVariableValue.isChanged()public void writeChanges()
VariableValue
writeChanges in class EnumVariableValueVariableValue.isChanged()public void readAll()
VariableValue
readAll in class EnumVariableValueprotected void continueRead()
public void writeAll()
VariableValue
writeAll in class EnumVariableValueprotected void continueWrite()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpropertyChange in class EnumVariableValuepublic void dispose()
dispose in class EnumVariableValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||