|
|||||||||||
| 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()
Constructor for a client frame. |
|
| Method Summary | |
abstract JogreTableFrame |
getJogreTableFrame(TableConnectionThread conn)
This must be overwritten to get a handle on the correct table frame. |
protected ChatPrivateDialog |
getPrivateMessageComponent(String usernameTo)
Returns a private message for a particular user and creates one if it doesn't already exist. |
protected JogreTableFrame |
getTableFrame(int tableNum)
Overloaded version when you are sure that the table exists (other wise returns null). |
protected JogreTableFrame |
getTableFrame(Table table)
Return the correct JogreTableFrame. |
protected boolean |
isPublicGame()
Return true if the user has selected that he wants to play a public game. |
void |
receiveChat(CommChatGame chatMessage)
Method which receives a message from the server (or user) |
void |
receiveConnection(CommGameConnect commConnect)
Recieve connection from the server. |
void |
receiveGameMessage(XMLElement message)
Recieve a message specific to a particular game. |
void |
receiveInvite(CommInvite invite)
Recieve invite communications object. |
protected void |
receiveMessage(XMLElement message)
Adapter method for receiving a custom message. |
void |
receiveTableMessage(XMLElement message)
Recieve a table message and delegate it to the correct frame. |
protected void |
refreshTableFrame(Table table)
Refresh the table. |
void |
tableListUpdated()
Update the table list. |
void |
tableUpdated(int tableNum)
Table updated. |
void |
userListUpdated()
Method to update the user list. |
| 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()
| Method Detail |
public abstract JogreTableFrame getJogreTableFrame(TableConnectionThread conn)
conn - Connection to server.
protected boolean isPublicGame()
public void receiveGameMessage(XMLElement message)
IClient
receiveGameMessage in interface IClientmessage - Game message from serverIClient.receiveGameMessage(nanoxml.XMLElement)protected void receiveMessage(XMLElement message)
ITable.receiveTableMessage(nanoxml.XMLElement)public void receiveTableMessage(XMLElement message)
receiveTableMessage in interface ITablemessage - Message from server.ITable.receiveTableMessage(nanoxml.XMLElement)public void receiveConnection(CommGameConnect commConnect)
commConnect - Game connect message object.public void receiveChat(CommChatGame chatMessage)
chatMessage - Chat message from userpublic void userListUpdated()
public void tableListUpdated()
public void tableUpdated(int tableNum)
tableNum - protected void refreshTableFrame(Table table)
table - protected JogreTableFrame getTableFrame(Table table)
table - Specified table.
protected JogreTableFrame getTableFrame(int tableNum)
tableNum - Specified table number.
public void receiveInvite(CommInvite invite)
invite - protected ChatPrivateDialog getPrivateMessageComponent(String usernameTo)
usernameTo - Username of person being chatted to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||