heurgame.ui
Class WelcomeScreen

java.lang.Object
  extended byheurgame.ui.WelcomeScreen
All Implemented Interfaces:
PlayerListener

public class WelcomeScreen
extends java.lang.Object
implements PlayerListener

Author:
David Kaplin Presents a screen that allows protocol independant choosing of the order of connecting players and that of the local players that are interfaced via HuClients

Constructor Summary
WelcomeScreen(GameServer gs)
          Constructs the WelcomeScreen builder
 
Method Summary
 java.awt.Frame getBuiltWelcome()
          Returns the Welcome Screen if it was built.
 java.awt.Frame getWelcome(java.lang.Runnable onStart, java.lang.Runnable onExit)
          Produces the WelcomeScreen as an AWT Frame.
 void playerJoined(PlayerEvent e)
          Notificies listeners when a player enters the game.
 void playerLeft(PlayerEvent e)
          Notifies listeners when a player leaves the game.
 void playerMoves(PlayerEvent e)
          Not used
 void playerStatusChanged(PlayerEvent e)
          Not used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WelcomeScreen

public WelcomeScreen(GameServer gs)
Constructs the WelcomeScreen builder

Parameters:
gs - handle to the GameServer to get information and access the general facade of the GameServer
Method Detail

getBuiltWelcome

public java.awt.Frame getBuiltWelcome()
Returns the Welcome Screen if it was built.

Returns:
null, if the screen was not built yet.

getWelcome

public java.awt.Frame getWelcome(java.lang.Runnable onStart,
                                 java.lang.Runnable onExit)
Produces the WelcomeScreen as an AWT Frame.

Parameters:
onStart - Called by the Start Button
onExit - Called by the exit button or by closing the window
Returns:
a complete AWT Frame ready for interaction

playerJoined

public void playerJoined(PlayerEvent e)
Description copied from interface: PlayerListener
Notificies listeners when a player enters the game.

Specified by:
playerJoined in interface PlayerListener
Parameters:
e - Player Specific information
See Also:
PlayerListener.playerJoined(heurgame.event.PlayerEvent)

playerLeft

public void playerLeft(PlayerEvent e)
Description copied from interface: PlayerListener
Notifies listeners when a player leaves the game.

Specified by:
playerLeft in interface PlayerListener
Parameters:
e - Player Specific information
See Also:
PlayerListener.playerLeft(heurgame.event.PlayerEvent)

playerMoves

public void playerMoves(PlayerEvent e)
Not used

Specified by:
playerMoves in interface PlayerListener
Parameters:
e - Information about the Player and the status of the Move
See Also:
PlayerListener.playerMoves(heurgame.event.PlayerEvent)

playerStatusChanged

public void playerStatusChanged(PlayerEvent e)
Not used

Specified by:
playerStatusChanged in interface PlayerListener
Parameters:
e - Implementation defined
See Also:
PlayerListener.playerStatusChanged(heurgame.event.PlayerEvent)