org.jogre.client.awt
Class JogreClientApplet

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byjavax.swing.JApplet
                      extended byorg.jogre.client.awt.JogreClientApplet
All Implemented Interfaces:
Accessible, IClient, IJogre, IJogreClientGUI, ImageObserver, ITable, MenuContainer, Observer, RootPaneContainer, Serializable

public abstract class JogreClientApplet
extends JApplet
implements IClient, Observer, IJogreClientGUI, IJogre

Abstract JOGRE applet class. This must be extended to create a Swing applet.

Version:
Alpha 0.2.3
Author:
starsinthesky
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JApplet
JApplet.AccessibleJApplet
 
Nested classes inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
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.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.jogre.common.IJogre
APPLET_PARAM_PASSWORD, APPLET_PARAM_SERVER_HOST, APPLET_PARAM_SERVER_PORT, APPLET_PARAM_USERNAME, DEFAULT_ELO_K_FACTOR, DEFAULT_ELO_START_RATING, DEFAULT_MAX_NUM_OF_PLAYERS, DEFAULT_MAX_NUM_OF_TABLES, DEFAULT_MAX_NUM_OF_TABLES_PER_USER, DEFAULT_MAX_NUM_OF_USERS, DEFAULT_MIN_NUM_OF_PLAYERS, DEFAULT_NUM_OF_PLAYERS, DEFAULT_PORT, DEFAULT_REQ_NUM_OF_PLAYERS, MASTER_SERVE_KEY, PROVISIONAL_COUNT, VERSION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JogreClientApplet()
          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)
          Method for returning the correct chat dialog.
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 init()
          Initilise the applet.
 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)
          Method for setting a title.
 void stop()
          Stop the applet properly.
 void update(Observable o, Object arg)
          Delegate method for updating the GUI applet.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JogreClientApplet

public JogreClientApplet()
Constructor for a client frame.

Method Detail

getJogreTableFrame

public abstract JogreTableFrame getJogreTableFrame(TableConnectionThread conn)
This must be overwritten to get a handle on the correct table frame.

Specified by:
getJogreTableFrame in interface IJogreClientGUI
Parameters:
conn - Connection to server.
Returns:
Return the correct table frame.

init

public void init()
Initilise the applet.

See Also:
Applet.init()

connectOK

public void connectOK(ClientConnectionThread conn)
Method which is called when a client connects successfully.

Specified by:
connectOK in interface IJogreClientGUI
Parameters:
conn - Client connection thread.

setUITitle

public void setUITitle(String title)
Method for setting a title. In an applet this is empty.

Specified by:
setUITitle in interface IJogreClientGUI
Parameters:
title - Title to set.
See Also:
IJogreClientGUI.setUITitle(java.lang.String)

getChatPrivateDialog

public ChatPrivateDialog getChatPrivateDialog(String usernameTo,
                                              ClientConnectionThread conn)
Method for returning the correct chat dialog. An applet doesn't need a parent Frame.

Specified by:
getChatPrivateDialog in interface IJogreClientGUI
Parameters:
usernameTo - Username to talk to.
conn - Connection to the server.
Returns:
Private chat dialog.
See Also:
IJogreClientGUI.getChatPrivateDialog(java.lang.String, org.jogre.client.ClientConnectionThread)

getPropertyDialog

public void getPropertyDialog(ClientConnectionThread conn)
Delegate method for popping up a game property dialog box

Specified by:
getPropertyDialog in interface IJogreClientGUI
Parameters:
conn - Connection to server.
See Also:
org.jogre.client.awt.IJogreClientGUI#getPropertyDialog(org.jogre.client.ClientConnectionThread, org.jogre.common.util.GameProperties)

getUserDialog

public void getUserDialog(User user)
Delegate method for create a user dialog.

Specified by:
getUserDialog in interface IJogreClientGUI
See Also:
IJogreClientGUI.getUserDialog(org.jogre.common.User)

getRulesDialog

public void getRulesDialog()
Delegate method for creating the rules dialog.

Specified by:
getRulesDialog in interface IJogreClientGUI

receiveGameMessage

public void receiveGameMessage(XMLElement message)
Delegate method for receiving a game message.

Specified by:
receiveGameMessage in interface IClient
Parameters:
message - Game message from server
See Also:
IClient.receiveGameMessage(nanoxml.XMLElement)

receiveTableMessage

public void receiveTableMessage(XMLElement message)
Delegate method for receiving a table message.

Specified by:
receiveTableMessage in interface ITable
Parameters:
message - Message from server.
See Also:
ITable.receiveTableMessage(nanoxml.XMLElement)

update

public void update(Observable o,
                   Object arg)
Delegate method for updating the GUI applet.

Specified by:
update in interface Observer
See Also:
Observer.update(java.util.Observable, java.lang.Object)

stop

public void stop()
Stop the applet properly.

See Also:
Applet.stop()