be.ugent.caagt.swirl.mouse
Class NullMouseHandler

java.lang.Object
  extended by be.ugent.caagt.swirl.mouse.NullMouseHandler
All 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.


Field Summary
 
Fields inherited from interface be.ugent.caagt.swirl.mouse.MouseHandler
NULL_MOUSE_HANDLER
 
Constructor Summary
NullMouseHandler()
           
 
Method Summary
 boolean canHandle(javax.swing.JComponent parent)
          Check whether this handler can work on the given component.
 void doMouseClicked(javax.swing.JComponent parent, java.awt.event.MouseEvent mouseEvent)
          Invoked when the mouse was clicked, i.e.
 void doMouseDragged(javax.swing.JComponent parent, java.awt.event.MouseEvent mouseEvent, java.awt.event.MouseEvent previousEvent, java.awt.event.MouseEvent pressedEvent)
          Invoked when the mouse pointer was dragged, i.e., moved while the button is down.
 void doMousePressed(javax.swing.JComponent parent, java.awt.event.MouseEvent mouseEvent)
          Invoked when the mouse was pressed down and then dragged for the first time.
 void doMouseReleased(javax.swing.JComponent parent, java.awt.event.MouseEvent mouseEvent, java.awt.event.MouseEvent pressedEvent)
          Invoked when the mouse pointer was released after it was dragged.
 void doPopup(javax.swing.JComponent parent, java.awt.event.MouseEvent mouseEvent)
          Invoked when a popup gesture was invoked and the mouse did not actually move while the button was down.
 void paintDragging(javax.swing.JComponent parent, java.awt.Graphics g, java.awt.event.MouseEvent mouseEvent, java.awt.event.MouseEvent previousEvent, java.awt.event.MouseEvent pressedEvent)
          Paint visual feedback while dragging the mouse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullMouseHandler

public NullMouseHandler()
Method Detail

doMouseReleased

public void doMouseReleased(javax.swing.JComponent parent,
                            java.awt.event.MouseEvent mouseEvent,
                            java.awt.event.MouseEvent pressedEvent)
Description copied from interface: MouseHandler
Invoked when the mouse pointer was released after it was dragged. Will not be called when the corresponding MouseHandler.doMousePressed(javax.swing.JComponent, java.awt.event.MouseEvent) event was not consumed by this object.

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(javax.swing.JComponent parent,
                    java.awt.event.MouseEvent mouseEvent)
Description copied from interface: MouseHandler
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

doMouseDragged

public void doMouseDragged(javax.swing.JComponent parent,
                           java.awt.event.MouseEvent mouseEvent,
                           java.awt.event.MouseEvent previousEvent,
                           java.awt.event.MouseEvent pressedEvent)
Description copied from interface: MouseHandler
Invoked when the mouse pointer was dragged, i.e., moved while the button is down. Will not be called when the corresponding MouseHandler.doMousePressed(javax.swing.JComponent, java.awt.event.MouseEvent) event was not consumed by this object.

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(javax.swing.JComponent parent,
                           java.awt.event.MouseEvent mouseEvent)
Description copied from interface: MouseHandler
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

doMouseClicked

public void doMouseClicked(javax.swing.JComponent parent,
                           java.awt.event.MouseEvent mouseEvent)
Description copied from interface: MouseHandler
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(javax.swing.JComponent, java.awt.event.MouseEvent) is invoked instead.

Handlers should consume the event if they take responsibility for this mouse gesture.

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

paintDragging

public void paintDragging(javax.swing.JComponent parent,
                          java.awt.Graphics g,
                          java.awt.event.MouseEvent mouseEvent,
                          java.awt.event.MouseEvent previousEvent,
                          java.awt.event.MouseEvent pressedEvent)
Description copied from interface: MouseHandler
Paint visual feedback while dragging the mouse. Will not be called when the corresponding MouseHandler.doMousePressed(javax.swing.JComponent, java.awt.event.MouseEvent) event was not consumed by this object.

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

canHandle

public boolean canHandle(javax.swing.JComponent parent)
Description copied from interface: MouseHandler
Check whether this handler can work on the given component.

Specified by:
canHandle in interface MouseHandler