Package net.sf.jaxodraw.gui
Class JaxoCanvasEventListener
- java.lang.Object
-
- net.sf.jaxodraw.gui.JaxoCanvasEventListener
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.beans.PropertyChangeListener
,java.util.EventListener
public class JaxoCanvasEventListener extends java.lang.Object implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener
A listener to process mouse events that happen on the canvas.
-
-
Constructor Summary
Constructors Constructor Description JaxoCanvasEventListener(JaxoCanvas canvas)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
mouseClicked(java.awt.event.MouseEvent e)
The action to be taken when the mouse is clicked on the canvas.void
mouseDragged(java.awt.event.MouseEvent e)
The action to be taken when the mouse is dragged on the canvas.void
mouseEntered(java.awt.event.MouseEvent e)
Process the event when the mouse enters the canvas.void
mouseExited(java.awt.event.MouseEvent e)
Process the event when the mouse exits the canvas.void
mouseMoved(java.awt.event.MouseEvent e)
Process the event when the mouse is moved on the canvas.void
mousePressed(java.awt.event.MouseEvent e)
The action to be taken when the mouse is pressed on the canvas.void
mouseReleased(java.awt.event.MouseEvent e)
The action to be taken when the mouse is released on the canvas.void
propertyChange(java.beans.PropertyChangeEvent evt)
void
setMode(int mode)
Set the current editing mode.
-
-
-
Constructor Detail
-
JaxoCanvasEventListener
public JaxoCanvasEventListener(JaxoCanvas canvas)
Constructor.- Parameters:
canvas
- thecanvas
. 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(java.awt.event.MouseEvent e)
The action to be taken when the mouse is clicked on the canvas.- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Parameters:
e
- The corresponding mouse event.
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
The action to be taken when the mouse is pressed on the canvas.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Parameters:
e
- The corresponding mouse event.
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
The action to be taken when the mouse is released on the canvas.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Parameters:
e
- The corresponding mouse event.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
Process the event when the mouse enters the canvas. Only sets the mouse location.- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Parameters:
e
- The mouse event to process.
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
Process the event when the mouse exits the canvas. Only clears the mouse location.- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- Parameters:
e
- The mouse event to process.
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
The action to be taken when the mouse is dragged on the canvas.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Parameters:
e
- The corresponding mouse event.
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
Process the event when the mouse is moved on the canvas. Sets the MouseLocation and PointsAidLocation.- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
- Parameters:
e
- The mouse event to process.
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-