@ThreadSafe(implementationOnly=true) public abstract class AbstractTrigger extends java.lang.Object implements Trigger
disarm()
which can be used to disable a trigger and
isArmed()
which checks if a trigger is armed.
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. The subclass will call
fire(TriggerEvent)
to start, or trigger, the animation based on an
event that occurred.
The trigger may be setup to auto-reverse the animation. This reverses the
running animation when the opposite event to the trigger event occurs. The
opposite event is obtained by invoking
TriggerEvent.getOppositeEvent()
on the trigger event. If the
animation is not running and the opposite event occurs the animation is
started in reverse.