|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.animation.timing.triggers.Trigger
org.jdesktop.animation.timing.triggers.TimingTrigger
public class TimingTrigger
TimingTrigger handles timing events and starts the animator when those events occur. This class can be useful in sequencing different Animators. For example, one Animator can be set to start when another ends using this Trigger. For example, to have anim2 start when anim1 ends, one might write the following:
TimingTrigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);
Constructor Summary | |
---|---|
TimingTrigger(Animator animator,
TimingTriggerEvent event)
Creates a non-auto-reversing TimingTrigger, which should be added to an Animator which will generate the events sent to the trigger. |
|
TimingTrigger(Animator animator,
TimingTriggerEvent event,
boolean autoReverse)
Creates a TimingTrigger, which should be added to an Animator which will generate the events sent to the trigger. |
Method Summary | |
---|---|
static TimingTrigger |
addTrigger(Animator source,
Animator target,
TimingTriggerEvent event)
Creates a non-auto-reversing TimingTrigger and adds it as a target to the source Animator. |
static TimingTrigger |
addTrigger(Animator source,
Animator target,
TimingTriggerEvent event,
boolean autoReverse)
Creates a TimingTrigger and adds it as a target to the source Animator. |
void |
begin()
Called by Animator when starting. |
void |
end()
Called by Animator when ending. |
void |
repeat()
Called by Animator when repeating. |
void |
timingEvent(float fraction)
Implementation of TimingTarget method; this method does nothing in this implementation since the events of TimingTrigger are limited to START, STOP, and REPEAT |
Methods inherited from class org.jdesktop.animation.timing.triggers.Trigger |
---|
disarm, fire, fire |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimingTrigger(Animator animator, TimingTriggerEvent event)
public TimingTrigger(Animator animator, TimingTriggerEvent event, boolean autoReverse)
Method Detail |
---|
public static TimingTrigger addTrigger(Animator source, Animator target, TimingTriggerEvent event)
source
- the Animator that will be listened to for events
to start the target Animatortarget
- the Animator that will start when the event occursevent
- the TimingTriggerEvent that will cause targetAnimator
to start
Animator.addTarget(TimingTarget)
public static TimingTrigger addTrigger(Animator source, Animator target, TimingTriggerEvent event, boolean autoReverse)
source
- the Animator that will be listened to for events
to start the target Animatortarget
- the Animator that will start when the event occursevent
- the TimingTriggerEvent that will cause targetAnimator
to startautoReverse
- flag to determine whether the animator should
stop and reverse based on opposite triggerEvents.
Animator.addTarget(TimingTarget)
public void timingEvent(float fraction)
timingEvent
in interface TimingTarget
fraction
- the fraction of completion between the start and
end of the current cycle. Note that on reversing cycles
(Animator.Direction.BACKWARD
) the fraction decreases
from 1.0 to 0 on backwards-running cycles. Note also that animations
with a duration of INFINITE
will call
timingEvent with an undefined value for fraction, since there is
no fraction that makes sense if the animation has no defined length.Animator.Direction
public void begin()
begin
in interface TimingTarget
public void end()
end
in interface TimingTarget
public void repeat()
repeat
in interface TimingTarget
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |