ks.client.interfaces
Interface IClientInterface

All Known Subinterfaces:
IClientInterface2

public interface IClientInterface

Represents the interaction expected by any Kombat GUI element. In our case, KombatClient satisfies.


Method Summary
 boolean clearActiveGames()
          Remove all active games from visible representation.
 boolean clearActiveTables()
          Remove all active tables from visible representation.
 boolean clearActiveUsers()
          Remove all active users from visible representation.
 boolean interpret(Message m)
          Responses from the server are Message objects.
 void output(java.lang.String s)
          output to some central viewing area (typically control window)
 java.awt.Frame parentFrame()
          Return the parent Frame object from which any ClientComponent can reference when creating modal dialogs.
 boolean registerActiveGame(java.lang.String name, boolean register)
          Add/Remove specified game to list of active games.
 boolean registerActiveTable(java.lang.String tableType, java.lang.String name, boolean register)
          Add specified table to list of active tables for the given type.
 boolean registerActiveUser(java.lang.String name, boolean register)
          Add/Remove specified user to list of active users.
 void registerGame(java.lang.String gameName, boolean register)
          Register/Deregister game from list of games.
 void sendCommand(Command sc)
          Send command to the server to be processed.
 void serverReady()
          Callback invoked once the Server has been connected.
 void status(java.lang.String s)
          Update status field to contain given string.
 boolean validateJoinRequest(java.lang.String tableName, java.lang.String name)
          Validate the request by given user to join given table.
 

Method Detail

clearActiveGames

public boolean clearActiveGames()
Remove all active games from visible representation.

Returns:
boolean

clearActiveTables

public boolean clearActiveTables()
Remove all active tables from visible representation.

Returns:
boolean

clearActiveUsers

public boolean clearActiveUsers()
Remove all active users from visible representation.

Returns:
boolean

registerGame

public void registerGame(java.lang.String gameName,
                         boolean register)
Register/Deregister game from list of games.

This functionality is exposed because the set of games available on the client side can change dynamically.


interpret

public boolean interpret(Message m)
Responses from the server are Message objects. Interpret each message received from server.


output

public void output(java.lang.String s)
output to some central viewing area (typically control window)


registerActiveGame

public boolean registerActiveGame(java.lang.String name,
                                  boolean register)
Add/Remove specified game to list of active games.

Parameters:
register - decision to register or unregister
name - name of the game type.
Returns:
boolean

registerActiveTable

public boolean registerActiveTable(java.lang.String tableType,
                                   java.lang.String name,
                                   boolean register)
Add specified table to list of active tables for the given type.

Parameters:
tableType - type of the game.
name - name of the table.
register - decision to register or unregister
Returns:
boolean

registerActiveUser

public boolean registerActiveUser(java.lang.String name,
                                  boolean register)
Add/Remove specified user to list of active users.

Parameters:
register - register or deregister.
name - String name of user.
Returns:
boolean

sendCommand

public void sendCommand(Command sc)
Send command to the server to be processed.

Parameters:
sc -

serverReady

public void serverReady()
Callback invoked once the Server has been connected.


status

public void status(java.lang.String s)
Update status field to contain given string.

Parameters:
s - Set status text field to contain value.

validateJoinRequest

public boolean validateJoinRequest(java.lang.String tableName,
                                   java.lang.String name)
Validate the request by given user to join given table.

Parameters:
name - java.lang.String
Returns:
boolean

parentFrame

public java.awt.Frame parentFrame()
Return the parent Frame object from which any ClientComponent can reference when creating modal dialogs.

Returns:
Frame object that can be used to host Dialogs.