com.jgoodies.animation
Class AbstractAnimation
java.lang.Object
com.jgoodies.animation.AbstractAnimation
- Animation
public abstract class AbstractAnimation
extends java.lang.Object
An abstract class that minimizes the effort required to implement
the
Animation
interface. Defines the duration and freezed state
and provides a listener list.
AbstractAnimation(long duration) - Constructs an
Animation with the specified duration.
|
AbstractAnimation(long duration, boolean freezed) - Constructs an
Animation with the specified duration
and freezed mode.
|
void | addAnimationListener(AnimationListener listener) - Adds an
AnimationListener to this animation.
|
void | animate(long time) - Performs the animation at the given time: applies the animation
effect to the animation target, fires appropriate events,
and resets the effect if we exceeded the animations duration.
|
protected abstract void | applyEffect(long time) - Applies the animation effect for the given time to the animation target.
|
long | duration() - Returns this animation's duration.
|
protected void | fireAnimationStarted(long time) - Fires an event that indicates that the animation has been started
at the specified time.
|
protected void | fireAnimationStopped(long time) - Fires an event that indicates that the animation has been stopped
at the specified time.
|
boolean | isFreezed() - Answers whether the animation effect should be freezed after
we exceeded the animation's duration.
|
void | removeAnimationListener(AnimationListener listener) - Removes an
AnimationListener to this animation.
|
String | toString() - Returns a string representation for this animation.
|
AbstractAnimation
protected AbstractAnimation(long duration)
Constructs an Animation
with the specified duration.
duration
- the animation's duration
AbstractAnimation
protected AbstractAnimation(long duration,
boolean freezed)
Constructs an Animation
with the specified duration
and freezed mode.
duration
- the animation's durationfreezed
- true indicates that the effect will be retained after
the animation is finished, false resets the effect to the time 0
animate
public void animate(long time)
Performs the animation at the given time: applies the animation
effect to the animation target, fires appropriate events,
and resets the effect if we exceeded the animations duration.
- animate in interface Animation
time
- the time used to determine the animation effect
applyEffect
protected abstract void applyEffect(long time)
Applies the animation effect for the given time to the animation target.
time
- the time used to determine the animation effect
duration
public final long duration()
Returns this animation's duration.
- duration in interface Animation
- this animation's duration
fireAnimationStarted
protected final void fireAnimationStarted(long time)
Fires an event that indicates that the animation has been started
at the specified time.
time
- the time that will be reported in the event
fireAnimationStopped
protected final void fireAnimationStopped(long time)
Fires an event that indicates that the animation has been stopped
at the specified time.
time
- the time that will be reported in the event
isFreezed
public final boolean isFreezed()
Answers whether the animation effect should be freezed after
we exceeded the animation's duration. If this is not the case,
the animation effect of time 0 will be set.
- true indicates that the effect will be retained if the
animation duration exceeded; false indicates that the effect
will be reset
toString
public String toString()
Returns a string representation for this animation.
- a string representation for this animation
Copyright © 2001-2006 JGoodies Karsten Lentzsch. All Rights Reserved.