Package jmri.jmrit.symbolicprog
Class AbstractValue
- java.lang.Object
-
- jmri.jmrit.symbolicprog.AbstractValue
-
- Direct Known Subclasses:
CvValue,VariableValue
public abstract class AbstractValue extends java.lang.Object
Define common base class methods for CvValue and VariableValue classesThe 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 Modifier and Type Class Description static classAbstractValue.ValueState
-
Field Summary
Fields Modifier and Type Field Description (package private) java.beans.PropertyChangeSupportprop
-
Constructor Summary
Constructors Constructor Description AbstractValue()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener p)booleangetAvailable()Gets the current availability status of the object.booleanisToRead()Ask whether this object needs to be read.booleanisToWrite()Ask whether this object needs to be written.voidremovePropertyChangeListener(java.beans.PropertyChangeListener p)voidsetAvailable(boolean avail)Sets the availability status of the object.(package private) abstract voidsetColor(java.awt.Color c)Method 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 Detail
-
prop
java.beans.PropertyChangeSupport prop
-
-
Constructor Detail
-
AbstractValue
public AbstractValue()
-
-
Method Detail
-
setColor
abstract void setColor(java.awt.Color c)
Method to handle color changes for states.- Parameters:
c- the desired colour
-
setToRead
public void setToRead(boolean state)
Mark whether this object needs to be read.- Parameters:
state- true if the object needs to be read, false otherwise- See Also:
AbstractValue
-
isToRead
public boolean isToRead()
Ask whether this object needs to be read.- Returns:
- true if the object needs to be read, false otherwise
- See Also:
AbstractValue
-
setToWrite
public void setToWrite(boolean state)
Mark whether this object needs to be written.- Parameters:
state- true if the object needs to be written, false otherwise- See Also:
AbstractValue
-
isToWrite
public boolean isToWrite()
Ask whether this object needs to be written.- Returns:
- true if the object needs to be written, false otherwise
- See Also:
AbstractValue
-
setAvailable
public void setAvailable(boolean avail)
Sets the availability status of the object.- Parameters:
avail-trueif the object should be made available,falseif should be made unavailable
-
getAvailable
public boolean 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
public void addPropertyChangeListener(java.beans.PropertyChangeListener p)
- Parameters:
p- the listener to be added to the object
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener p)
- Parameters:
p- the listener to be removed from the object
-
-