soc.client
Class SOCBuildingPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended bysoc.client.SOCBuildingPanel
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 SOCBuildingPanel
extends java.awt.Panel
implements java.awt.event.ActionListener

This class is a panel that shows how much it costs to build things, and it allows the player to build.

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
(package private) static java.lang.String CARD
           
(package private)  java.awt.Button cardBut
           
(package private)  java.awt.Label cardC
           
(package private)  ColorSquare cardCount
           
(package private)  java.awt.Label cardCountLab
           
(package private)  ColorSquare cardOre
           
(package private)  ColorSquare cardSheep
           
(package private)  java.awt.Label cardT
           
(package private)  java.awt.Label cardV
           
(package private)  ColorSquare cardWheat
           
(package private) static java.lang.String CITY
           
(package private)  java.awt.Button cityBut
           
(package private)  java.awt.Label cityC
           
(package private)  ColorSquare cityOre
           
(package private)  java.awt.Label cityT
           
(package private)  java.awt.Label cityV
           
(package private)  ColorSquare cityWheat
           
(package private)  SOCPlayerInterface pi
           
(package private)  SOCPlayer player
          Client's player data.
(package private) static java.lang.String ROAD
           
(package private)  java.awt.Button roadBut
           
(package private)  java.awt.Label roadC
           
(package private)  ColorSquare roadClay
           
(package private)  java.awt.Label roadT
           
(package private)  java.awt.Label roadV
           
(package private)  ColorSquare roadWood
           
(package private)  java.awt.Button settlementBut
           
(package private)  java.awt.Label settlementC
           
(package private)  ColorSquare settlementClay
           
(package private)  ColorSquare settlementSheep
           
(package private)  java.awt.Label settlementT
           
(package private)  java.awt.Label settlementV
           
(package private)  ColorSquare settlementWheat
           
(package private)  ColorSquare settlementWood
           
(package private) static java.lang.String STLMT
           
(package private)  java.awt.Label title
           
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
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
SOCBuildingPanel(SOCPlayerInterface pi)
          make a new building panel
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          DOCUMENT ME!
 void clickBuildingButton(SOCGame game, SOCPlayerClient client, java.lang.String target, boolean doNotClearPopup)
          Handle a click on a building-panel button.
 void doLayout()
          DOCUMENT ME!
 void setPlayer()
          Set our game and player data based on client's nickname, via game.getPlayer(client.getNickname()).
 void updateButtonStatus()
          update the status of the buttons
 void updateDevCardCount()
          The game's count of development cards remaining has changed.
 
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

ROAD

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

STLMT

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

CITY

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

CARD

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

title

java.awt.Label title

roadBut

java.awt.Button roadBut

settlementBut

java.awt.Button settlementBut

cityBut

java.awt.Button cityBut

cardBut

java.awt.Button cardBut

roadT

java.awt.Label roadT

roadV

java.awt.Label roadV

roadC

java.awt.Label roadC

roadWood

ColorSquare roadWood

roadClay

ColorSquare roadClay

settlementT

java.awt.Label settlementT

settlementV

java.awt.Label settlementV

settlementC

java.awt.Label settlementC

settlementWood

ColorSquare settlementWood

settlementClay

ColorSquare settlementClay

settlementWheat

ColorSquare settlementWheat

settlementSheep

ColorSquare settlementSheep

cityT

java.awt.Label cityT

cityV

java.awt.Label cityV

cityC

java.awt.Label cityC

cityWheat

ColorSquare cityWheat

cityOre

ColorSquare cityOre

cardT

java.awt.Label cardT

cardV

java.awt.Label cardV

cardC

java.awt.Label cardC

cardCountLab

java.awt.Label cardCountLab

cardWheat

ColorSquare cardWheat

cardSheep

ColorSquare cardSheep

cardOre

ColorSquare cardOre

cardCount

ColorSquare cardCount

pi

SOCPlayerInterface pi

player

SOCPlayer player
Client's player data. Initially null; call setPlayer once seat is chosen.

See Also:
setPlayer()
Constructor Detail

SOCBuildingPanel

public SOCBuildingPanel(SOCPlayerInterface pi)
make a new building panel

Parameters:
pi - the player interface that this panel is in
Method Detail

doLayout

public void doLayout()
DOCUMENT ME!


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
DOCUMENT ME!

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - DOCUMENT ME!

clickBuildingButton

public void clickBuildingButton(SOCGame game,
                                SOCPlayerClient client,
                                java.lang.String target,
                                boolean doNotClearPopup)
Handle a click on a building-panel button.

Parameters:
game - The game, for status
client - The client, for sending build or cancel request
target - Button clicked, as returned by ActionEvent.getActionCommand
doNotClearPopup - Do not call SOCBoardPanel.popupClearBuildRequest()
See Also:
SOCBoardPanel.popupClearBuildRequest()

updateButtonStatus

public void updateButtonStatus()
update the status of the buttons


updateDevCardCount

public void updateDevCardCount()
The game's count of development cards remaining has changed. Update the display.


setPlayer

public void setPlayer()
               throws java.lang.IllegalStateException
Set our game and player data based on client's nickname, via game.getPlayer(client.getNickname()).

Throws:
java.lang.IllegalStateException - If the player data has already been set, and this isn't a new game (a board reset).