org.vigia.client.gui.controller
Class ClientController

java.lang.Object
  extended by org.vigia.client.gui.controller.ClientController
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, IRListener, Controller, FrameListener

public class ClientController
extends java.lang.Object
implements Controller

An implementation of the graphic user interface's controller.

Author:
Ada & Daniel Hector Stolfi Rosso & jrios & Toshi

Field Summary
protected  Communicator comm
          The communicator.
protected  Driver driver
          The driver of the IR sensor.
protected  MovementProcessor mp
          The movement processor.
protected  View view
          The view.
 
Constructor Summary
ClientController(View view, Driver driver, MovementProcessor mp)
          Creates a new controler for the view and the model.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void onIREvent(Coordinates c, int xVRes, int yVRes)
          Actions to do when the Wiimote detects a change in the position of the infrared leds.
 void onNewFrame(java.awt.image.BufferedImage frame)
          Receives a frame from the remote camera.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected View view
The view.


driver

protected Driver driver
The driver of the IR sensor.


comm

protected Communicator comm
The communicator.


mp

protected MovementProcessor mp
The movement processor.

Constructor Detail

ClientController

public ClientController(View view,
                        Driver driver,
                        MovementProcessor mp)
Creates a new controler for the view and the model.

Parameters:
view - The graphic user interface's view.
driver - The driver of the IR sensor.
mp - The movement processor.
Method Detail

actionPerformed

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

onNewFrame

public void onNewFrame(java.awt.image.BufferedImage frame)
Description copied from interface: FrameListener
Receives a frame from the remote camera.

Specified by:
onNewFrame in interface FrameListener
Parameters:
frame - the frame.
See Also:
FrameListener.onNewFrame(java.awt.image.BufferedImage)

onIREvent

public void onIREvent(Coordinates c,
                      int xVRes,
                      int yVRes)
               throws VigiaClientException,
                      java.io.IOException
Description copied from interface: IRListener
Actions to do when the Wiimote detects a change in the position of the infrared leds.

Specified by:
onIREvent in interface IRListener
Parameters:
c - the new coordinates of the Wiimote.
xVRes - IR virtual screen x resolution.
yVRes - IR virtual screen y resolution.
Throws:
VigiaClientException - error from the listener.
java.io.IOException - error with the communications.
See Also:
IRListener.onIREvent(org.vigia.client.driver.Coordinates, int, int)