packageForLT06
Class DotController6

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

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

This class encapsulates a very simple controller. Recall the role of the controller, which is to take the user input and figures out what it means to the model. In this particular case, the controller implements a logic whereby mouse clicks by the user changes the data model. See the API for the method mouseClicked(MouseEvent e) below for details. This class provides a constructor that requires a DotModel and a DotView. This controller observes the view and respond to user events performed upon the view by the user according to the logic below. This controller listens for mouse events. The logic is specified in terms of results to the data model.

Author:
mb

Constructor Summary
DotController6(FilledDotView view, DotModel model)
          Instantiates the controller.
DotController6(WireFrameDotView view, DotModel model)
          Instantiates the controller.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Any mouse click at any position in the display causes the dot closest to the mouse click 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

DotController6

public DotController6(WireFrameDotView view,
                      DotModel model)
Instantiates the controller. The controller installs itself upon the view and thereby receives any mouse events that are dispatched from the view ("mouse events that are dispatched from the view" is another way of saying "mouse actions that are performed by the user"). The constructor for this controller also requires a data model.

Parameters:
view -
model -

DotController6

public DotController6(FilledDotView view,
                      DotModel model)
Instantiates the controller. The controller installs itself upon the view and thereby receives any mouse events that are dispatched from the view ("mouse events that are dispatched from the view" is another way of saying "mouse actions that are performed by the user"). The constructor for this controller also requires a data model.

Parameters:
view -
model -
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Any mouse click at any position in the display causes the dot closest to the mouse click to be nudged to the right.

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