org.lyra.Interface
Class PlayerCompactFrame.Interact

java.lang.Object
  extended by org.lyra.Interface.PlayerCompactFrame.Interact
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.util.EventListener, javax.swing.event.ChangeListener, PendulumListener, UpdateListener
Enclosing class:
PlayerCompactFrame

private class PlayerCompactFrame.Interact
extends java.lang.Object
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, UpdateListener, PendulumListener, java.awt.event.WindowListener

The code separation from the user interface. This Class handles all of the complexities of making the interface interactive.

Author:
Martin Foster

Field Summary
private  java.util.List<java.util.Map<java.lang.String,java.lang.String>> Playlist
           
private  boolean SliderClient
           
private  java.util.Map<java.lang.String,java.lang.String> State
           
 
Constructor Summary
PlayerCompactFrame.Interact()
          Base constructor for the class.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 java.lang.String getNumber(java.lang.Long value)
          Simple method which will take a number and convert it to a string maintaining elements such as an additional zero for formatting.
 void hostUpdated(UpdateEvent update)
          Updates of host information as passed through this specific method.
 void pendulumUpdated(int elapsed, int total)
          In order to try and maintain a certain amount of efficiency it was deemed a bit much to create a class containing a lot of additional information.
 void stateChanged(javax.swing.event.ChangeEvent evt)
           
private  void stateMixer()
          Updates Mixer elements in the panel.
private  void statePlayer()
          Updates Player controls in the panel.
private  void updateState()
          This method will update various elements to reflect current state information from the Host itself.
private  void updateTime()
          Method which is used after the base is in to ensure that all of the time elements are updated to match initial state.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent evt)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

State

private java.util.Map<java.lang.String,java.lang.String> State

Playlist

private java.util.List<java.util.Map<java.lang.String,java.lang.String>> Playlist

SliderClient

private boolean SliderClient
Constructor Detail

PlayerCompactFrame.Interact

public PlayerCompactFrame.Interact()
Base constructor for the class.

Method Detail

getNumber

public java.lang.String getNumber(java.lang.Long value)
Simple method which will take a number and convert it to a string maintaining elements such as an additional zero for formatting.

Parameters:
value - Number to convert.
Returns:
String of converted and formatted number.

updateTime

private void updateTime()
Method which is used after the base is in to ensure that all of the time elements are updated to match initial state.


updateState

private void updateState()
This method will update various elements to reflect current state information from the Host itself.


statePlayer

private void statePlayer()
Updates Player controls in the panel.


stateMixer

private void stateMixer()
Updates Mixer elements in the panel.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

hostUpdated

public void hostUpdated(UpdateEvent update)
Description copied from interface: UpdateListener
Updates of host information as passed through this specific method. Multiple updates can be triggered from this, so it becomes important to check for a specific update if necessary in order to avoid undue

Specified by:
hostUpdated in interface UpdateListener
Parameters:
update - Update notification method.
See Also:
UpdateEvent

pendulumUpdated

public void pendulumUpdated(int elapsed,
                            int total)
Description copied from interface: PendulumListener
In order to try and maintain a certain amount of efficiency it was deemed a bit much to create a class containing a lot of additional information. Instead we just pass on the appropriate values to the listener.

Specified by:
pendulumUpdated in interface PendulumListener
Parameters:
elapsed - Integer carrying current runtime.
total - Integer representing total play time.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent evt)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent evt)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener