objectdraw
Class AWTWindowControllerListener

java.lang.Object
  extended by objectdraw.AWTWindowControllerListener
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

 class AWTWindowControllerListener
extends Object
implements MouseListener, MouseMotionListener

Listener class designed to pass mouse events to simplified event handling methods associated with a WindowController.

Author:
Tom Murtagh

Constructor Summary
AWTWindowControllerListener(AWTWindowController controller, DrawingCanvas canvas)
          Create a listener that will forward mouse events to specialized WindowController event handling methods.
 
Method Summary
 void mouseClicked(MouseEvent e)
          Invoked when the mouse has been clicked on the canvas.
 void mouseDragged(MouseEvent e)
          Invoked when a mouse button is pressed on the canvas and then dragged.
 void mouseEntered(MouseEvent e)
          Invoked when the mouse enters the canvas.
 void mouseExited(MouseEvent e)
          Invoked when the mouse exits the canvas.
 void mouseMoved(MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons no down).
 void mousePressed(MouseEvent e)
          Invoked when a mouse button has been pressed on the canvas.
 void mouseReleased(MouseEvent e)
          Invoked when a mouse button has been released on the canvas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTWindowControllerListener

public AWTWindowControllerListener(AWTWindowController controller,
                                   DrawingCanvas canvas)
Create a listener that will forward mouse events to specialized WindowController event handling methods.

Parameters:
controller - the WindowController that will handle mouse events.
canvas - the DrawingCanvas associated with controller.
Method Detail

mouseClicked

public void mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on the canvas.

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - the mouse event

mouseDragged

public void mouseDragged(MouseEvent e)
Invoked when a mouse button is pressed on the canvas and then dragged.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - the mouse event

mouseEntered

public void mouseEntered(MouseEvent e)
Invoked when the mouse enters the canvas.

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - the mouse event

mouseExited

public void mouseExited(MouseEvent e)
Invoked when the mouse exits the canvas.

Specified by:
mouseExited in interface MouseListener
Parameters:
e - the mouse event

mouseMoved

public void mouseMoved(MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down).

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - the mouse event

mousePressed

public void mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on the canvas.

Specified by:
mousePressed in interface MouseListener
Parameters:
e - the mouse event

mouseReleased

public void mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on the canvas.

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - the mouse event