All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class game.GameClient

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----com.sun.java.swing.JFrame
                                           |
                                           +----game.GameClient

public class GameClient
extends JFrame
implements GameLinkConstants
The GameClient class is the main class of the jags client. It contains the main method which is used to start the client.

This is a GUI oriented client for connecting to jags GameServer servers. The interface is built using the swing classes from Sun Microsystems.

[FINISH ME]

See Also:
GameServer

Variable Index

 o aboutIcon
 o debug
Class debug mode
 o DO_PROMPT
internal constant
 o HEIGHT
Frame height
 o joinGameButton
The JoinGame Button
 o myThis
this is us, the current GameClient instance
 o openIcon
 o serverCloseButton
The Server Close Button
 o serverHandlers
List of Servers currently opened.
 o serverName
Default server name [PROPERTY ME]
 o serverPort
Default server port [PROPERTY ME]
 o WIDTH
Frame width

Constructor Index

 o GameClient(String)
Creates a new GameClient.

Method Index

 o closeServerDialog()
 o connectDialog()
Pops a dialog and prompt user for a server to connect to.
 o createMenuBar()
Creates the Menu Bar.
 o createToolBar()
Creates the ToolBar.
 o doGameConnect(GameInfo, ServerHandler)
[DESCRIBE ME]
 o doOpenServer(String, int)
Initiates a connection with a new server, on the specified port.
 o doTerminate(boolean)
Terminates the game client after having prompted for confirmation.
 o getJoinGameButton()
Returns the toolbar JoinGame button.
 o getServerCloseButton()
Returns the toolbar ServerClose button
 o joinGameDialog()
 o loadImages()
Load images.
 o main(String[])
The GameClient entry point.

Variables

 o WIDTH
 static int WIDTH
Frame width

 o HEIGHT
 static int HEIGHT
Frame height

 o DO_PROMPT
 static final boolean DO_PROMPT
internal constant

 o debug
 final boolean debug
Class debug mode

 o openIcon
 public ImageIcon openIcon
 o aboutIcon
 public ImageIcon aboutIcon
 o serverCloseButton
 JButton serverCloseButton
The Server Close Button

 o joinGameButton
 JButton joinGameButton
The JoinGame Button

 o serverName
 String serverName
Default server name [PROPERTY ME]

 o serverPort
 int serverPort
Default server port [PROPERTY ME]

 o myThis
 GameClient myThis
this is us, the current GameClient instance

 o serverHandlers
 ServerHandlers serverHandlers
List of Servers currently opened.

Constructors

 o GameClient
 public GameClient(String title)
Creates a new GameClient. Also creates all the gui components.

Parameters:
title - the gui window title.

Methods

 o doOpenServer
 public void doOpenServer(String serverName,
                          int serverPort)
Initiates a connection with a new server, on the specified port. The server should be listening to this port (TCP connection). The name and port informations can be prompted to the user using the connectDialog() method.

Parameters:
serverName - the name or IP address of the server.
serverPort - the port which the server listens to.
See Also:
connectDialog
 o main
 public static void main(String args[])
The GameClient entry point. Creates a new GameClient, sets it up and starts the client interface.

Parameters:
args - the command line arguments passed to the method.
 o doTerminate
 public void doTerminate(boolean prompt)
Terminates the game client after having prompted for confirmation.

Parameters:
prompt - whether we should prompt for confirmation.
 o createMenuBar
 JMenuBar createMenuBar()
Creates the Menu Bar.

 o createToolBar
 JToolBar createToolBar()
Creates the ToolBar.

 o loadImages
 public void loadImages()
Load images.

 o connectDialog
 public void connectDialog()
Pops a dialog and prompt user for a server to connect to. Then calls the doOpenServer() method to do the actual work.

See Also:
doOpenServer
 o closeServerDialog
 public void closeServerDialog()
 o joinGameDialog
 public void joinGameDialog()
 o doGameConnect
 public void doGameConnect(GameInfo info,
                           ServerHandler server)
[DESCRIBE ME]

 o getServerCloseButton
 public JButton getServerCloseButton()
Returns the toolbar ServerClose button

 o getJoinGameButton
 public JButton getJoinGameButton()
Returns the toolbar JoinGame button.


All Packages  Class Hierarchy  This Package  Previous  Next  Index