at.ofai.music.beatroot

Class ZoomListener

class ZoomListener extends Object implements ActionListener

A listener class for notifying the GUI's main panel about changes in the zoom level.
Field Summary
BeatTrackDisplaydisplayPanel
The main data panel of BeatRoot's GUI
JScrollBarscroller
The scrollbar for selecting what part of the audio data is displayed
JTextFieldvalueField
An editable text field containing the length (in seconds) of visible audio data
Constructor Summary
ZoomListener(BeatTrackDisplay btd, JScrollBar sb, JTextField vf)
Constructor:
Method Summary
voidactionPerformed(ActionEvent e)
Called when a zoom button is pressed or the text field is edited.
static doubledelta(double value, double sign)
Increments or decrements and rounds the length of visible audio data.

Field Detail

displayPanel

BeatTrackDisplay displayPanel
The main data panel of BeatRoot's GUI

scroller

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

valueField

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

Constructor Detail

ZoomListener

public ZoomListener(BeatTrackDisplay btd, JScrollBar sb, 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

actionPerformed

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

Parameters: e The object indicating what kind of event occurred

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