com.jgoodies.animation
Class Animator
java.lang.Object
com.jgoodies.animation.Animator
- ActionListener
public final class Animator
extends java.lang.Object
implements ActionListener
Starts and stops an animation and triggers
the animation at a given frame rate.
Animator(Animation animation, int framesPerSecond) - Constructs an Animator for the given animation and frame rate.
|
void | actionPerformed(ActionEvent e) - Implements the ActionListener interface used by the Timer.
|
Animation | animation() - Returns the animator's animation.
|
long | elapsedTime() - Returns the elapsed time since animation start.
|
int | framesPerSecond() - Returns the desired frame rate.
|
void | start() - Starts the animator and in turn the animation.
|
void | stop() - Stops the animator.
|
String | toString() - Returns a string representation for the animator.
|
Animator
public Animator(Animation animation,
int framesPerSecond)
Constructs an Animator for the given animation and frame rate.
animation
- the animation to animateframesPerSecond
- the desired frame rate
actionPerformed
public void actionPerformed(ActionEvent e)
Implements the ActionListener interface used by the Timer.
animation
public Animation animation()
Returns the animator's animation.
elapsedTime
public long elapsedTime()
Returns the elapsed time since animation start.
- time elapsed since the animation start
framesPerSecond
public int framesPerSecond()
Returns the desired frame rate.
- the desired frame rate per second
start
public void start()
Starts the animator and in turn the animation.
stop
public void stop()
Stops the animator.
toString
public String toString()
Returns a string representation for the animator.
- a string representation for the animator
Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.