L20_pkg
Class DotController

java.lang.Object
  extended by L20_pkg.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 MouseListener that is installed upon a particular JFrame. When a mouse clicked event is detected, this controller changes the PolkaDotDataModel by adding a random polka dot.

Author:
mb

Constructor Summary
DotController(javax.swing.JFrame view, PolkaDotDataModel model)
           
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          This method causes the data model to be changed when a mouse click event is detected.
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotController

public DotController(javax.swing.JFrame view,
                     PolkaDotDataModel model)
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
This method causes the data model to be changed when a mouse click event is detected. A random polka dot is added to the data model. As well, a statement is printed to the console "Controller is changing the model"

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener