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 Interpolator
interpolator
Used 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 void
flagLastStateInvalid()
boolean
hasNext()
Returnstrue
if theAnimator
has more elements.protected boolean
isLastStateValid()
boolean
isStopOnInvalidState()
void
next()
Calls theset
method with the nextinterpolant
as determined by theinterpolator
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 theAnimator
,hasNext
will now returntrue
void
stop()
Stops theAnimator
,hasNext
will 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
'sInterpolator
tonull
.
-
BasicAnimator
public BasicAnimator(Interpolator interpolator)
Constructs aBasicAnimator
. Thenext
method will use the passedInterpolator
to retrieve theinterpolant
- Parameters:
interpolator
- TheInterpolator
to be used to get the interpolant for setting the next value.
-
-
Method Detail
-
next
public void next()
Calls theset
method with the nextinterpolant
as determined by theinterpolator
member.
-
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 thiersetImpl
method.
-
hasNext
public boolean hasNext()
Returnstrue
if theAnimator
has more elements.
-
start
public void start()
Starts theAnimator
,hasNext
will now returntrue
-
stop
public void stop()
Stops theAnimator
,hasNext
will 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()
-
-