Class JaxoCanvasEventListener
java.lang.Object
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThe action to be taken when the mouse is clicked on the canvas.voidThe action to be taken when the mouse is dragged on the canvas.voidProcess the event when the mouse enters the canvas.voidProcess the event when the mouse exits the canvas.voidProcess the event when the mouse is moved on the canvas.voidThe action to be taken when the mouse is pressed on the canvas.voidThe action to be taken when the mouse is released on the canvas.voidvoidsetMode(int mode) Set the current editing mode.
-
Constructor Details
-
JaxoCanvasEventListener
Constructor.- Parameters:
canvas- thecanvas. Not null.
-
-
Method Details
-
setMode
public void setMode(int mode) Set the current editing mode.- Parameters:
mode- the current editing mode.
-
mouseClicked
The action to be taken when the mouse is clicked on the canvas.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
e- The corresponding mouse event.
-
mousePressed
The action to be taken when the mouse is pressed on the canvas.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
e- The corresponding mouse event.
-
mouseReleased
The action to be taken when the mouse is released on the canvas.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
e- The corresponding mouse event.
-
mouseEntered
Process the event when the mouse enters the canvas. Only sets the mouse location.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
e- The mouse event to process.
-
mouseExited
Process the event when the mouse exits the canvas. Only clears the mouse location.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
e- The mouse event to process.
-
mouseDragged
The action to be taken when the mouse is dragged on the canvas.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
e- The corresponding mouse event.
-
mouseMoved
Process the event when the mouse is moved on the canvas. Sets the MouseLocation and PointsAidLocation.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
e- The mouse event to process.
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-