|
||||||||||
| 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
public abstract class VariableValue
Represents a single Variable value; abstract base class.
The "changed" parameter (non-bound, accessed via isChanged) indicates whether a "write changes" or "read changes" operation should handle this object.
| Field Summary | |
|---|---|
protected Vector<CvValue> |
_cvVector
|
protected JLabel |
_status
|
protected String |
_tooltipText
|
| Fields inherited from class jmri.jmrit.symbolicprog.AbstractValue |
|---|
DIFF, EDITED, FROMFILE, READ, SAME, STORED, UNKNOWN |
| Constructor Summary | |
|---|---|
protected |
VariableValue()
Create a null object. |
|
VariableValue(String label,
String comment,
String cvName,
boolean readOnly,
boolean infoOnly,
boolean writeOnly,
boolean opsOnly,
int cvNum,
String mask,
Vector<CvValue> v,
JLabel status,
String item)
|
| Method Summary | |
|---|---|
void |
confirmAll()
Confirm the contents of this Variable |
static boolean |
considerChanged(CvValue c)
Default implementation for subclasses to tell if a CV meets a common definition of "changed". |
String |
cvName()
|
abstract void |
dispose()
|
String |
getComment()
|
abstract Component |
getCommonRep()
|
int |
getCvNum()
|
boolean |
getInfoOnly()
|
abstract int |
getIntValue()
Get the value as a single number. |
String |
getMask()
|
abstract Component |
getNewRep(String format)
|
boolean |
getOpsOnly()
|
boolean |
getReadOnly()
|
int |
getState()
|
String |
getTextValue()
|
abstract Object |
getValueObject()
|
abstract String |
getValueString()
|
boolean |
getWriteOnly()
|
boolean |
isBusy()
A variable is busy during read, write operations |
abstract boolean |
isChanged()
Determine whether this Variable is "changed", so that "read changes" and "write changes" will act on it. |
boolean |
isToRead()
Simple implementation for the case of a single CV. |
boolean |
isToWrite()
Simple implementation for the case of a single CV. |
String |
item()
|
String |
label()
|
protected int |
maskVal(String maskString)
|
protected int |
newValue(int oldCv,
int newVal,
String maskString)
|
protected int |
offsetVal(String maskString)
Find number of places to shift a value left to align if with a mask. |
abstract void |
propertyChange(PropertyChangeEvent e)
|
abstract Object |
rangeVal()
|
abstract void |
readAll()
Always read the contents of this Variable |
abstract void |
readChanges()
Read the contents of this Variable if it's in a state that indicates it was "changed" |
protected void |
setBusy(boolean newBusy)
|
abstract void |
setCvState(int state)
Propogate a state change here to the CVs that are related, which will in turn propagate back to here |
abstract void |
setIntValue(int i)
Set the value from a single number. |
void |
setState(int state)
|
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. |
protected JComponent |
updateRepresentation(JComponent c)
Add the proper tooltip text to a graphical rep before returning it, sets the visibility |
abstract CvValue[] |
usesCVs()
Provide access to CVs referenced by this operation |
abstract void |
writeAll()
Always write the contents of this Variable |
abstract 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.AbstractValue |
|---|
addPropertyChangeListener, getAvailable, removePropertyChangeListener, setAvailable, stateNameFromValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Vector<CvValue> _cvVector
protected JLabel _status
protected String _tooltipText
| Constructor Detail |
|---|
public VariableValue(String label,
String comment,
String cvName,
boolean readOnly,
boolean infoOnly,
boolean writeOnly,
boolean opsOnly,
int cvNum,
String mask,
Vector<CvValue> v,
JLabel status,
String item)
protected VariableValue()
| Method Detail |
|---|
public abstract Component getCommonRep()
public abstract Component getNewRep(String format)
public abstract String getValueString()
public abstract Object getValueObject()
public String getTextValue()
public abstract void setIntValue(int i)
public abstract int getIntValue()
public abstract void readAll()
public abstract void writeAll()
public void confirmAll()
public abstract void readChanges()
isChanged()public abstract void writeChanges()
isChanged()public abstract boolean isChanged()
considerChanged(jmri.jmrit.symbolicprog.CvValue)public static boolean considerChanged(CvValue c)
c - CV to be examined
public abstract void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic abstract void dispose()
public abstract Object rangeVal()
public String label()
public String item()
public String cvName()
public void setToolTipText(String t)
This is expected to be overridden in subclasses to change their internal info.
t - updateRepresentation(javax.swing.JComponent)protected JComponent updateRepresentation(JComponent c)
c - public String getComment()
public boolean getReadOnly()
public boolean getInfoOnly()
public boolean getWriteOnly()
public boolean getOpsOnly()
public int getCvNum()
public String getMask()
public int getState()
public void setState(int state)
public void setToRead(boolean state)
setToRead in class AbstractValuepublic boolean isToRead()
isToRead in class AbstractValuepublic void setToWrite(boolean state)
setToWrite in class AbstractValuepublic boolean isToWrite()
isToWrite in class AbstractValuepublic abstract void setCvState(int state)
public boolean isBusy()
protected void setBusy(boolean newBusy)
protected int maskVal(String maskString)
protected int offsetVal(String maskString)
protected int newValue(int oldCv,
int newVal,
String maskString)
oldCv - Value of the CV before this update is appliednewVal - Value for this variable (e.g. not the CV value)maskString - The bit mask for this variable in character form
public abstract CvValue[] usesCVs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||