net.sf.jaxodraw.gui
Class JaxoCanvasEventListener

java.lang.Object
  extended by net.sf.jaxodraw.gui.JaxoCanvasEventListener
All Implemented Interfaces:
MouseListener, MouseMotionListener, PropertyChangeListener, EventListener

public class JaxoCanvasEventListener
extends Object
implements MouseListener, MouseMotionListener, PropertyChangeListener

A listener to process mouse events that happen on the canvas.


Constructor Summary
JaxoCanvasEventListener(JaxoCanvas canvas)
          Constructor.
 
Method Summary
 void mouseClicked(MouseEvent e)
          The action to be taken when the mouse is clicked on the canvas.
 void mouseDragged(MouseEvent e)
          The action to be taken when the mouse is dragged on the canvas.
 void mouseEntered(MouseEvent e)
          Process the event when the mouse enters the canvas.
 void mouseExited(MouseEvent e)
          Process the event when the mouse exits the canvas.
 void mouseMoved(MouseEvent e)
          Process the event when the mouse is moved on the canvas.
 void mousePressed(MouseEvent e)
          The action to be taken when the mouse is pressed on the canvas.
 void mouseReleased(MouseEvent e)
          The action to be taken when the mouse is released on the canvas.
 void propertyChange(PropertyChangeEvent evt)
          
 void setMode(int mode)
          Set the current editing mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxoCanvasEventListener

public JaxoCanvasEventListener(JaxoCanvas canvas)
Constructor.

Parameters:
canvas - the canvas. Not null.
Method Detail

setMode

public void setMode(int mode)
Set the current editing mode.

Parameters:
mode - the current editing mode.

mouseClicked

public void mouseClicked(MouseEvent e)
The action to be taken when the mouse is clicked on the canvas.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - The corresponding mouse event.

mousePressed

public void mousePressed(MouseEvent e)
The action to be taken when the mouse is pressed on the canvas.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - The corresponding mouse event.

mouseReleased

public void mouseReleased(MouseEvent e)
The action to be taken when the mouse is released on the canvas.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - The corresponding mouse event.

mouseEntered

public void mouseEntered(MouseEvent e)
Process the event when the mouse enters the canvas. Only sets the mouse location.

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - The mouse event to process.

mouseExited

public void mouseExited(MouseEvent e)
Process the event when the mouse exits the canvas. Only clears the mouse location.

Specified by:
mouseExited in interface MouseListener
Parameters:
e - The mouse event to process.

mouseDragged

public void mouseDragged(MouseEvent e)
The action to be taken when the mouse is dragged on the canvas.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - The corresponding mouse event.

mouseMoved

public void mouseMoved(MouseEvent e)
Process the event when the mouse is moved on the canvas. Sets the MouseLocation and PointsAidLocation.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - The mouse event to process.

propertyChange

public void propertyChange(PropertyChangeEvent evt)

Specified by:
propertyChange in interface PropertyChangeListener


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.