de.kosi.gui
Class Client

java.lang.Object
  |
  +--de.kosi.AbstractClient
        |
        +--de.kosi.gui.Client
All Implemented Interfaces:
FoyerListener, java.rmi.Remote

public class Client
extends AbstractClient

The main application class.

ChangeLog:

 $Log: Client.java,v $
 Revision 1.37  2001/08/30 08:48:12  madmanmoon
 Waiting for hide of MainWindow realized with wait/notify now.

 Revision 1.35  2001/08/28 10:06:17  madmanmoon
 SplitFoyerView heisst jetzt FoyerView.

 Revision 1.34  2001/08/23 12:58:30  madmanmoon
 BiddingHistory works but PlayHistory doesn't.

 Revision 1.33  2001/07/24 12:45:18  madmanmoon
 MainWindow extends CWindow instead of CDialog now.

 Revision 1.32  2001/07/19 11:42:12  jiriki
 - Fixed Bug in TrickPane.
 - Started implementation of tournament.

 Revision 1.31  2001/07/16 12:58:15  jiriki
 (Probably) Fixed 440331.

 Revision 1.30  2001/07/11 10:06:01  jiriki
 Fixed Bug 440025.

 Revision 1.29  2001/07/04 12:34:29  uid30828
 - Rubber score implemented
 - Inviting now working

 Revision 1.28  2001/07/02 17:37:18  jiriki
 - New Implementation of SSL Authorization
 - Implemented Client-Side Persistence

 Revision 1.27  2001/06/27 19:09:18  jiriki
 Resolved minor bugs. Updated docs.

 

Version:
$Revision: 1.37 $ ($Date: 2001/08/30 08:48:12 $)
Author:
PG KoSI

Field Summary
static int STATUS_CREATE_ACCOUNT
          Client Status while creating a new account
static int STATUS_EXIT
          Client Status while exiting.
static int STATUS_LOGIN
          Client Status while logging into the server
static int STATUS_MAINFRAME
          Client Status while showing the main window
static int STATUS_RECONNECT
          Client Status while trying to reconnect
 
Constructor Summary
Client()
          An empty constructor.
 
Method Summary
 void abortConnection(java.lang.String messageName)
          Display a message and reconnect or exit.
 void disconnect()
          Called by the server, when disconnected
 CResourceBundle getResourceBundle()
          Gets this application's resourceBundle.
 void init(java.lang.String[] args)
          Initializes the client.
 void invite(Table table, User byUser, int direction)
          This method will be called if another user invites the user who registered this listener to take a seat at a specific table.
 void invite(Tournament tournament)
          This method will be called if another user invites the user who registered this listener to take part in a specific tournament.
static void main(java.lang.String[] args)
          The application's entry point.
 void notify(Game game)
          A call of this method notifies the user who registered this listener that he is currently playing the given game.
 void notify(Table table)
          A call of this method notifies the user who registered this listener that he is currently sitting at the given table.
 void notify(Tournament tournament)
          A call of this method notifies the user who registered this listener that he is currently taking part in the given tournament.
 void run()
          Run the client.
 
Methods inherited from class de.kosi.AbstractClient
connect, disconnectFromServer, getFoyer, login, logout, ping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATUS_EXIT

public static final int STATUS_EXIT
Client Status while exiting.

STATUS_LOGIN

public static final int STATUS_LOGIN
Client Status while logging into the server

STATUS_MAINFRAME

public static final int STATUS_MAINFRAME
Client Status while showing the main window

STATUS_CREATE_ACCOUNT

public static final int STATUS_CREATE_ACCOUNT
Client Status while creating a new account

STATUS_RECONNECT

public static final int STATUS_RECONNECT
Client Status while trying to reconnect
Constructor Detail

Client

public Client()
An empty constructor.
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The application's entry point. Creates a client instance and calls it's init method.
Parameters:
args - the command line arguments.

init

public void init(java.lang.String[] args)
Initializes the client. Ought to match the Applet.init() signature in future.
Parameters:
args - the argument strings.

run

public void run()
Run the client.

disconnect

public void disconnect()
Called by the server, when disconnected
Overrides:
disconnect in class AbstractClient
Following copied from interface: de.kosi.model.FoyerListener
Throws:
java.rmi.RemoteException - If the remote call of this method fails.

getResourceBundle

public CResourceBundle getResourceBundle()
Gets this application's resourceBundle.
Returns:
the resourceBundle field.

invite

public void invite(Table table,
                   User byUser,
                   int direction)
This method will be called if another user invites the user who registered this listener to take a seat at a specific table. Only table owners may invite other users, so you get the inviter by the table's getOwner() method.
Parameters:
table - The table the user gets invited to.

invite

public void invite(Tournament tournament)
This method will be called if another user invites the user who registered this listener to take part in a specific tournament. (How do you get the inviter's nickname???)
Parameters:
tournament - The tournament the user gets invited to.

notify

public void notify(Game game)
A call of this method notifies the user who registered this listener that he is currently playing the given game. This might be necessary if the user interimely lost his connection and its client got confused.
Parameters:
game - The game the user is currently playing.

notify

public void notify(Table table)
A call of this method notifies the user who registered this listener that he is currently sitting at the given table. This might be necessary if the user interimely lost his connection and its client got confused.
Parameters:
table - The table the user is currently sitting at.

notify

public void notify(Tournament tournament)
A call of this method notifies the user who registered this listener that he is currently taking part in the given tournament. This might be necessary if the user interimely lost his connection and its client got confused.
Parameters:
tournament - The tournament the user is currently taking part in.

abortConnection

public void abortConnection(java.lang.String messageName)
Display a message and reconnect or exit.
Parameters:
messageName - Name of the message displayed.