Class AbstractValue

java.lang.Object
jmri.jmrit.symbolicprog.AbstractValue
Direct Known Subclasses:
CvValue, VariableValue

public abstract class AbstractValue extends Object
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

  • Field Details

  • Constructor Details

  • Method Details

    • setColor

      abstract void setColor(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:
    • 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:
    • 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:
    • 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:
    • setAvailable

      public void setAvailable(boolean avail)
      Sets the availability status of the object.
      Parameters:
      avail - true if the object should be made available, false if 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:
      true if the object should be available, false if 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