JavaTron
Class AudioTronUI

java.lang.Object
  |
  +--JavaTron.AudioTronUI
All Implemented Interfaces:
java.awt.event.ActionListener, AudioTronListener, java.util.EventListener, java.awt.event.ItemListener

public class AudioTronUI
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.ItemListener, AudioTronListener

AudioTron user interface class. Pretty basic right now, simple ui with no true state.


Field Summary
static JavaTron.AudioTronState at
           
 
Fields inherited from interface JavaTron.AudioTronListener
STATE_PAUSED, STATE_PLAYING, STATE_STOPPED, STATE_UNKNOWN
 
Constructor Summary
AudioTronUI(JavaTron.AudioTronState at_)
          AudioTronUI constructor
 
Method Summary
protected  void about()
          Handler for the about button being pushed
 void actionPerformed(java.awt.event.ActionEvent e)
          React to an actionPerformed (button push)
 void currentSong(JavaTron.AudioTronSong song)
          Notification of the details of the current song playing
 void go()
          Call this to initialize the UI and show it
 void itemStateChanged(java.awt.event.ItemEvent e)
          React to an itemStateChanged event (checkboxes)
static void main(java.lang.String[] args)
          Main method - start of the program
 void mute(boolean muted_)
          Notification of mute state
protected static javax.swing.JLabel myJLabel(java.lang.String mlabel)
          Create a JLabel but make the font plain instead of super ugly BOLD
 void newSongQueue(java.util.Enumeration songList)
          Notification that a new song queue is available
 void nextSong(JavaTron.AudioTronSong song)
          Notification of the details of the next song to be played
 void random(boolean random_)
          Notification of random state
 void repeat(boolean repeat_)
          Notification of repeat state
 void songAdded(JavaTron.AudioTronSong song)
          Notification that a song has been added to the end of the playlist
 void songUpdated(JavaTron.AudioTronSong song)
          Notification that information about a particular song has been updated
 void state(int state)
          Notification of playing state.
 void status(java.lang.String status_, boolean longRunning)
          Notification of the AudioTron "controller enginer" status.
 void version(java.lang.String version)
          Notification of AudioTron version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

at

public static JavaTron.AudioTronState at
Constructor Detail

AudioTronUI

public AudioTronUI(JavaTron.AudioTronState at_)
AudioTronUI constructor

Parameters:
at_ - an initialized AudioTron component
Method Detail

go

public void go()
Call this to initialize the UI and show it


myJLabel

protected static javax.swing.JLabel myJLabel(java.lang.String mlabel)
Create a JLabel but make the font plain instead of super ugly BOLD

Returns:
an initialized JLabel with a PLAIN font

about

protected void about()
Handler for the about button being pushed


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
React to an actionPerformed (button push)

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the ActionEvent that was sent

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
React to an itemStateChanged event (checkboxes)

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - the ItemEvent

mute

public void mute(boolean muted_)
Description copied from interface: AudioTronListener
Notification of mute state

Specified by:
mute in interface AudioTronListener
Parameters:
muted_ - true if muted, false otherwise

repeat

public void repeat(boolean repeat_)
Description copied from interface: AudioTronListener
Notification of repeat state

Specified by:
repeat in interface AudioTronListener
Parameters:
repeat_ - true if repeat is set, false otherwise

random

public void random(boolean random_)
Description copied from interface: AudioTronListener
Notification of random state

Specified by:
random in interface AudioTronListener
Parameters:
random_ - true if random is set, false otherwise

state

public void state(int state)
Description copied from interface: AudioTronListener
Notification of playing state.

Specified by:
state in interface AudioTronListener
Parameters:
state - can be one of AudioTronListener.STATE_UNKNOWN, AudioTronListener.STATE_PLAYING, AudioTronListener.STATE_PAUSED, AudioTronListener.STATE_STOPPED

version

public void version(java.lang.String version)
Description copied from interface: AudioTronListener
Notification of AudioTron version

Specified by:
version in interface AudioTronListener
Parameters:
version - The AudioTron version as reported by the AudioTron webpage

newSongQueue

public void newSongQueue(java.util.Enumeration songList)
Description copied from interface: AudioTronListener
Notification that a new song queue is available

Specified by:
newSongQueue in interface AudioTronListener

songAdded

public void songAdded(JavaTron.AudioTronSong song)
Description copied from interface: AudioTronListener
Notification that a song has been added to the end of the playlist

Specified by:
songAdded in interface AudioTronListener
Parameters:
song - the song that was added

currentSong

public void currentSong(JavaTron.AudioTronSong song)
Description copied from interface: AudioTronListener
Notification of the details of the current song playing

Specified by:
currentSong in interface AudioTronListener
Parameters:
song - the current song playing

nextSong

public void nextSong(JavaTron.AudioTronSong song)
Description copied from interface: AudioTronListener
Notification of the details of the next song to be played

Specified by:
nextSong in interface AudioTronListener
Parameters:
song - the next song to play

songUpdated

public void songUpdated(JavaTron.AudioTronSong song)
Description copied from interface: AudioTronListener
Notification that information about a particular song has been updated

Specified by:
songUpdated in interface AudioTronListener
Parameters:
song - the song that is being updated (it is gauranteed to have the title and index information filled in

status

public void status(java.lang.String status_,
                   boolean longRunning)
Description copied from interface: AudioTronListener
Notification of the AudioTron "controller enginer" status. This value is suitable for display to the user.

Specified by:
status in interface AudioTronListener
Parameters:
status_ - a string that indicates what the "engine" is doing
longRunning - this value is set if the current operation is long running. In the case that it is long running, status will be called repeatedly (likely with the same value) during the long running operation.

main

public static void main(java.lang.String[] args)
Main method - start of the program

Parameters:
args - command line args: [ipaddress] [name] [password]