NASA World Wind

gov.nasa.worldwind.animation
Class BasicAnimator

java.lang.Object
  extended by gov.nasa.worldwind.animation.BasicAnimator
All Implemented Interfaces:
Animator
Direct Known Subclasses:
AngleAnimator, CompoundAnimator, DoubleAnimator, KeepingObjectsInView.ViewAnimator, PositionAnimator

public class BasicAnimator
extends Object
implements Animator

A base class for an interpolating Animator.


Field Summary
protected  Interpolator interpolator
          Used to drive the animators next value based on the interpolant returned by the Interpolator's next interpolant
 
Constructor Summary
BasicAnimator()
          Constructs a BasicAnimator.
BasicAnimator(Interpolator interpolator)
          Constructs a BasicAnimator.
 
Method Summary
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, finalize, 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

flagLastStateInvalid

protected void flagLastStateInvalid()

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

isLastStateValid

protected boolean isLastStateValid()

isStopOnInvalidState

public boolean isStopOnInvalidState()

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.

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)

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

NASA World Wind