JSettlers v1.0.6 API
Built ${date}

soc.client
Class SOCBoardPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bysoc.client.SOCBoardPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class SOCBoardPanel
extends java.awt.Canvas
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This is a component that can display a Settlers of Catan Board. It can be used in an applet or an application. It loads gifs from a directory named "images" in the same directory at the code.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int CONSIDER_LM_CITY
           
static int CONSIDER_LM_ROAD
           
static int CONSIDER_LM_SETTLEMENT
           
static int CONSIDER_LT_CITY
           
static int CONSIDER_LT_ROAD
           
static int CONSIDER_LT_SETTLEMENT
           
static int NONE
           
static int panelx
          size of the whole panel
static int panely
           
static int PLACE_CITY
           
static int PLACE_INIT_ROAD
           
static int PLACE_INIT_SETTLEMENT
           
static int PLACE_ROAD
           
static int PLACE_ROBBER
           
static int PLACE_SETTLEMENT
           
 
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
SOCBoardPanel(SOCPlayerInterface pi)
          create a new board panel in an applet
 
Method Summary
 java.awt.Dimension getMinimumSize()
          DOCUMENT ME!
 int getMode()
          get the interaction mode
static int getPanelX()
           
static int getPanelY()
           
 java.awt.Dimension getPreferedSize()
          DOCUMENT ME!
 void mouseClicked(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mouseDragged(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mouseEntered(java.awt.event.MouseEvent e)
          Handle Events
 void mouseExited(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mouseMoved(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void mousePressed(java.awt.event.MouseEvent evt)
          DOCUMENT ME!
 void mouseReleased(java.awt.event.MouseEvent e)
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          Redraw the board using double buffering.
 void setMode(int m)
          set the interaction mode
 void setOtherPlayer(SOCPlayer op)
          set the other player
 void setPlayer()
          set the player that is using this board panel
 void update(java.awt.Graphics g)
          Overriden so the peer isn't painted, which clears background.
 void updateMode()
          update the type of interaction mode
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

panelx

public static final int panelx
size of the whole panel

See Also:
Constant Field Values

panely

public static final int panely
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

PLACE_ROAD

public static final int PLACE_ROAD
See Also:
Constant Field Values

PLACE_SETTLEMENT

public static final int PLACE_SETTLEMENT
See Also:
Constant Field Values

PLACE_CITY

public static final int PLACE_CITY
See Also:
Constant Field Values

PLACE_ROBBER

public static final int PLACE_ROBBER
See Also:
Constant Field Values

PLACE_INIT_SETTLEMENT

public static final int PLACE_INIT_SETTLEMENT
See Also:
Constant Field Values

PLACE_INIT_ROAD

public static final int PLACE_INIT_ROAD
See Also:
Constant Field Values

CONSIDER_LM_SETTLEMENT

public static final int CONSIDER_LM_SETTLEMENT
See Also:
Constant Field Values

CONSIDER_LM_ROAD

public static final int CONSIDER_LM_ROAD
See Also:
Constant Field Values

CONSIDER_LM_CITY

public static final int CONSIDER_LM_CITY
See Also:
Constant Field Values

CONSIDER_LT_SETTLEMENT

public static final int CONSIDER_LT_SETTLEMENT
See Also:
Constant Field Values

CONSIDER_LT_ROAD

public static final int CONSIDER_LT_ROAD
See Also:
Constant Field Values

CONSIDER_LT_CITY

public static final int CONSIDER_LT_CITY
See Also:
Constant Field Values
Constructor Detail

SOCBoardPanel

public SOCBoardPanel(SOCPlayerInterface pi)
create a new board panel in an applet

Parameters:
pi - the player interface that spawned us
Method Detail

getPreferedSize

public java.awt.Dimension getPreferedSize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getMinimumSize

public java.awt.Dimension getMinimumSize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
Redraw the board using double buffering. Don't call this directly, use Component.repaint() instead.


update

public void update(java.awt.Graphics g)
Overriden so the peer isn't painted, which clears background. Don't call this directly, use Component.repaint() instead.


updateMode

public void updateMode()
update the type of interaction mode


setPlayer

public void setPlayer()
set the player that is using this board panel


setOtherPlayer

public void setOtherPlayer(SOCPlayer op)
set the other player

Parameters:
op - the other player

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Handle Events

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - DOCUMENT ME!

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - DOCUMENT ME!

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
DOCUMENT ME!

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - DOCUMENT ME!

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
DOCUMENT ME!

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - DOCUMENT ME!

setMode

public void setMode(int m)
set the interaction mode

Parameters:
m - mode

getMode

public int getMode()
get the interaction mode

Returns:
the mode

getPanelX

public static int getPanelX()
Returns:
panelx

getPanelY

public static int getPanelY()
Returns:
panely

JSettlers v1.0.6 API
Built ${date}