at.ofai.music.beatroot

Class EventProcessor

class EventProcessor extends Object implements ActionListener, 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 AudioPlayeraudioPlayer
Handle to BeatRoot's audio player
protected AudioProcessoraudioProcessor
Handle to BeatRoot's audio processor
protected Chooserchooser
Handle to BeatRoot's file chooser
static booleandebug
Flag for enabling debugging output
protected GUIgui
Handle to BeatRoot's GUI
Constructor Summary
EventProcessor(GUI g, AudioPlayer ap, AudioProcessor proc, Chooser ch)
Constructor:
Method Summary
voidactionPerformed(ActionEvent e)
Processes all user menu and button actions.
voidkeyPressed(KeyEvent e)
Processes user key events which are not associated with menu items.
voidkeyReleased(KeyEvent e)
Ignore key releases, since processing is performed as soon as the key is pressed.
voidkeyTyped(KeyEvent e)
Ignore KeyEvents indicating that a key was typed, since keyPressed() has already dealt with this keystroke.

Field Detail

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

gui

protected GUI gui
Handle to BeatRoot's GUI

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(ActionEvent e)
Processes all user menu and button actions.

Parameters: e The Java event handling system's representation of the user action

keyPressed

public void keyPressed(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.

keyReleased

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

keyTyped

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