com.liquidatom.derbyscore.ui
Class ControlWindowTeamListener

java.lang.Object
  extended by com.liquidatom.derbyscore.ui.ControlWindowTeamListener
All Implemented Interfaces:
TeamListener, java.io.Serializable

@Immutable
@ThreadSafe
public class ControlWindowTeamListener
extends java.lang.Object
implements TeamListener, java.io.Serializable

A listener implementation which will listen for changes to a teams state and update some common user-interface elements in conjunction with the event.

Author:
Russell Francis (russ@metro-six.com)
See Also:
Serialized Form

Nested Class Summary
protected  class ControlWindowTeamListener.UpdateRunnable
          Holds the relevent state for the Team which has changed and can be run to update user-interface elements within the AWT event-dispatch thread.
 
Constructor Summary
ControlWindowTeamListener(javax.swing.JButton teamButton, javax.swing.JLabel teamLabel, javax.swing.JSpinner scoreSpinner, javax.swing.JSpinner jamSpinner, javax.swing.JSpinner timeoutSpinner)
          Construct a new listener which will update the provided user-interface elements if they are provided.
 
Method Summary
protected  java.awt.GraphicsConfiguration getDefaultGraphicsConfiguration()
          Get the DefaultGraphicsConfiguration.
protected  ControlWindowTeamListener.UpdateRunnable newUpdateRunnable(Team team)
          Construct a new UpdateRunnable instance which is used to update the state of the user-interface components inside of the AWT event dispatching thread.
 void onChanged(Team team)
          Invoked when state on the team has been changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlWindowTeamListener

public ControlWindowTeamListener(javax.swing.JButton teamButton,
                                 javax.swing.JLabel teamLabel,
                                 javax.swing.JSpinner scoreSpinner,
                                 javax.swing.JSpinner jamSpinner,
                                 javax.swing.JSpinner timeoutSpinner)
Construct a new listener which will update the provided user-interface elements if they are provided.

Parameters:
teamButton - The button which representes the team.
teamLabel - The label containing the team name.
scoreSpinner - The JSpinner which holds the teams current score.
jamSpinner - The JSpinner which holds the teams score for the current jam.
timeoutSpinner - The JSpinner which holds the number of timeouts for the team.
Method Detail

onChanged

public void onChanged(Team team)
Invoked when state on the team has been changed.

Specified by:
onChanged in interface TeamListener
Parameters:
team - The team whose state has recently changed.

getDefaultGraphicsConfiguration

protected java.awt.GraphicsConfiguration getDefaultGraphicsConfiguration()
Get the DefaultGraphicsConfiguration.

Returns:
The GraphicsConfiguration for the default screen.

newUpdateRunnable

protected ControlWindowTeamListener.UpdateRunnable newUpdateRunnable(Team team)
Construct a new UpdateRunnable instance which is used to update the state of the user-interface components inside of the AWT event dispatching thread.

Parameters:
team - The team whose state has changed.
Returns:
An UpdateRunnable instance which can be used to update the user-interface state based on the recent changes to the teams state.