|
|||||||||
| 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.Panel
java.applet.Applet
javax.swing.JApplet
Glomus.Client.Java.GUIclient
public class GUIclient
The GUI client wraps an applet around a basic Glomus game, allowing users to test a private game with other Server-side players. It interfaces with the ServerConnection much the same as a JavaClient, though it allows the GUI user to make the decisions.
The GUIclient is designed as an applet, and depends upon 4 applet parameters: HOST, MAP, BACKGROUND, and PLAYERS. These applet parameters match protected data of the same name, see the fields section for more information
Glomus.Client.ServerConnection,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JApplet |
|---|
javax.swing.JApplet.AccessibleJApplet |
| Nested classes/interfaces inherited from class java.applet.Applet |
|---|
java.applet.Applet.AccessibleApplet |
| Nested classes/interfaces inherited from class java.awt.Panel |
|---|
java.awt.Panel.AccessibleAWTPanel |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected java.lang.String |
BACKGROUND
The background image used by this applet (including path location from CodeBase) |
protected java.lang.String |
HOST
The host name at which the GUIclient expects to find a Server running |
protected java.lang.String |
MAP
The map image used by this applet (including path location from CodeBase) |
protected int |
PLAYERS
The total number of players in the game (GUI player + server players) With a classic setup, there must be between 2 and 6 players per game; the default is 6. |
protected int |
PORT
The communication port at which to look for the running Server on the given host |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GUIclient()
|
|
| Method Summary | |
|---|---|
void |
accuse(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A failed accusation overheard (successful ones end the game, and thus do not need to be reported) |
void |
actionPerformed(java.awt.event.ActionEvent e)
The general event listener method for all Action Events generated by this GUI. |
void |
answer(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
Tells the client who won and what the answer was |
void |
cantRefute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A failed refutation overheard |
void |
endKnowledge(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
Informs the player of what another player in the game knows for certain |
void |
init()
Loads and shows the GUI |
void |
init(java.lang.String identity,
java.lang.String startRoom,
java.util.HashSet<java.lang.String> suspects,
java.util.HashSet<java.lang.String> weapons,
java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> rooms,
java.util.HashSet<java.lang.String> cards,
java.util.ArrayList<java.lang.String> players)
Initialize the player's knowledgebase with the suspects, weapons, rooms (and their connectivity), and the cards that this player has |
void |
knows(ServerConnection server)
Asks what information this player knows for certain (from the case folder) |
void |
makeAccusation(ServerConnection server)
A request for this player to make an accusation, if they wish |
void |
makeSuggestion(ServerConnection server)
A request for this player to make a suggestion |
void |
message(java.lang.String message)
Notifies the client of some user-specific information |
void |
refute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player,
ServerConnection server)
A request for this player to refute the claim, if possible |
void |
refuted(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A refuted suggestion overheard |
void |
shows(java.lang.String player,
java.lang.String card)
A refutation of our suggestion from another player |
void |
start()
Creates a new game on a the default board with a GUI player and 5 other JavaClients. |
void |
suggestion(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
A suggestion overheard by all players |
| 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, stop |
| 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, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, 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 |
| Field Detail |
|---|
protected java.lang.String HOST
protected final int PORT
protected java.lang.String BACKGROUND
protected java.lang.String MAP
protected int PLAYERS
| Constructor Detail |
|---|
public GUIclient()
| Method Detail |
|---|
public void init(java.lang.String identity,
java.lang.String startRoom,
java.util.HashSet<java.lang.String> suspects,
java.util.HashSet<java.lang.String> weapons,
java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> rooms,
java.util.HashSet<java.lang.String> cards,
java.util.ArrayList<java.lang.String> players)
init in interface Clientidentity - Our namestartRoom - Our starting locationsuspects - The set of all suspect namesweapons - The set of all weapon namesrooms - The map of all rooms to a list of adjacent roomscards - The set of all cards this player hasplayers - A list of suspects who are active in the game, in
the order they play (if that's important)
public void suggestion(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
suggestion in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationpublic void makeSuggestion(ServerConnection server)
makeSuggestion in interface Clientserver - The Glomus Server to reply topublic void makeAccusation(ServerConnection server)
makeAccusation in interface Clientserver - The Glomus Server to reply to
public void refute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player,
ServerConnection server)
refute in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player making the accusationserver - The Glomus Server to reply to
public void refuted(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
refuted in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who refuted the suggestion
public void cantRefute(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
cantRefute in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who could not refute the suggestion
public void shows(java.lang.String player,
java.lang.String card)
shows in interface Clientplayer - The player who is refuting our suggestioncard - A suspect, weapon, or room that they show to us,
refuting our claim
public void accuse(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
accuse in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who failed their accusationpublic void knows(ServerConnection server)
knows in interface Clientserver - The Glomus Server to reply to
public void endKnowledge(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
endKnowledge in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who knows the given info
public void answer(java.lang.String suspect,
java.lang.String weapon,
java.lang.String room,
java.lang.String player)
answer in interface Clientsuspect - Who did itweapon - How they did itroom - Where they did itplayer - The player who won the gamepublic void message(java.lang.String message)
message in interface Clientmessage - The message to pass onto the userpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - The Event generated and receivedpublic void start()
start in class java.applet.Appletpublic void init()
init in class java.applet.Applet
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||