public class AnimatorObject extends Object implements Animator
Animator behavior.| Constructor and Description |
|---|
AnimatorObject()
Constructs an animated object with a default
animationPeriod() of 40
milliseconds (25Hz). |
AnimatorObject(TimingHandler handler)
Constructs an animated object with a default
animationPeriod() of 40
milliseconds (25Hz). |
| Modifier and Type | Method and Description |
|---|---|
void |
animate()
Main call back animated method.
|
long |
animationPeriod()
The animation loop period, in milliseconds.
|
boolean |
animationStarted()
Return
true when the animation loop is started. |
boolean |
invokeAnimationHandler()
Returns whether or not the animated method is defined externally, as when register it
through reflection.
|
void |
restartAnimation()
Restart the animation.
|
void |
setAnimationPeriod(long period)
Convenience function that simply calls
period(period, true). |
void |
setAnimationPeriod(long period,
boolean restart)
Sets the
animationPeriod(), in milliseconds. |
void |
setTimingHandler(TimingHandler h)
Sets the timing handler.
|
void |
startAnimation()
Starts the animation loop.
|
void |
stopAnimation()
Stops animation.
|
SeqTimer |
timer()
Returns the sequential timer.
|
TimingHandler |
timingHandler()
Returns the timing handler.
|
void |
toggleAnimation()
|
public AnimatorObject()
animationPeriod() of 40
milliseconds (25Hz). The handler should explicitly be defined afterwards (
setTimingHandler(TimingHandler)).public AnimatorObject(TimingHandler handler)
animationPeriod() of 40
milliseconds (25Hz).public void setTimingHandler(TimingHandler h)
AnimatorsetTimingHandler in interface Animatorpublic TimingHandler timingHandler()
AnimatortimingHandler in interface Animatorpublic SeqTimer timer()
Animatorpublic boolean animationStarted()
true when the animation loop is started.
The timing handler will check when animationStarted() and then called the
animation callback method every animationPeriod() milliseconds.
Use startAnimation(), stopAnimation() or toggleAnimation()
to change this value.
animationStarted in interface AnimatorstartAnimation(),
animate()public long animationPeriod()
animationStarted(), this is
the delay that takes place between two consecutive iterations of the animation loop.
This delay defines a target frame rate that will only be achieved if your
animate() methods is fast enough.
Default value is 40 milliseconds (25 Hz).
Note: This value is taken into account only the next time you call
startAnimation(). If animationStarted(), you should
stopAnimation() first. See restartAnimation() and
setAnimationPeriod(long, boolean).
animationPeriod in interface AnimatorsetAnimationPeriod(long, boolean)public void setAnimationPeriod(long period)
period(period, true).setAnimationPeriod in interface AnimatorsetAnimationPeriod(long, boolean)public void setAnimationPeriod(long period,
boolean restart)
animationPeriod(), in milliseconds. If restart is true and
animationStarted() then restartAnimation() is called.setAnimationPeriod in interface AnimatorstartAnimation()public void stopAnimation()
stopAnimation in interface AnimatoranimationStarted()public void startAnimation()
startAnimation in interface AnimatoranimationStarted()public void restartAnimation()
Simply calls stopAnimation() and then startAnimation().
restartAnimation in interface Animatorpublic void toggleAnimation()
toggleAnimation in interface Animatorpublic void animate()
Animatorpublic boolean invokeAnimationHandler()
AnimatorinvokeAnimationHandler in interface AnimatorProcessing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia