JSettlers v1.0.6 API
Built ${date}

soc.client
Class SOCHandPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bysoc.client.SOCHandPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SOCHandPanel
extends java.awt.Panel
implements java.awt.event.ActionListener

This panel displays a player's information. If the player is us, then more information is displayed than in another player's hand panel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String BANK
           
protected  java.awt.Button bankBut
           
protected static java.lang.String CARD
           
protected  java.awt.List cardList
           
static int CITIES
           
protected  java.awt.Label cityLab
           
protected  ColorSquare citySq
           
static int CLAY
           
protected  java.awt.Label clayLab
           
protected  ColorSquare claySq
           
protected static java.lang.String CLEAR
           
protected  java.awt.Button clearBut
           
protected  SOCPlayerClient client
           
protected  java.awt.Label developmentLab
           
protected  ColorSquare developmentSq
           
protected static java.lang.String DONE
           
protected  java.awt.Button doneBut
           
protected  SOCFaceButton faceImg
           
protected  SOCGame game
           
protected static java.lang.String GET
           
protected  java.awt.Label getLab
           
protected static java.lang.String GIVE
           
protected  java.awt.Label giveLab
           
protected  boolean inPlay
           
protected  boolean interactive
          When this flag is true, the panel is interactive.
protected  java.awt.Label knightsLab
           
protected  ColorSquare knightsSq
           
static int LARGESTARMY
           
protected  java.awt.Label larmyLab
           
protected static java.lang.String LOCKSEAT
           
static int LONGESTROAD
           
protected  java.awt.Label lroadLab
           
static int NUMDEVCARDS
           
static int NUMKNIGHTS
           
static int NUMRESOURCES
           
protected  TradeOfferPanel offer
           
static int ORE
           
protected  java.awt.Label oreLab
           
protected  ColorSquare oreSq
           
protected  java.awt.Button playCardBut
           
protected  SOCPlayer player
           
protected  SOCPlayerInterface playerInterface
           
protected  ColorSquare[] playerSend
           
protected  int[] playerSendMap
           
protected  java.awt.Label pname
           
protected static java.lang.String QUIT
           
protected  java.awt.Button quitBut
           
protected  java.awt.Label resourceLab
           
protected  ColorSquare resourceSq
           
protected  java.awt.Label roadLab
           
static int ROADS
           
protected  ColorSquare roadSq
           
protected static java.lang.String ROBOT
           
protected  java.awt.Button robotBut
           
protected static java.lang.String ROLL
           
protected  java.awt.Button rollBut
           
protected  java.awt.Button seatLockBut
           
protected static java.lang.String SEND
           
protected  java.awt.Button sendBut
           
protected  java.awt.Label settlementLab
           
static int SETTLEMENTS
           
protected  ColorSquare settlementSq
           
static int SHEEP
           
protected  java.awt.Label sheepLab
           
protected  ColorSquare sheepSq
           
protected static java.lang.String SIT
           
protected  java.awt.Button sitBut
           
protected  SquaresPanel sqPanel
           
protected static java.lang.String START
           
protected  java.awt.Button startBut
           
protected static java.lang.String TAKEOVER
           
protected  java.awt.Button takeOverBut
           
protected static java.lang.String UNLOCKSEAT
           
static int VICTORYPOINTS
           
protected  java.awt.Label vpLab
           
protected  ColorSquare vpSq
           
static int WHEAT
           
protected  java.awt.Label wheatLab
           
protected  ColorSquare wheatSq
           
static int WOOD
           
protected  java.awt.Label woodLab
           
protected  ColorSquare woodSq
           
protected static int[] zero
           
 
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
SOCHandPanel(SOCPlayerInterface pi, SOCPlayer pl)
          make a new hand panel
SOCHandPanel(SOCPlayerInterface pi, SOCPlayer pl, boolean in)
          make a new hand panel
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          handle interaction
 void addPlayer(java.lang.String name)
          DOCUMENT ME!
 void addRobotButton()
          DOCUMENT ME!
 void addSeatLockBut()
          DOCUMENT ME!
 void addSitButton()
          DOCUMENT ME!
 void addTakeOverBut()
          DOCUMENT ME!
 void changeFace(int id)
          Change the face image
 void clearOffer()
          DOCUMENT ME!
 void clearTradeMsg()
          DOCUMENT ME!
protected  void creation(SOCPlayerInterface pi, SOCPlayer pl, boolean in)
          Stuff to do when a SOCHandPanel is created
 void doLayout()
          DOCUMENT ME!
 SOCPlayerClient getClient()
           
 SOCGame getGame()
           
 SOCPlayer getPlayer()
           
 SOCPlayerInterface getPlayerInterface()
           
 void rejectOffer()
          DOCUMENT ME!
 void removePlayer()
          remove this player
 void removeRobotBut()
          DOCUMENT ME!
 void removeSeatLockBut()
          DOCUMENT ME!
 void removeSitBut()
          DOCUMENT ME!
 void removeStartBut()
          Internal mechanism to remove start button (if visible) and add VP label.
 void removeTakeOverBut()
          DOCUMENT ME!
protected  void setLArmy(boolean haveIt)
          turn the "largest army" label on or off
protected  void setLRoad(boolean haveIt)
          turn the "longest road" label on or off
 void updateCurrentOffer()
          DOCUMENT ME!
 void updateDevCards()
          DOCUMENT ME!
 void updateSeatLockButton()
          update the seat lock button so that it allows a player to lock an unlocked seat and vice versa
 void updateTakeOverButton()
          update the takeover button so that it only allows takover when it's not the robot's turn
 void updateValue(int vt)
          update the value of a player element
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, getLocale, 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, resize, resize, 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
 

Field Detail

ROADS

public static final int ROADS
See Also:
Constant Field Values

SETTLEMENTS

public static final int SETTLEMENTS
See Also:
Constant Field Values

CITIES

public static final int CITIES
See Also:
Constant Field Values

NUMRESOURCES

public static final int NUMRESOURCES
See Also:
Constant Field Values

NUMDEVCARDS

public static final int NUMDEVCARDS
See Also:
Constant Field Values

NUMKNIGHTS

public static final int NUMKNIGHTS
See Also:
Constant Field Values

VICTORYPOINTS

public static final int VICTORYPOINTS
See Also:
Constant Field Values

LONGESTROAD

public static final int LONGESTROAD
See Also:
Constant Field Values

LARGESTARMY

public static final int LARGESTARMY
See Also:
Constant Field Values

CLAY

public static final int CLAY
See Also:
Constant Field Values

ORE

public static final int ORE
See Also:
Constant Field Values

SHEEP

public static final int SHEEP
See Also:
Constant Field Values

WHEAT

public static final int WHEAT
See Also:
Constant Field Values

WOOD

public static final int WOOD
See Also:
Constant Field Values

zero

protected static final int[] zero

SIT

protected static final java.lang.String SIT
See Also:
Constant Field Values

START

protected static final java.lang.String START
See Also:
Constant Field Values

ROBOT

protected static final java.lang.String ROBOT
See Also:
Constant Field Values

TAKEOVER

protected static final java.lang.String TAKEOVER
See Also:
Constant Field Values

LOCKSEAT

protected static final java.lang.String LOCKSEAT
See Also:
Constant Field Values

UNLOCKSEAT

protected static final java.lang.String UNLOCKSEAT
See Also:
Constant Field Values

ROLL

protected static final java.lang.String ROLL
See Also:
Constant Field Values

QUIT

protected static final java.lang.String QUIT
See Also:
Constant Field Values

DONE

protected static final java.lang.String DONE
See Also:
Constant Field Values

CLEAR

protected static final java.lang.String CLEAR
See Also:
Constant Field Values

SEND

protected static final java.lang.String SEND
See Also:
Constant Field Values

BANK

protected static final java.lang.String BANK
See Also:
Constant Field Values

CARD

protected static final java.lang.String CARD
See Also:
Constant Field Values

GIVE

protected static final java.lang.String GIVE
See Also:
Constant Field Values

GET

protected static final java.lang.String GET
See Also:
Constant Field Values

sitBut

protected java.awt.Button sitBut

robotBut

protected java.awt.Button robotBut

startBut

protected java.awt.Button startBut

takeOverBut

protected java.awt.Button takeOverBut

seatLockBut

protected java.awt.Button seatLockBut

faceImg

protected SOCFaceButton faceImg

pname

protected java.awt.Label pname

vpLab

protected java.awt.Label vpLab

vpSq

protected ColorSquare vpSq

larmyLab

protected java.awt.Label larmyLab

lroadLab

protected java.awt.Label lroadLab

claySq

protected ColorSquare claySq

oreSq

protected ColorSquare oreSq

sheepSq

protected ColorSquare sheepSq

wheatSq

protected ColorSquare wheatSq

woodSq

protected ColorSquare woodSq

clayLab

protected java.awt.Label clayLab

oreLab

protected java.awt.Label oreLab

sheepLab

protected java.awt.Label sheepLab

wheatLab

protected java.awt.Label wheatLab

woodLab

protected java.awt.Label woodLab

settlementSq

protected ColorSquare settlementSq

citySq

protected ColorSquare citySq

roadSq

protected ColorSquare roadSq

settlementLab

protected java.awt.Label settlementLab

cityLab

protected java.awt.Label cityLab

roadLab

protected java.awt.Label roadLab

resourceSq

protected ColorSquare resourceSq

resourceLab

protected java.awt.Label resourceLab

developmentSq

protected ColorSquare developmentSq

developmentLab

protected java.awt.Label developmentLab

knightsSq

protected ColorSquare knightsSq

knightsLab

protected java.awt.Label knightsLab

cardList

protected java.awt.List cardList

playCardBut

protected java.awt.Button playCardBut

sqPanel

protected SquaresPanel sqPanel

giveLab

protected java.awt.Label giveLab

getLab

protected java.awt.Label getLab

sendBut

protected java.awt.Button sendBut

clearBut

protected java.awt.Button clearBut

bankBut

protected java.awt.Button bankBut

playerSend

protected ColorSquare[] playerSend

rollBut

protected java.awt.Button rollBut

doneBut

protected java.awt.Button doneBut

quitBut

protected java.awt.Button quitBut

playerInterface

protected SOCPlayerInterface playerInterface

client

protected SOCPlayerClient client

game

protected SOCGame game

player

protected SOCPlayer player

inPlay

protected boolean inPlay

playerSendMap

protected int[] playerSendMap

offer

protected TradeOfferPanel offer

interactive

protected boolean interactive
When this flag is true, the panel is interactive.

Constructor Detail

SOCHandPanel

public SOCHandPanel(SOCPlayerInterface pi,
                    SOCPlayer pl,
                    boolean in)
make a new hand panel

Parameters:
pi - the interface that this panel is a part of
pl - the player associated with this panel
in - the interactive flag setting

SOCHandPanel

public SOCHandPanel(SOCPlayerInterface pi,
                    SOCPlayer pl)
make a new hand panel

Parameters:
pi - the interface that this panel is a part of
pl - the player associated with this panel
Method Detail

creation

protected void creation(SOCPlayerInterface pi,
                        SOCPlayer pl,
                        boolean in)
Stuff to do when a SOCHandPanel is created

Parameters:
pi - player interface
pl - the player data
in - the interactive flag setting

getPlayerInterface

public SOCPlayerInterface getPlayerInterface()
Returns:
the player interface

getPlayer

public SOCPlayer getPlayer()
Returns:
the player

getClient

public SOCPlayerClient getClient()
Returns:
the client

getGame

public SOCGame getGame()
Returns:
the game

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
handle interaction

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addSeatLockBut

public void addSeatLockBut()
DOCUMENT ME!


addTakeOverBut

public void addTakeOverBut()
DOCUMENT ME!


addSitButton

public void addSitButton()
DOCUMENT ME!


addRobotButton

public void addRobotButton()
DOCUMENT ME!


changeFace

public void changeFace(int id)
Change the face image

Parameters:
id - the id of the image

removePlayer

public void removePlayer()
remove this player


addPlayer

public void addPlayer(java.lang.String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!

updateDevCards

public void updateDevCards()
DOCUMENT ME!


removeSeatLockBut

public void removeSeatLockBut()
DOCUMENT ME!


removeTakeOverBut

public void removeTakeOverBut()
DOCUMENT ME!


removeSitBut

public void removeSitBut()
DOCUMENT ME!


removeRobotBut

public void removeRobotBut()
DOCUMENT ME!


removeStartBut

public void removeStartBut()
Internal mechanism to remove start button (if visible) and add VP label.


updateCurrentOffer

public void updateCurrentOffer()
DOCUMENT ME!


rejectOffer

public void rejectOffer()
DOCUMENT ME!


clearTradeMsg

public void clearTradeMsg()
DOCUMENT ME!


clearOffer

public void clearOffer()
DOCUMENT ME!


updateTakeOverButton

public void updateTakeOverButton()
update the takeover button so that it only allows takover when it's not the robot's turn


updateSeatLockButton

public void updateSeatLockButton()
update the seat lock button so that it allows a player to lock an unlocked seat and vice versa


setLArmy

protected void setLArmy(boolean haveIt)
turn the "largest army" label on or off

Parameters:
haveIt - true if this player has the largest army

setLRoad

protected void setLRoad(boolean haveIt)
turn the "longest road" label on or off

Parameters:
haveIt - true if this player has the longest road

updateValue

public void updateValue(int vt)
update the value of a player element

Parameters:
vt - the type of value

doLayout

public void doLayout()
DOCUMENT ME!


JSettlers v1.0.6 API
Built ${date}