at.ofai.music.beatroot
Class ZoomListener

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

 class ZoomListener
extends java.lang.Object
implements java.awt.event.ActionListener

A listener class for notifying the GUI's main panel about changes in the zoom level.


Field Summary
(package private)  BeatTrackDisplay displayPanel
          The main data panel of BeatRoot's GUI
(package private)  javax.swing.JScrollBar scroller
          The scrollbar for selecting what part of the audio data is displayed
(package private)  javax.swing.JTextField valueField
          An editable text field containing the length (in seconds) of visible audio data
 
Constructor Summary
ZoomListener(BeatTrackDisplay btd, javax.swing.JScrollBar sb, javax.swing.JTextField vf)
          Constructor:
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when a zoom button is pressed or the text field is edited.
static double delta(double value, double sign)
          Increments or decrements and rounds the length of visible audio data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scroller

javax.swing.JScrollBar scroller
The scrollbar for selecting what part of the audio data is displayed


displayPanel

BeatTrackDisplay displayPanel
The main data panel of BeatRoot's GUI


valueField

javax.swing.JTextField valueField
An editable text field containing the length (in seconds) of visible audio data

Constructor Detail

ZoomListener

public ZoomListener(BeatTrackDisplay btd,
                    javax.swing.JScrollBar sb,
                    javax.swing.JTextField vf)
Constructor:

Parameters:
btd - The main data panel of BeatRoot's GUI
sb - The scrollbar for selecting what part of the audio data is displayed
vf - The text field containing the length (in seconds) of visible audio data
Method Detail

delta

public static double delta(double value,
                           double sign)
Increments or decrements and rounds the length of visible audio data.

Parameters:
value - The original length of visible audio data
sign - The direction of change (+1.0 or -1.0)
Returns:
The new length of visible audio data

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when a zoom button is pressed or the text field is edited. Implements the ActionListener interface.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The object indicating what kind of event occurred