Class AbstractQualifier

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, Qualifier
    Direct Known Subclasses:
    ArithmeticQualifier

    public abstract class AbstractQualifier
    extends java.lang.Object
    implements Qualifier, java.beans.PropertyChangeListener
    Watches a specific Variable to qualify another object, e.g. another Variable or a Pane.

    The "qualifier" variable is the one being watched; its properties control whether the "qualified" Object is available or not.

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean availableStateFromEvent​(java.beans.PropertyChangeEvent e)
      Calculate whether this PropertyChangeEvent means that the qualified Object should be set Available or not.
      protected abstract boolean availableStateFromValue​(java.lang.Object value)
      Calculate whether a particular value for the qualifier Variable means that the qualified Object should be set Available or not.
      protected abstract boolean currentAvailableState()
      Retrieve the current "available" state from the qualified Object.
      abstract boolean currentDesiredState()
      Does the current value of qualifier Variable means that the qualified object should be set Available or not?
      VariableValue getWatchedVariable()  
      (package private) void processValueChangeEvent​(java.beans.PropertyChangeEvent e)
      Process Value property change from the qualifier Variable (one being watched).
      void propertyChange​(java.beans.PropertyChangeEvent e)
      Process property change from the qualifier Variable (one being watched).
      abstract void setWatchedAvailable​(boolean enable)
      Drive the available or not state of the qualified Object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Process property change from the qualifier Variable (one being watched).

        Follows changes "Value" property, which it assumes is an Integer.

        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Parameters:
        e - The event that triggered the query
      • processValueChangeEvent

        void processValueChangeEvent​(java.beans.PropertyChangeEvent e)
        Process Value property change from the qualifier Variable (one being watched).
        Parameters:
        e - The event that triggered the query
      • availableStateFromEvent

        protected boolean availableStateFromEvent​(java.beans.PropertyChangeEvent e)
        Calculate whether this PropertyChangeEvent means that the qualified Object should be set Available or not.
        Parameters:
        e - The event that triggered the query
        Returns:
        true if should be set available
      • currentAvailableState

        protected abstract boolean currentAvailableState()
        Retrieve the current "available" state from the qualified Object.
        Returns:
        true if available
      • currentDesiredState

        public abstract boolean currentDesiredState()
        Does the current value of qualifier Variable means that the qualified object should be set Available or not?
        Specified by:
        currentDesiredState in interface Qualifier
        Returns:
        true if should be set available
      • availableStateFromValue

        protected abstract boolean availableStateFromValue​(java.lang.Object value)
        Calculate whether a particular value for the qualifier Variable means that the qualified Object should be set Available or not.
        Parameters:
        value - base for the calculation
        Returns:
        true if should be set available
      • setWatchedAvailable

        public abstract void setWatchedAvailable​(boolean enable)
        Drive the available or not state of the qualified Object.

        Subclasses implement this to control a specific type of qualified Object, like a Variable or Pane.

        Specified by:
        setWatchedAvailable in interface Qualifier
        Parameters:
        enable - true if should be enabled