simulation_MVC_Basic
Class Controller
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static java.util.logging.Logger logger
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
-
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