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
-
aboutIcon
-
-
debug
- Class debug mode
-
DO_PROMPT
- internal constant
-
HEIGHT
- Frame height
-
joinGameButton
- The JoinGame Button
-
myThis
- this is us, the current GameClient instance
-
openIcon
-
-
serverCloseButton
- The Server Close Button
-
serverHandlers
- List of Servers currently opened.
-
serverName
- Default server name [PROPERTY ME]
-
serverPort
- Default server port [PROPERTY ME]
-
WIDTH
- Frame width
-
GameClient(String)
- Creates a new GameClient.
-
closeServerDialog()
-
-
connectDialog()
- Pops a dialog and prompt user for a server to connect to.
-
createMenuBar()
- Creates the Menu Bar.
-
createToolBar()
- Creates the ToolBar.
-
doGameConnect(GameInfo, ServerHandler)
- [DESCRIBE ME]
-
doOpenServer(String, int)
- Initiates a connection with a new server, on the specified port.
-
doTerminate(boolean)
- Terminates the game client after having prompted for
confirmation.
-
getJoinGameButton()
- Returns the toolbar JoinGame button.
-
getServerCloseButton()
- Returns the toolbar ServerClose button
-
joinGameDialog()
-
-
loadImages()
- Load images.
-
main(String[])
- The GameClient entry point.
WIDTH
static int WIDTH
- Frame width
HEIGHT
static int HEIGHT
- Frame height
DO_PROMPT
static final boolean DO_PROMPT
- internal constant
debug
final boolean debug
- Class debug mode
openIcon
public ImageIcon openIcon
aboutIcon
public ImageIcon aboutIcon
serverCloseButton
JButton serverCloseButton
- The Server Close Button
joinGameButton
JButton joinGameButton
- The JoinGame Button
serverName
String serverName
- Default server name [PROPERTY ME]
serverPort
int serverPort
- Default server port [PROPERTY ME]
myThis
GameClient myThis
- this is us, the current GameClient instance
serverHandlers
ServerHandlers serverHandlers
- List of Servers currently opened.
GameClient
public GameClient(String title)
- Creates a new GameClient. Also creates all the gui components.
- Parameters:
- title - the gui window title.
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
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.
doTerminate
public void doTerminate(boolean prompt)
- Terminates the game client after having prompted for
confirmation.
- Parameters:
- prompt - whether we should prompt for confirmation.
createMenuBar
JMenuBar createMenuBar()
- Creates the Menu Bar.
createToolBar
JToolBar createToolBar()
- Creates the ToolBar.
loadImages
public void loadImages()
- Load images.
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
closeServerDialog
public void closeServerDialog()
joinGameDialog
public void joinGameDialog()
doGameConnect
public void doGameConnect(GameInfo info,
ServerHandler server)
- [DESCRIBE ME]
getServerCloseButton
public JButton getServerCloseButton()
- Returns the toolbar ServerClose button
getJoinGameButton
public JButton getJoinGameButton()
- Returns the toolbar JoinGame button.
All Packages Class Hierarchy This Package Previous Next Index