Package jmri.jmrit.symbolicprog
Class AbstractValue
java.lang.Object
jmri.jmrit.symbolicprog.AbstractValue
- Direct Known Subclasses:
CvValue,VariableValue
Define common base class methods for CvValue and VariableValue classes
The ToRead parameter (boolean, unbound) is used to remember whether this object has been read during a "read all" operation. This allows removal of duplicate operations.
The ToWrite parameter (boolean, unbound) is used to remember whether this object has been written during a "write all" operation. This allows removal of duplicate operations.
The Available parameter (boolean, unbound) remembers whether the variable should be displayed, programmed, etc.
Represents a single CV value
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanGets the current availability status of the object.booleanisToRead()Ask whether this object needs to be read.booleanAsk whether this object needs to be written.voidvoidsetAvailable(boolean avail) Sets the availability status of the object.(package private) abstract voidMethod to handle color changes for states.voidsetToRead(boolean state) Mark whether this object needs to be read.voidsetToWrite(boolean state) Mark whether this object needs to be written.
-
Field Details
-
prop
-
-
Constructor Details
-
AbstractValue
public AbstractValue()
-
-
Method Details
-
setColor
Method to handle color changes for states.- Parameters:
c- the desired colour
-
setToRead
Mark whether this object needs to be read.- Parameters:
state- true if the object needs to be read, false otherwise- See Also:
-
isToRead
Ask whether this object needs to be read.- Returns:
- true if the object needs to be read, false otherwise
- See Also:
-
setToWrite
Mark whether this object needs to be written.- Parameters:
state- true if the object needs to be written, false otherwise- See Also:
-
isToWrite
Ask whether this object needs to be written.- Returns:
- true if the object needs to be written, false otherwise
- See Also:
-
setAvailable
Sets the availability status of the object.- Parameters:
avail-trueif the object should be made available,falseif should be made unavailable
-
getAvailable
Gets the current availability status of the object.Code can use this to determine whether to set object visibility (or other properties).
- Returns:
trueif the object should be available,falseif it should be unavailable
-
addPropertyChangeListener
- Parameters:
p- the listener to be added to the object
-
removePropertyChangeListener
- Parameters:
p- the listener to be removed from the object
-