public class BasicAnimator extends java.lang.Object implements Animator
Animator
.Modifier and Type | Field and Description |
---|---|
protected Interpolator |
interpolator
Used to drive the animators next value based on the interpolant returned by the
Interpolator 's next interpolant |
Constructor and Description |
---|
BasicAnimator()
Constructs a
BasicAnimator . |
BasicAnimator(Interpolator interpolator)
Constructs a
BasicAnimator . |
Modifier and Type | Method and 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 |
protected Interpolator interpolator
Interpolator
's next interpolantpublic BasicAnimator()
BasicAnimator
. Sets the Animator
's Interpolator
to
null
.public BasicAnimator(Interpolator interpolator)
BasicAnimator
. The next
method will use the passed
Interpolator
to retrieve the interpolant
interpolator
- The Interpolator
to be used to get the interpolant for
setting the next value.protected void flagLastStateInvalid()
public boolean hasNext()
true
if the Animator
has more elements.protected boolean isLastStateValid()
public boolean isStopOnInvalidState()
public void next()
set
method with the next interpolant
as determined
by the interpolator
member.public void set(double interpolant)
setImpl
method.protected void setImpl(double interpolant)
interpolant
- A value between 0 and 1.public void setStopOnInvalidState(boolean stop)
public void start()
Animator
, hasNext
will now return true