public class Animator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_PERIOD
The default tick period.
|
static java.lang.String |
PERIOD_PROPERTY
The property used to define the period through the system properties.
|
Constructor and Description |
---|
Animator()
Creates an animator.
|
Modifier and Type | Method and Description |
---|---|
long |
getPeriod()
Gets the period.
|
void |
setPeriod(long period)
Sets the period.
|
void |
startAnimation(Animation animation)
Starts an animation.
|
void |
stopAnimation(Animation animation)
Stops an animation.
|
public static final long DEFAULT_PERIOD
public static final java.lang.String PERIOD_PROPERTY
Setting this property with a valid long value will override the default period of the animators.
public Animator()
Its period will be:
PERIOD_PROPERTY
system property if set and valid,DEFAULT_PERIOD
.public void setPeriod(long period)
period
- the period to set.public long getPeriod()
public void startAnimation(Animation animation)
The animation tick method is then called every period.
animation
- the animation to start.Animation.tick(long)
,
getPeriod()
public void stopAnimation(Animation animation)
The animation tick method will not be called anymore by this animator.
animation
- the animation to stop.