be.ugent.caagt.swirl.mouse

Class NullMouseHandler

Implemented Interfaces:
MouseHandler

public class NullMouseHandler
extends java.lang.Object
implements MouseHandler

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.

Fields inherited from interface be.ugent.caagt.swirl.mouse.MouseHandler

NULL_MOUSE_HANDLER

Method Summary

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.

Method Details

canHandle

public boolean canHandle(JComponent parent)
Check whether this handler can work on the given component.
Specified by:
canHandle in interface MouseHandler

doMouseClicked

public void doMouseClicked(JComponent parent,
                           MouseEvent mouseEvent)
Specified by:
doMouseClicked in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
mouseEvent - Corresponding mouse event

doMouseDragged

public void doMouseDragged(JComponent parent,
                           MouseEvent mouseEvent,
                           MouseEvent previousEvent,
                           MouseEvent pressedEvent)
Specified by:
doMouseDragged in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
mouseEvent - Corresponding mouse event
previousEvent - 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).

Specified by:
doMousePressed in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
mouseEvent - Corresponding mouse event

doMouseReleased

public void doMouseReleased(JComponent parent,
                            MouseEvent mouseEvent,
                            MouseEvent pressedEvent)
Specified by:
doMouseReleased in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
mouseEvent - Corresponding mouse event
pressedEvent - 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.

Specified by:
doPopup in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
mouseEvent - Corresponding mouse event

paintDragging

public void paintDragging(JComponent parent,
                          Graphics g,
                          MouseEvent mouseEvent,
                          MouseEvent previousEvent,
                          MouseEvent pressedEvent)
Specified by:
paintDragging in interface MouseHandler
Parameters:
parent - Component for which this handler acts as a controller
g - Graphics context onto which the visual feedback should be drawn
mouseEvent - Mouse event corresponding to the last drag
pressedEvent - Mouse event that initiated this gesture