org.jdesktop.animation.timing.triggers
public class FocusTrigger extends Trigger implements FocusListener
FocusTrigger trigger = FocusTrigger.addTrigger(component, anim, FocusTriggerEvent.IN);
Constructor and Description |
---|
FocusTrigger(Animator animator,
FocusTriggerEvent event)
Creates a non-auto-reversing FocusTrigger, which should be added
to a Component that will generate the focus events of interest.
|
FocusTrigger(Animator animator,
FocusTriggerEvent event,
boolean autoReverse)
Creates a FocusTrigger, which should be added
to a Component that will generate the focus events of interest.
|
Modifier and Type | Method and Description |
---|---|
static FocusTrigger |
addTrigger(JComponent component,
Animator animator,
FocusTriggerEvent event)
Creates a non-auto-reversing FocusTrigger and adds it as a FocusListener
to the component.
|
static FocusTrigger |
addTrigger(JComponent component,
Animator animator,
FocusTriggerEvent event,
boolean autoReverse)
Creates a FocusTrigger and adds it as a FocusListener
to the component.
|
void |
focusGained(FocusEvent e)
Called by the object which added this trigger as a FocusListener.
|
void |
focusLost(FocusEvent e)
Called by the object which added this trigger as a FocusListener.
|
public FocusTrigger(Animator animator, FocusTriggerEvent event)
animator
- the Animator that will start when the event occursevent
- the FocusTriggerEvent that will cause the action to firepublic FocusTrigger(Animator animator, FocusTriggerEvent event, boolean autoReverse)
animator
- the Animator that will start when the event occursevent
- the FocusTriggerEvent that will cause the action to fireautoReverse
- flag to determine whether the animator should
stop and reverse based on opposite triggerEvents.public static FocusTrigger addTrigger(JComponent component, Animator animator, FocusTriggerEvent event)
component
- component that will generate FocusEvents for this
triggeranimator
- the Animator that will start when the event occursevent
- the FocusTriggerEvent that will cause the action to firepublic static FocusTrigger addTrigger(JComponent component, Animator animator, FocusTriggerEvent event, boolean autoReverse)
component
- component that will generate FocusEvents for this
triggeranimator
- the Animator that will start when the event occursevent
- the FocusTriggerEvent that will cause the action to fireautoReverse
- flag to determine whether the animator should
stop and reverse based on opposite triggerEvents.public void focusGained(FocusEvent e)
focusGained
in interface FocusListener
public void focusLost(FocusEvent e)
focusLost
in interface FocusListener