org.jdesktop.animation.timing.triggers
public class MouseTrigger extends Trigger implements MouseListener
MouseTrigger trigger = MouseTrigger.addTrigger(component, anim, MouseTriggerEvent.ENTER);
Constructor and Description |
---|
MouseTrigger(Animator animator,
MouseTriggerEvent event)
Creates a non-auto-reversing MouseTrigger, which should be added
to a Component that will generate the mouse events of interest
|
MouseTrigger(Animator animator,
MouseTriggerEvent event,
boolean autoReverse)
Creates a MouseTrigger, which should be added
to a Component that will generate the mouse events of interest
|
Modifier and Type | Method and Description |
---|---|
static MouseTrigger |
addTrigger(JComponent component,
Animator animator,
MouseTriggerEvent event)
Creates a non-auto-reversing MouseTrigger and adds it as a
listener to component.
|
static MouseTrigger |
addTrigger(JComponent component,
Animator animator,
MouseTriggerEvent event,
boolean autoReverse)
Creates a MouseTrigger and adds it as a listener to component.
|
void |
mouseClicked(MouseEvent e)
Called by the object which added this trigger as a MouseListener.
|
void |
mouseEntered(MouseEvent e)
Called by the object which added this trigger as a MouseListener.
|
void |
mouseExited(MouseEvent e)
Called by the object which added this trigger as a MouseListener.
|
void |
mousePressed(MouseEvent e)
Called by the object which added this trigger as a MouseListener.
|
void |
mouseReleased(MouseEvent e)
Called by the object which added this trigger as a MouseListener.
|
public MouseTrigger(Animator animator, MouseTriggerEvent event)
public MouseTrigger(Animator animator, MouseTriggerEvent event, boolean autoReverse)
public static MouseTrigger addTrigger(JComponent component, Animator animator, MouseTriggerEvent event)
component
- component that will generate MouseEvents for this
triggeranimator
- the Animator that will start when the event occursevent
- the MouseTriggerEvent that will cause the action to firepublic static MouseTrigger addTrigger(JComponent component, Animator animator, MouseTriggerEvent event, boolean autoReverse)
component
- component that will generate MouseEvents 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 mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener