|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.animation.AbstractAnimation
public abstract class AbstractAnimation
An abstract class that minimizes the effort required to implement
the Animation
interface. Defines the duration and freezed state
and provides a listener list.
Constructor Summary | |
---|---|
protected |
AbstractAnimation(long duration)
Constructs an Animation with the specified duration. |
protected |
AbstractAnimation(long duration,
boolean freezed)
Constructs an Animation with the specified duration
and freezed mode. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractAnimation(long duration)
Animation
with the specified duration.
duration
- the animation's durationprotected AbstractAnimation(long duration, boolean freezed)
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 0Method Detail |
---|
public final long duration()
duration
in interface Animation
public final boolean isFreezed()
protected abstract void applyEffect(long time)
time
- the time used to determine the animation effectpublic void animate(long time)
animate
in interface Animation
time
- the time used to determine the animation effectpublic final void addAnimationListener(AnimationListener listener)
AnimationListener
to this animation.
addAnimationListener
in interface Animation
listener
- the AnimationListener
to addpublic final void removeAnimationListener(AnimationListener listener)
AnimationListener
to this animation.
removeAnimationListener
in interface Animation
listener
- the AnimationListener
to removeprotected final void fireAnimationStarted(long time)
time
- the time that will be reported in the eventprotected final void fireAnimationStopped(long time)
time
- the time that will be reported in the eventpublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |