public class SoundExplorer
extends java.lang.Object
implements java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.MouseListener, javax.sound.sampled.LineListener
Constructor and Description |
---|
SoundExplorer(SimpleSound sound,
boolean inStereo)
Constructor that takes a sound and a boolean flag
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Method to handle an action event
|
void |
checkScroll()
Method to check that the current position is in the viewing area and if
not scroll to center the current position if possible
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Handle a mouse click event
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Method to handle a mouse dragged event
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Method to handle a mouse entered event
|
void |
mouseExited(java.awt.event.MouseEvent e)
Method to handle a mouse exited event
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Method to handle a mouse move event
|
void |
mousePressed(java.awt.event.MouseEvent e)
Method to handle a mouse press
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Method to handle a mouse release
|
void |
setBase(int base)
Method to set the base for the index.
|
void |
setTitle(java.lang.String s)
Method to set the title on the main window
|
void |
update(javax.sound.sampled.LineEvent e)
Method to handle the line event update
|
public SoundExplorer(SimpleSound sound, boolean inStereo)
sound
- the sound to viewinStereo
- true if you want to show it in stereopublic void setTitle(java.lang.String s)
s
- the string to use as the titlepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- the mouse eventpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- the mouse eventpublic void update(javax.sound.sampled.LineEvent e)
update
in interface javax.sound.sampled.LineListener
e
- the line eventpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the action eventpublic void checkScroll()
public void setBase(int base)
base
- the new base to use (for example use setBase(1))
to use base 1 instead of 0