Package gov.nasa.worldwind.animation
Class BasicAnimator
- java.lang.Object
-
- gov.nasa.worldwind.animation.BasicAnimator
-
- All Implemented Interfaces:
Animator
- Direct Known Subclasses:
AngleAnimator,CompoundAnimator,DoubleAnimator,KeepingObjectsInView.ViewAnimator,PositionAnimator
public class BasicAnimator extends java.lang.Object implements Animator
A base class for an interpolatingAnimator.
-
-
Field Summary
Fields Modifier and Type Field Description protected InterpolatorinterpolatorUsed to drive the animators next value based on the interpolant returned by theInterpolator's next interpolant
-
Constructor Summary
Constructors Constructor Description BasicAnimator()Constructs aBasicAnimator.BasicAnimator(Interpolator interpolator)Constructs aBasicAnimator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidflagLastStateInvalid()booleanhasNext()Returnstrueif theAnimatorhas more elements.protected booleanisLastStateValid()booleanisStopOnInvalidState()voidnext()Calls thesetmethod with the nextinterpolantas determined by theinterpolatormember.voidset(double interpolant)Calls the setImpl method with the interpolant value.protected voidsetImpl(double interpolant)No-op intended to be overrided by deriving classes.voidsetStopOnInvalidState(boolean stop)voidstart()Starts theAnimator,hasNextwill now returntruevoidstop()Stops theAnimator,hasNextwill now returnfalse
-
-
-
Field Detail
-
interpolator
protected Interpolator interpolator
Used to drive the animators next value based on the interpolant returned by theInterpolator's next interpolant
-
-
Constructor Detail
-
BasicAnimator
public BasicAnimator()
Constructs aBasicAnimator. Sets theAnimator'sInterpolatortonull.
-
BasicAnimator
public BasicAnimator(Interpolator interpolator)
Constructs aBasicAnimator. Thenextmethod will use the passedInterpolatorto retrieve theinterpolant- Parameters:
interpolator- TheInterpolatorto be used to get the interpolant for setting the next value.
-
-
Method Detail
-
next
public void next()
Calls thesetmethod with the nextinterpolantas determined by theinterpolatormember.
-
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 thiersetImplmethod.
-
hasNext
public boolean hasNext()
Returnstrueif theAnimatorhas more elements.
-
start
public void start()
Starts theAnimator,hasNextwill now returntrue
-
stop
public void stop()
Stops theAnimator,hasNextwill now returnfalse
-
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()
-
-