p_controllers
Class PaddleController

java.lang.Object
  extended by p_abstractions.PaddleControllerAbstraction
      extended by p_controllers.PaddleController
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class PaddleController
extends PaddleControllerAbstraction

Extends PaddleControllerAbstraction

A simple paddle controller for use in a video game.
Typing a character on the keyboard changes direction of movement of the Paddle.
For teaching MVC design pattern.

Version:
1.0.0
Author:
J Paul Gibson

Constructor Summary
PaddleController(PaddleSpecification rvPaddle)
           
 
Method Summary
 void keyTyped(java.awt.event.KeyEvent e)
          Change direction when a key is typed
 
Methods inherited from class p_abstractions.PaddleControllerAbstraction
keyPressed, keyReleased
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaddleController

public PaddleController(PaddleSpecification rvPaddle)
Parameters:
rvPaddle - is the model to be controlled by the controller
Method Detail

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Change direction when a key is typed

Specified by:
keyTyped in interface java.awt.event.KeyListener
Specified by:
keyTyped in class PaddleControllerAbstraction
Parameters:
e - is the event generated by the keyboard