Package com.jgoodies.animation
Class AnimationEvent
- java.lang.Object
-
- com.jgoodies.animation.AnimationEvent
-
public final class AnimationEvent extends java.lang.ObjectAn immutable object that describes events appropriate for animations with the source animation, the type (started, stopped), and the time the event has happened.- Version:
- $Revision: 1.8 $
- See Also:
AnimationListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnimationEvent.TypeEnumerates the animation event types: started and stopped.
-
Field Summary
Fields Modifier and Type Field Description private AnimationsourceThe animation that has been started or stopped.private longtimeDescribes when the event has been created.private AnimationEvent.TypetypeDescribes the state change of the animation: started or stopped.
-
Constructor Summary
Constructors Constructor Description AnimationEvent(Animation source, AnimationEvent.Type type, long time)Constructs anAnimationEventfor the initiating animation, event type, and time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnimationgetSource()Returns the animation the has originated this event.longtime()Returns the time when this event has happened in the time interval of this event's source animation.java.lang.StringtoString()Returns an appropriate string representation.AnimationEvent.Typetype()Returns the event type: started or stopped.
-
-
-
Field Detail
-
source
private final Animation source
The animation that has been started or stopped.
-
type
private final AnimationEvent.Type type
Describes the state change of the animation: started or stopped.
-
time
private final long time
Describes when the event has been created.
-
-
Constructor Detail
-
AnimationEvent
AnimationEvent(Animation source, AnimationEvent.Type type, long time)
Constructs anAnimationEventfor the initiating animation, event type, and time.- Parameters:
source- theAnimationthat has originated the eventtype- the event type: start or stoptime- the time the event has happened, which is likely before the event has been created
-
-
Method Detail
-
getSource
public Animation getSource()
Returns the animation the has originated this event.- Returns:
- the animation that has originated this event
-
type
public AnimationEvent.Type type()
Returns the event type: started or stopped.- Returns:
- the event type: started or stopped
-
time
public long time()
Returns the time when this event has happened in the time interval of this event's source animation. This time may differ from the time the event has been created.- Returns:
- the time the event has happened
-
toString
public java.lang.String toString()
Returns an appropriate string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation for this event
-
-