simulation_MVC_Basic
Class Controller

java.lang.Object
  extended by simulation_MVC_Basic.Controller
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.util.EventListener

public class Controller
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.KeyListener

This class encapsulates a controller that is installed on an event dispatcher (the view). It implements various behaviours in response to user input events. All of these behaviours serve to mutate the Model. This class implements KeyListener.

Author:
mb

Field Summary
static java.util.logging.Logger logger
           
 
Constructor Summary
Controller(View gameCanvas, Model gameWorld)
          Instantiates a controller that is installed on the passed View and will, in response to user events, mutate the passed Model.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger
Constructor Detail

Controller

public Controller(View gameCanvas,
                  Model gameWorld)
Instantiates a controller that is installed on the passed View and will, in response to user events, mutate the passed Model.

Parameters:
gameCanvas -
gameWorld -
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent arg0)
Specified by:
keyTyped in interface java.awt.event.KeyListener