packageForL9L10
Class DotController

java.lang.Object
  extended by packageForL9L10.DotController
All Implemented Interfaces:
java.awt.event.MouseListener, java.util.EventListener

public class DotController
extends java.lang.Object
implements java.awt.event.MouseListener

This class encapsulates a very simple controller. This controller listens for mouse events. If a mouse event is detected, then this controller will ask the model to modify itself (by indicating that the first dot should be nudged to the right).

Author:
mb

Constructor Summary
DotController(DotPanel view, SimpleThreeDotModel_v2 model)
          Instantiates the controller.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Any mouse click causes dot 1 in the model to be nudged to the right.
 void mouseEntered(java.awt.event.MouseEvent e)
          Does nothing
 void mouseExited(java.awt.event.MouseEvent e)
          Does nothing
 void mousePressed(java.awt.event.MouseEvent e)
          Does nothing
 void mouseReleased(java.awt.event.MouseEvent e)
          Does nothing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotController

public DotController(DotPanel view,
                     SimpleThreeDotModel_v2 model)
Instantiates the controller. The controller installs itself upon the view and thereby receives any mouse events that are dispatched from the view. The controller implements a very simple behaviour - any mouse click causes the first dot to be nudged to the right. The controller also takes the passed model so that it can instruct the model to change itself accordingly on the basis of user input.

Parameters:
view -
model -
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Any mouse click causes dot 1 in the model to be nudged to the right. Hint: look at the API of the class SimpleThreeDotModel to see how this method might accomplish this.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Does nothing

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Does nothing

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Does nothing

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Does nothing

Specified by:
mouseExited in interface java.awt.event.MouseListener