|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.jogre.client.awt.JogreClientFrame
This abstract class declares the main game frame where a user can see users of the left, tables on the top right and a broadcasting style message chat box on the bottom right. To create a new client frame for a game, such as Chess for example, a class called e.g. ChessClientFrame extends this class and implements the following abstract methods:
public abstract JogreTableFrame getJogreTableFrame (ClientConnectionThread conn, Table table);
For the chess example this would look something like the following:
public JogreTableFrame getJogreTableFrame (TableConnectionThread conn)
{
// return a "Chess" table frame when join/creating a new table.
return new ChessTableFrame (conn, table);
}
Nested Class Summary |
Nested classes inherited from class javax.swing.JFrame |
JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JogreClientFrame(String[] args)
Constructor for a client frame. |
Method Summary | |
void |
connectOK(ClientConnectionThread conn)
Method which is called when a client connects successfully. |
ChatPrivateDialog |
getChatPrivateDialog(String usernameTo,
ClientConnectionThread conn)
Delegate method for receiving a private chat message. |
abstract JogreTableFrame |
getJogreTableFrame(TableConnectionThread conn)
This must be overwritten to get a handle on the correct table frame. |
void |
getPropertyDialog(ClientConnectionThread conn)
Delegate method for popping up a game property dialog box |
void |
getRulesDialog()
Delegate method for creating the rules dialog. |
void |
getUserDialog(User user)
Delegate method for create a user dialog. |
void |
parseCommandLineArguments(String[] args)
This method parses the commands handed in from the command prompt. |
void |
receiveGameMessage(XMLElement message)
Delegate method for receiving a game message. |
void |
receiveTableMessage(XMLElement message)
Delegate method for receiving a table message. |
void |
setUITitle(String title)
Set the title of this frame. |
void |
update(Observable o,
Object arg)
Delegate method for updating the panel. |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Constructor Detail |
public JogreClientFrame(String[] args)
Method Detail |
public abstract JogreTableFrame getJogreTableFrame(TableConnectionThread conn)
getJogreTableFrame
in interface IJogreClientGUI
conn
- Connection to server.
public void parseCommandLineArguments(String[] args)
This method parses the commands handed in from the command prompt. For example:
-lang=fr
args
- Additional arguments from the command line.public void connectOK(ClientConnectionThread conn)
connectOK
in interface IJogreClientGUI
conn
- Client connection thread.public void setUITitle(String title)
setUITitle
in interface IJogreClientGUI
title
- Title to set.IJogreClientGUI.setUITitle(java.lang.String)
public ChatPrivateDialog getChatPrivateDialog(String usernameTo, ClientConnectionThread conn)
getChatPrivateDialog
in interface IJogreClientGUI
usernameTo
- Username to talk to.conn
- Connection to the server.
IJogreClientGUI.getChatPrivateDialog(java.lang.String, org.jogre.client.ClientConnectionThread)
public void getPropertyDialog(ClientConnectionThread conn)
getPropertyDialog
in interface IJogreClientGUI
conn
- Connection to server.org.jogre.client.awt.IJogreClientGUI#getPropertyDialog(org.jogre.client.ClientConnectionThread, org.jogre.common.util.GameProperties)
public void getUserDialog(User user)
getUserDialog
in interface IJogreClientGUI
IJogreClientGUI.getUserDialog(org.jogre.common.User)
public void getRulesDialog()
getRulesDialog
in interface IJogreClientGUI
public void receiveGameMessage(XMLElement message)
receiveGameMessage
in interface IClient
message
- Game message from serverIClient.receiveGameMessage(nanoxml.XMLElement)
public void receiveTableMessage(XMLElement message)
receiveTableMessage
in interface ITable
message
- Message from server.ITable.receiveTableMessage(nanoxml.XMLElement)
public void update(Observable o, Object arg)
update
in interface Observer
Observer.update(java.util.Observable, java.lang.Object)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |