|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swing.animation.timing.triggers.TriggerUtility
@Immutable @Utility public final class TriggerUtility
A utility that creates triggers for Swing applications.
| Method Summary | |
|---|---|
static org.jdesktop.core.animation.timing.Trigger |
addActionTrigger(Object object,
org.jdesktop.core.animation.timing.Animator target)
Creates an action trigger and adds it as an ActionListener to the
passed object. |
static org.jdesktop.core.animation.timing.Trigger |
addFocusTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.FocusTriggerEvent event)
Creates a non-auto-reversing focus trigger and adds it as a FocusListener to the passed component. |
static org.jdesktop.core.animation.timing.Trigger |
addFocusTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.FocusTriggerEvent event,
boolean autoReverse)
Creates a focus trigger and adds it as a FocusListener to the
passed component. |
static org.jdesktop.core.animation.timing.Trigger |
addMouseTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.MouseTriggerEvent event)
Creates a non-auto-reversing mouse trigger and adds it as a MouseListener to the passed component. |
static org.jdesktop.core.animation.timing.Trigger |
addMouseTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.MouseTriggerEvent event,
boolean autoReverse)
Creates a mouse trigger and adds it as a MouseListener to the
passed component. |
static org.jdesktop.core.animation.timing.Trigger |
addTimingTrigger(org.jdesktop.core.animation.timing.Animator source,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.TimingTriggerEvent event)
Creates a non-auto-reversing timing trigger and adds it as a target to the source animation. |
static org.jdesktop.core.animation.timing.Trigger |
addTimingTrigger(org.jdesktop.core.animation.timing.Animator source,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.TimingTriggerEvent event,
boolean autoReverse)
Creates a timing trigger and adds it as a target to the source animation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.jdesktop.core.animation.timing.Trigger addTimingTrigger(org.jdesktop.core.animation.timing.Animator source,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.TimingTriggerEvent event)
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:
Trigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP);
source - the animation that will be listened to for events to start the
target animation.target - the animation that will start when the event occurs.event - the TimingTriggerEvent on source that will cause
target to start.
IllegalArgumentException - if any of the parameters is null.TimingTrigger
public static org.jdesktop.core.animation.timing.Trigger addTimingTrigger(org.jdesktop.core.animation.timing.Animator source,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.TimingTriggerEvent event,
boolean autoReverse)
Animator can be set to start when another ends
using this trigger. For example, to have anim2 start when
anim1 ends and visa versa, have anim2 stop when
anim1 starts, one might write the following:
Trigger trigger = TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP, true);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TimingTrigger.addTrigger(anim1, anim2, TimingTriggerEvent.STOP, true);
source - the animation that will be listened to for events to start the
target animation.target - the animation that will start when the event occurs.event - the TimingTriggerEvent on source that will cause
target to start.autoReverse - true if the animation should be reversed on opposite
trigger events, false otherwise.
IllegalArgumentException - if any of the parameters is null.TimingTrigger
public static org.jdesktop.core.animation.timing.Trigger addActionTrigger(Object object,
org.jdesktop.core.animation.timing.Animator target)
ActionListener to the
passed object. For example, to have anim start when a button is
clicked, one might write the following:
Trigger trigger = TriggerUtility.addActionTrigger(button, anim);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TriggerUtility.addActionTrigger(button, anim);
object - an object that will be used as an event source for this trigger.
This object must have an addActionListener method.target - the animation that will start when the event occurs.
IllegalArgumentException - if either of the parameters is null or if object
has no addActionListener method.
public static org.jdesktop.core.animation.timing.Trigger addFocusTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.FocusTriggerEvent event)
FocusListener to the passed component. For example, to have
anim start when component receives an IN event, one might
write the following:
Trigger trigger = TriggerUtility.addFocusTrigger(component, anim, FocusTriggerEvent.IN);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TriggerUtility.addFocusTrigger(component, anim, FocusTriggerEvent.IN);
component - the component that will generate focus events for this trigger.target - the animation that will start when the event occurs.event - the FocusTriggerEvent on component that will
cause target to start.
IllegalArgumentException - if any of the parameters is null.
public static org.jdesktop.core.animation.timing.Trigger addFocusTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.FocusTriggerEvent event,
boolean autoReverse)
FocusListener to the
passed component. For example, to have anim start when
component receives an IN event, and reverse anim when
component receives an OUT event, one might write the following:
Trigger trigger = TriggerUtility.addFocusTrigger(component, anim, FocusTriggerEvent.IN, true);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TriggerUtility.addFocusTrigger(component, anim, FocusTriggerEvent.IN, true);
component - the component that will generate focus events for this trigger.target - the animation that will start when the event occurs.event - the FocusTriggerEvent on component that will
cause target to start.autoReverse - true if the animation should be reversed on opposite
trigger events, false otherwise.
IllegalArgumentException - if any of the parameters is null.
public static org.jdesktop.core.animation.timing.Trigger addMouseTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.MouseTriggerEvent event)
MouseListener to the passed component. For example, to have
anim start when component receives an CLICK event, one
might write the following:
Trigger trigger = TriggerUtility.addMouseTrigger(component, anim, MouseTriggerEvent.CLICK);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TriggerUtility.addMouseTrigger(component, anim, MouseTriggerEvent.CLICK);
component - the component that will generate mouse events for this trigger.target - the animation that will start when the event occurs.event - the MouseTriggerEvent on component that will
cause target to start.
IllegalArgumentException - if any of the parameters is null.
public static org.jdesktop.core.animation.timing.Trigger addMouseTrigger(JComponent component,
org.jdesktop.core.animation.timing.Animator target,
org.jdesktop.core.animation.timing.triggers.MouseTriggerEvent event,
boolean autoReverse)
MouseListener to the
passed component. For example, to have anim start when
component receives an ENTER event, and reverse anim when
component receives an EXIT event, one might write the following:
Trigger trigger = TriggerUtility.addMouseTrigger(component, anim, MouseTriggerEvent.ENTER, true);The returned trigger object can be safely ignored if the code never needs to disarm the trigger.
TriggerUtility.addMouseTrigger(component, anim, MouseTriggerEvent.ENTER, true);
component - the component that will generate mouse events for this trigger.target - the animation that will start when the event occurs.event - the MouseTriggerEvent on component that will
cause target to start.autoReverse - true if the animation should be reversed on opposite
trigger events, false otherwise.
IllegalArgumentException - if any of the parameters is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||