net.bluebones.boggle
Class UI

java.lang.Object
  extended by net.bluebones.boggle.UI

public class UI
extends Object

User Interface for Boggle.

Version:
0.3 $Revision: 1.6 $
Author:
Thomas David Baker,

Constructor Summary
UI(HumanPlayer player)
          Initialises this UI.
 
Method Summary
 void endGame()
          Ends the game by showing a dialog and beeping.
 Theme getTheme()
          Gets the board's currently active Theme.
 String[] getWords()
          Gets the words currenlty in the word area of this UI.
 void info(String msg)
          Displays an information dialog with the specified message.
 void initWordArea()
          Empties the word area and makes it possible to enter words.
 void problem(String errMsg)
          Displays an error message dialog with the specified message.
 void resetTimer()
          Sets the timer progress bar back to 0.
 void setBoard(char[][] letters)
          Initialises the board in this UI to hold the specified letters.
 void setConnection(ConnectionType type, String addr, int clients)
          Sets the connection information visible in this UI.
 void setConnection(ConnectionType type, String addr, int clients, int dots)
          Sets the displayed connection in this UI.
 void setRubber(Rubber r)
          Sets the displayed rubber details.
 void setTheme(Theme theme)
          Sets the board's currently active Theme.
 void setTimer(int tenthsOfASecond)
          Sets the timer to the specified amount.
 void setTimerMaximum(int timeInSecs)
          Sets the maximum time of the timer in this UI.
 void showResults(String results)
          Displays the results to the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UI

public UI(HumanPlayer player)
Initialises this UI.

Parameters:
player - HumanPlayer to whom this UI belongs.
Method Detail

setBoard

public void setBoard(char[][] letters)
Initialises the board in this UI to hold the specified letters.

Parameters:
letters - Letters to populate the board with.

initWordArea

public void initWordArea()
Empties the word area and makes it possible to enter words.


resetTimer

public void resetTimer()
Sets the timer progress bar back to 0.


info

public void info(String msg)
Displays an information dialog with the specified message.

Parameters:
msg - Message to display.

problem

public void problem(String errMsg)
Displays an error message dialog with the specified message.

Parameters:
errMsg - Error message to display.

endGame

public void endGame()
Ends the game by showing a dialog and beeping.


setTimer

public void setTimer(int tenthsOfASecond)
Sets the timer to the specified amount. Measured in tenths of a second.

Parameters:
tenthsOfASecond - Amount to iset the timer to in in tenths of a second.

setTimerMaximum

public void setTimerMaximum(int timeInSecs)
Sets the maximum time of the timer in this UI.

Parameters:
timeInSecs - Maximum time to set the timer to.

setConnection

public void setConnection(ConnectionType type,
                          String addr,
                          int clients)
Sets the connection information visible in this UI.

Parameters:
type - ConnectionType of current connection.
addr - Address of the host.
clients - Number of clients attached to this player.

setConnection

public void setConnection(ConnectionType type,
                          String addr,
                          int clients,
                          int dots)
Sets the displayed connection in this UI.

Parameters:
type - ConnectionType of current connection.
addr - Address of the host.
clients - Number of clients attached to this player.
dots - Number of dots to display (to animate while connecting).

setRubber

public void setRubber(Rubber r)
Sets the displayed rubber details.

Parameters:
r - Rubber details to display.

getWords

public String[] getWords()
Gets the words currenlty in the word area of this UI.

Returns:
String[] of words.

showResults

public void showResults(String results)
Displays the results to the user.

Parameters:
results - String results to display.

setTheme

public void setTheme(Theme theme)
Sets the board's currently active Theme.

Parameters:
theme - Theme to set active.

getTheme

public Theme getTheme()
Gets the board's currently active Theme.

Returns:
Theme