be.ugent.caagt.swirl.mouse
Class NullMouseHandler
java.lang.Object
be.ugent.caagt.swirl.mouse.NullMouseHandler
- MouseHandler
public class NullMouseHandler
extends java.lang.Object
Mouse handler that does not perform any action. Usefull as a 'null object'
or as a superclass for handlers that only need to override a few methods.
boolean | canHandle(JComponent parent) - Check whether this handler can work on the given component.
|
void | doMouseClicked(JComponent parent, MouseEvent mouseEvent) - Invoked when the mouse was clicked, i.e.
|
void | doMouseDragged(JComponent parent, MouseEvent mouseEvent, MouseEvent previousEvent, MouseEvent pressedEvent) - Invoked when the mouse pointer was dragged, i.e., moved
while the button is down.
|
void | doMousePressed(JComponent parent, MouseEvent mouseEvent) - Invoked when the mouse was pressed down and then dragged
for the first time.
|
void | doMouseReleased(JComponent parent, MouseEvent mouseEvent, MouseEvent pressedEvent) - Invoked when the mouse pointer was released after it was dragged.
|
void | doPopup(JComponent parent, MouseEvent mouseEvent) - Invoked when a popup gesture was invoked and the
mouse did not actually move while the button was down.
|
void | paintDragging(JComponent parent, Graphics g, MouseEvent mouseEvent, MouseEvent previousEvent, MouseEvent pressedEvent) - Paint visual feedback while dragging the mouse.
|
canHandle
public boolean canHandle(JComponent parent)
Check whether this handler can work on the given component.
- canHandle in interface MouseHandler
doMouseClicked
public void doMouseClicked(JComponent parent,
MouseEvent mouseEvent)
Invoked when the mouse was clicked, i.e. the button was pressed
and released without moving. If the click was a popup gesture for
the current platform, then
MouseHandler.doPopup(JComponent,MouseEvent)
is invoked instead.
Handlers should consume the event if they take responsibility for this
mouse gesture.
- doMouseClicked in interface MouseHandler
parent
- Component for which this handler acts as a controllermouseEvent
- Corresponding mouse event
doMouseDragged
public void doMouseDragged(JComponent parent,
MouseEvent mouseEvent,
MouseEvent previousEvent,
MouseEvent pressedEvent)
- doMouseDragged in interface MouseHandler
parent
- Component for which this handler acts as a controllermouseEvent
- Corresponding mouse eventpreviousEvent
- Pressed or dragged event before this event.pressedEvent
- Mouse event that initiated this gesture
doMousePressed
public void doMousePressed(JComponent parent,
MouseEvent mouseEvent)
Invoked when the mouse was pressed down and then dragged
for the first time.
Handlers should consume the event if they take responsibility for the
mouse gesture started by this press (and ending with the subsequent
release of the button).
- doMousePressed in interface MouseHandler
parent
- Component for which this handler acts as a controllermouseEvent
- Corresponding mouse event
doMouseReleased
public void doMouseReleased(JComponent parent,
MouseEvent mouseEvent,
MouseEvent pressedEvent)
- doMouseReleased in interface MouseHandler
parent
- Component for which this handler acts as a controllermouseEvent
- Corresponding mouse eventpressedEvent
- Mouse event that initiated this gesture
doPopup
public void doPopup(JComponent parent,
MouseEvent mouseEvent)
Invoked when a popup gesture was invoked and the
mouse did not actually move while the button was down.
Handlers should consume the event if they take responsibility for this
mouse gesture.
- doPopup in interface MouseHandler
parent
- Component for which this handler acts as a controllermouseEvent
- Corresponding mouse event
paintDragging
public void paintDragging(JComponent parent,
Graphics g,
MouseEvent mouseEvent,
MouseEvent previousEvent,
MouseEvent pressedEvent)
- paintDragging in interface MouseHandler
parent
- Component for which this handler acts as a controllerg
- Graphics context onto which the visual feedback should be drawnmouseEvent
- Mouse event corresponding to the last dragpressedEvent
- Mouse event that initiated this gesture