Class BasicAnimator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Interpolator interpolator
      Used to drive the animators next value based on the interpolant returned by the Interpolator's next interpolant
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void flagLastStateInvalid()  
      boolean hasNext()
      Returns true if the Animator has more elements.
      protected boolean isLastStateValid()  
      boolean isStopOnInvalidState()  
      void next()
      Calls the set method with the next interpolant as determined by the interpolator member.
      void set​(double interpolant)
      Calls the setImpl method with the interpolant value.
      protected void setImpl​(double interpolant)
      No-op intended to be overrided by deriving classes.
      void setStopOnInvalidState​(boolean stop)  
      void start()
      Starts the Animator, hasNext will now return true
      void stop()
      Stops the Animator, hasNext will now return false
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • interpolator

        protected Interpolator interpolator
        Used to drive the animators next value based on the interpolant returned by the Interpolator's next interpolant
    • Constructor Detail

      • BasicAnimator

        public BasicAnimator()
        Constructs a BasicAnimator. Sets the Animator's Interpolator to null.
      • BasicAnimator

        public BasicAnimator​(Interpolator interpolator)
        Constructs a BasicAnimator. The next method will use the passed Interpolator to retrieve the interpolant
        Parameters:
        interpolator - The Interpolator to be used to get the interpolant for setting the next value.
    • Method Detail

      • next

        public void next()
        Calls the set method with the next interpolant as determined by the interpolator member.
        Specified by:
        next in interface Animator
      • set

        public void set​(double interpolant)
        Calls the setImpl method with the interpolant value. Deriving classes are expected to implement the desired action of a set operation in thier setImpl method.
        Specified by:
        set in interface Animator
        Parameters:
        interpolant - A value between 0 and 1.
      • hasNext

        public boolean hasNext()
        Returns true if the Animator has more elements.
        Specified by:
        hasNext in interface Animator
        Returns:
        true if the Animator has more elements
      • start

        public void start()
        Starts the Animator, hasNext will now return true
        Specified by:
        start in interface Animator
      • stop

        public void stop()
        Stops the Animator, hasNext will now return false
        Specified by:
        stop in interface Animator
      • setImpl

        protected void setImpl​(double interpolant)
        No-op intended to be overrided by deriving classes. Deriving classes are expected to implement the desired action of a set operation in this method.
        Parameters:
        interpolant - A value between 0 and 1.
      • setStopOnInvalidState

        public void setStopOnInvalidState​(boolean stop)
      • isStopOnInvalidState

        public boolean isStopOnInvalidState()
      • flagLastStateInvalid

        protected void flagLastStateInvalid()
      • isLastStateValid

        protected boolean isLastStateValid()