|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.animation.timing.triggers.Trigger
public abstract class Trigger
This abstract class should be overridden by any class wanting to
implement a new Trigger. The subclass will define the events to trigger
off of and any listeners to handle those events. That subclass will call
either fire()
or fire(TriggerEvent)
to start the
animator based on an event that occurred.
Subclasses should call one of the constructors in Trigger, according to whether they want Trigger to discern between different TriggerEvents and whether they want Trigger to auto-reverse the animation based on opposite TriggerEvents.
Subclasses should call one of the fire
methods based on
whether they want Trigger to perform any event logic or simply start
the animation.
Constructor Summary | |
---|---|
protected |
Trigger(Animator animator)
Creates a Trigger that will start the animator when fire()
is called. |
protected |
Trigger(Animator animator,
TriggerEvent triggerEvent)
Creates a Trigger that will start the animator when fire(TriggerEvent) is called with an event that equals
triggerEvent. |
protected |
Trigger(Animator animator,
TriggerEvent triggerEvent,
boolean autoReverse)
Creates a Trigger that will start the animator when fire(TriggerEvent) is called with an event that equals
triggerEvent. |
Method Summary | |
---|---|
void |
disarm()
This method disables this Trigger and effectively noop's any actions that would otherwise occur |
protected void |
fire()
Utility method called by subclasses to start the animator. |
protected void |
fire(TriggerEvent currentEvent)
Called by subclasses to start the animator if currentEvent equals the event that the Trigger is based upon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Trigger(Animator animator)
fire()
is called. Subclasses call this method to set up a simple Trigger
that will be started by calling fire()
, and will have
no dependency upon the specific TriggerEvent
that must have
occurred to start the animator.
animator
- the Animator that will start when the Trigger
is firedprotected Trigger(Animator animator, TriggerEvent triggerEvent)
fire(TriggerEvent)
is called with an event that equals
triggerEvent.
animator
- the Animator that will start when the Trigger
is firedtriggerEvent
- the TriggerEvent that must occur for this
Trigger to fireprotected Trigger(Animator animator, TriggerEvent triggerEvent, boolean autoReverse)
fire(TriggerEvent)
is called with an event that equals
triggerEvent. Also, automatically stops and reverses animator when
opposite event occurs, and stops reversing animator likewise
when triggerEvent occurs.
animator
- the Animator that will start when the Trigger
is firedtriggerEvent
- the TriggerEvent that must occur for this
Trigger to fireautoReverse
- flag to determine whether the animator should
stop and reverse based on opposite triggerEvents.TriggerEvent.getOppositeEvent()
Method Detail |
---|
public void disarm()
protected void fire(TriggerEvent currentEvent)
currentEvent
- the TriggerEvent
that just occurred, which
will be compared with the TriggerEvent used to construct this Trigger
and determine whether the animator should be started or reversedprotected void fire()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |