org.lyra.Interface
Class PlayerPanel.Interact

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

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

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 static java.lang.String CLASS
           
private  java.util.List<java.util.Map<java.lang.String,java.lang.String>> Playlist
           
private  boolean SliderClient
           
private  boolean SliderProcess
           
private  java.util.Map<java.lang.String,java.lang.String> State
           
 
Constructor Summary
PlayerPanel.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 stateOptions()
          Updates Host Options 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.
 
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

SliderProcess

private boolean SliderProcess

SliderClient

private boolean SliderClient

CLASS

private static final java.lang.String CLASS
See Also:
Constant Field Values
Constructor Detail

PlayerPanel.Interact

public PlayerPanel.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.


stateOptions

private void stateOptions()
Updates Host Options 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