at.ofai.music.beatroot
Class EventProcessor

java.lang.Object
  extended by at.ofai.music.beatroot.EventProcessor
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.util.EventListener

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

Key, menu, and button event processing. All user interaction with the system is processed by the single EventProcessor object, which has handles to the other main objects for performing the requested actions.


Field Summary
protected  AudioPlayer audioPlayer
          Handle to BeatRoot's audio player
protected  AudioProcessor audioProcessor
          Handle to BeatRoot's audio processor
protected  Chooser chooser
          Handle to BeatRoot's file chooser
static boolean debug
          Flag for enabling debugging output
protected  GUI gui
          Handle to BeatRoot's GUI
 
Constructor Summary
EventProcessor(GUI g, AudioPlayer ap, AudioProcessor proc, Chooser ch)
          Constructor:
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Processes all user menu and button actions.
 void keyPressed(java.awt.event.KeyEvent e)
          Processes user key events which are not associated with menu items.
 void keyReleased(java.awt.event.KeyEvent e)
          Ignore key releases, since processing is performed as soon as the key is pressed.
 void keyTyped(java.awt.event.KeyEvent e)
          Ignore KeyEvents indicating that a key was typed, since keyPressed() has already dealt with this keystroke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gui

protected GUI gui
Handle to BeatRoot's GUI


audioPlayer

protected AudioPlayer audioPlayer
Handle to BeatRoot's audio player


audioProcessor

protected AudioProcessor audioProcessor
Handle to BeatRoot's audio processor


chooser

protected Chooser chooser
Handle to BeatRoot's file chooser


debug

public static boolean debug
Flag for enabling debugging output

Constructor Detail

EventProcessor

public EventProcessor(GUI g,
                      AudioPlayer ap,
                      AudioProcessor proc,
                      Chooser ch)
Constructor:

Parameters:
g - Handle to BeatRoot's GUI
ap - Handle to BeatRoot's audio player
proc - Handle to BeatRoot's audio processor
ch - Handle to BeatRoot's file chooser
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Processes all user menu and button actions.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The Java event handling system's representation of the user action

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Processes user key events which are not associated with menu items. Keystrokes are only processed if no modifiers are present (e.g. shift, alt, mouse buttons). Since key releases are considered irrelevant, all processing is done here.

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Ignore key releases, since processing is performed as soon as the key is pressed. Implements part of interface KeyListener

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Ignore KeyEvents indicating that a key was typed, since keyPressed() has already dealt with this keystroke. Implements part of interface KeyListener

Specified by:
keyTyped in interface java.awt.event.KeyListener