jdraw.jdraw_ui
Class CanvasMouseListener

java.lang.Object
  |
  +--jdraw.jdraw_ui.CanvasMouseListener
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class CanvasMouseListener
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

Class CanvasMouseListener is the controlling class for the CanvasWindows. These methods determine the course of action, given the MouseEvent which has occured in this Listener's Window.


Field Summary
protected  CanvasWindow canvasWindow
          A local reference to the companion CanvasWindow object.
 
Constructor Summary
CanvasMouseListener(CanvasWindow cWindow)
          Construct this with the passed CanvasWindow object by simply setting this.canvasWindow = passed CanvasWindow.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Method mouseClicked is functionless as of now.
 void mouseDragged(java.awt.event.MouseEvent e)
          Method mouseDragged(MouseEvent) determines whether a button is down and as such calls the appropriate method of canvasWindow.
 void mouseEntered(java.awt.event.MouseEvent e)
          Method mouseEntered is functionless as of now.
 void mouseExited(java.awt.event.MouseEvent e)
          Method mouseExited is functionless as of now.
 void mouseMoved(java.awt.event.MouseEvent e)
          Method mouseMoved(MouseEvent) calls canvasWindow.normalDrag.
 void mousePressed(java.awt.event.MouseEvent e)
          Method mousePressed(MouseEvent) determines which button was clicked and then performs the appropriate method call to canvasWindow.
 void mouseReleased(java.awt.event.MouseEvent e)
          Method mouseReleased(MouseEvent) determines which button was released and then performs the appropriate method call to canvasWindow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canvasWindow

protected CanvasWindow canvasWindow
A local reference to the companion CanvasWindow object.
Constructor Detail

CanvasMouseListener

public CanvasMouseListener(CanvasWindow cWindow)
Construct this with the passed CanvasWindow object by simply setting this.canvasWindow = passed CanvasWindow.
Parameters:
cWindow - - The CanvasWindow to be stored in this.canvasWindow.
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Method mousePressed(MouseEvent) determines which button was clicked and then performs the appropriate method call to canvasWindow.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - - The MouseEvent which includes this mousePress.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Method mouseReleased(MouseEvent) determines which button was released and then performs the appropriate method call to canvasWindow.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - - The MouseEvent which includes this mouseRelease.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Method mouseDragged(MouseEvent) determines whether a button is down and as such calls the appropriate method of canvasWindow.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - - The MouseEvent which includes this mouseDrag

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Method mouseMoved(MouseEvent) calls canvasWindow.normalDrag.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - - The MouseEvent to be passed to canvasWindow through normalDrag call.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Method mouseClicked is functionless as of now.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Method mouseEntered is functionless as of now.
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Method mouseExited is functionless as of now.
Specified by:
mouseExited in interface java.awt.event.MouseListener