|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
soc.client.SOCBoardPanel
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.
| Nested Class Summary | |
protected class |
SOCBoardPanel.BoardPanelSendBuildTask
Used for the delay between sending a build-request message, and receiving a game-state message. |
private class |
SOCBoardPanel.BoardPopupMenu
This class creates a popup menu on the board, to trade or build or cancel building. |
protected class |
SOCBoardPanel.BoardToolTip
|
protected static class |
SOCBoardPanel.DelayedRepaint
With a recent board resize, one or more rescaled images still hasn't been completed after 7 seconds. |
(package private) static class |
SOCBoardPanel.ResourceTradeAllMenu
Menu for right-click on 3-for-1 port to trade all resource types with bank/port. |
| 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 | |
private static java.awt.Color |
ARROW_COLOR
Arrow color: cyan: r=106,g=183,b=183 |
private static int |
ARROW_SZ
Arrow fits in a 37 x 37 square. |
private static int[] |
arrowXL
Arrow, left-pointing. |
private static int[] |
arrowXR
Arrow, right-pointing. |
private static int[] |
arrowY
Arrow, y-coordinates: same whether pointing left or right. |
private SOCBoard |
board
The board in the game |
private java.awt.Image |
buffer
offscreen buffer |
protected static int |
BUILD_REQUEST_MAX_DELAY_SEC
for popup-menu build request, network send maximum delay (seconds) |
protected SOCBoardPanel.BoardPanelSendBuildTask |
buildReqTimerTask
For right-click build menu; used for fallback part of client-server-client communication of a build request. |
private static int[] |
cityX
city |
private static int[] |
cityY
|
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
|
private static int |
deltaX
|
private static int |
deltaY
|
private static java.awt.Image[] |
dice
dice number pix (for arrow). |
private static int |
DICE_SZ
Dice number fits in a 25 x 25 square. |
private static int[] |
downRoadX
road looks like "\" |
private static int[] |
downRoadY
|
private int[] |
edgeMap
Map grid sectors to hex edges |
private SOCGame |
game
The game which this board is a part of |
static int |
GAME_FORMING
|
static int |
GAME_OVER
|
private static int |
halfdeltaX
|
private static java.awt.Image[] |
hexes
Hex pix - shared unscaled original-resolution from GIF files. |
private int |
HEXHEIGHT
|
private int[] |
hexIDtoNum
translate hex ID to number to get coords |
private int[] |
hexMap
Map grid sectors to hexes |
private int |
HEXWIDTH
hex size, in unscaled internal-pixels |
private static int[] |
hexX
hex coordinates for drawing |
private static int[] |
hexY
|
private int |
hilight
Edge or node being pointed to. |
static int |
HOVER_OFFSET_X_FOR_INIT_PLACE
During initial-piece placement, the tooltip is moved this far over to make room. |
static int |
HOVER_OFFSET_X_FOR_ROBBER
During robber placement, the tooltip is moved this far over to make room. |
private SOCBoardPanel.BoardToolTip |
hoverTip
(tooltip) Hover text. |
private static java.lang.String |
IMAGEDIR
|
private int |
initstlmt
This holds the coord of the last stlmt placed in the initial phase. |
protected boolean |
isScaled
The board is currently scaled larger than PANELX x PANELY pixels. |
private int |
mode
modes of interaction; for correlation to game state, see updateMode(). |
private int[] |
nodeMap
Map grid sectors to hex nodes |
static int |
NONE
|
private static java.awt.Image[] |
numbers
number pix (for hexes) |
private SOCPlayer |
otherPlayer
When in "consider" mode, this is the player we're talking to |
static int |
PANELX
size of the whole panel, internal-pixels "scale"; also minimum acceptable size in screen pixels. |
static int |
PANELY
size of the whole panel, internal-pixels "scale"; also minimum acceptable size in screen pixels. |
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
|
private SOCPlayer |
player
The player that is using this interface |
private SOCPlayerInterface |
playerInterface
the player interface that this board is a part of |
private int |
playerNumber
player number if in a game, or -1. |
protected static int |
POPUP_MENU_IGNORE_MS
for popup-menu build request, length of time after popup to ignore further mouse-clicks. |
private SOCBoardPanel.BoardPopupMenu |
popupMenu
Context menu for build/cancel-build |
private long |
popupMenuSystime
Tracks last menu-popup time. |
private static java.awt.Image[] |
ports
|
private int |
ptrOldX
Old pointer coords for interface |
private int |
ptrOldY
|
protected java.awt.Color[] |
robberGhostFill
Cached colors, for use for robber's "ghost" (previous position) when moving the robber. |
protected java.awt.Color[] |
robberGhostOutline
Cached colors, for use for robber's "ghost" (previous position) when moving the robber. |
private static int[] |
robberX
robber |
private static int[] |
robberY
|
private int[] |
scaledArrowXL
arrow, left-pointing and right-pointing. |
private int[] |
scaledArrowXR
arrow, left-pointing and right-pointing. |
private int[] |
scaledArrowY
arrow, left-pointing and right-pointing. |
protected long |
scaledAt
Time of last resize, as returned by System.currentTimeMillis(). |
private int[] |
scaledCityX
city |
private int[] |
scaledCityY
city |
private int[] |
scaledDownRoadX
road looks like "\" |
private int[] |
scaledDownRoadY
road looks like "\" |
private java.awt.Image[] |
scaledHexes
Hex pix - private scaled copy, if isScaled. |
private boolean[] |
scaledHexFail
Hex pix - Flag to check if rescaling failed, if isScaled. |
protected boolean |
scaledMissedImage
Flag used while drawing a scaled board. |
private boolean[] |
scaledNumberFail
|
private java.awt.Image[] |
scaledNumbers
|
protected int |
scaledPanelX
actual size on-screen, not internal-pixels size ( PANELX, PANELY) |
protected int |
scaledPanelY
actual size on-screen, not internal-pixels size ( PANELX, PANELY) |
private boolean[] |
scaledPortFail
|
private java.awt.Image[] |
scaledPorts
|
private int[] |
scaledRobberX
robber |
private int[] |
scaledRobberY
robber |
private int[] |
scaledSettlementX
settlement |
private int[] |
scaledSettlementY
settlement |
private int[] |
scaledUpRoadX
road looks like "/" |
private int[] |
scaledUpRoadY
road looks like "/" |
private int[] |
scaledVertRoadX
Coordinate arrays for drawing the playing pieces. |
private int[] |
scaledVertRoadY
Coordinate arrays for drawing the playing pieces. |
private static int[] |
settlementX
settlement |
private static int[] |
settlementY
|
private static int[] |
upRoadX
road looks like "/" |
private static int[] |
upRoadY
|
private static int[] |
vertRoadX
road looks like "|" |
private static int[] |
vertRoadY
|
| Fields inherited from class java.awt.Canvas |
|
| 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 | |
protected void |
clearModeAndHilight()
|
protected void |
doBoardMenuPopup(int x,
int y)
Bring up the popup menu; called from mousePressed. |
private void |
drawArrow(java.awt.Graphics g,
int pnum,
int diceResult)
draw the arrow that shows whose turn it is. |
private void |
drawBoard(java.awt.Graphics g)
draw the whole board |
private void |
drawCity(java.awt.Graphics g,
int nodeNum,
int pn,
boolean isHilight)
draw a city |
private void |
drawHex(java.awt.Graphics g,
int hexNum)
draw a board tile |
private void |
drawRoad(java.awt.Graphics g,
int edgeNum,
int pn,
boolean isHilight)
draw a road |
private void |
drawRobber(java.awt.Graphics g,
int hexID,
boolean fullNotGhost)
draw the robber |
private void |
drawSettlement(java.awt.Graphics g,
int nodeNum,
int pn,
boolean isHilight)
draw a settlement |
private int |
findEdge(int x,
int y)
given a pixel on the board, find the edge that contains it |
private int |
findHex(int x,
int y)
given a pixel on the board, find the hex that contains it |
private int |
findNode(int x,
int y)
given a pixel on the board, find the node that contains it |
java.awt.Dimension |
getMinimumSize()
DOCUMENT ME! |
int |
getMode()
get the interaction mode |
java.awt.Dimension |
getPreferredSize()
DOCUMENT ME! |
private void |
initEdgeMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
|
private void |
initHexIDtoNumAux(int begin,
int end,
int num)
|
private void |
initHexMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
|
private void |
initNodeMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
|
boolean |
isScaled()
Is the board is currently scaled larger than PANELX x PANELY pixels?
If so, use scaleToActualX(int), scaleFromActualY(int),
etc to convert between internal and actual screen pixel coordinates. |
private static void |
loadImages(java.awt.Component c)
load the images for the board we need to know if this board is in an applet or an application |
void |
mouseClicked(java.awt.event.MouseEvent evt)
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)
Mouse has left the panel; hide tooltip and any hovering piece. |
void |
mouseMoved(java.awt.event.MouseEvent e)
DOCUMENT ME! |
void |
mousePressed(java.awt.event.MouseEvent e)
DOCUMENT ME! |
void |
mouseReleased(java.awt.event.MouseEvent e)
DOCUMENT ME! |
void |
paint(java.awt.Graphics g)
Redraw the board using double buffering. |
void |
popupClearBuildRequest()
|
boolean |
popupExpectingBuildRequest()
If the client has used the board popup menu to request building a piece, this method is used in client network-receive message treatment. |
void |
popupFireBuildingRequest()
Have received gamestate placing message; send the building request in reply. |
void |
popupSetBuildRequest(int coord,
int ptype)
|
private void |
rescaleBoard(int newW,
int newH)
Set the board fields to a new size, rescale graphics if needed. |
private void |
rescaleCoordinateArrays()
Scale coordinate arrays for drawing pieces, or (if not isScaled) point to static arrays. |
int[] |
scaleCopyToActualX(int[] xorig)
Rescale to actual screen coordinates - Create a copy of array, and scale the copy's elements as X coordinates. |
int[] |
scaleCopyToActualY(int[] yorig)
Rescale to actual screen coordinates - Create a copy of array, and scale the copy's elements as Y coordinates. |
int |
scaleFromActualX(int x)
Convert an x-coordinate from actual-scaled to internal-scaled coordinates. |
int |
scaleFromActualY(int y)
Convert a y-coordinate from actual-scaled to internal-scaled coordinates. |
int |
scaleToActualX(int x)
Scale x-coordinate from internal to actual screen-pixel coordinates. |
void |
scaleToActualX(int[] xa)
Scale x-array from internal to actual screen-pixel coordinates. |
int |
scaleToActualY(int y)
Scale y-coordinate from internal to actual screen-pixel coordinates. |
void |
scaleToActualY(int[] ya)
Scale y-array from internal to actual screen-pixel coordinates. |
void |
setBounds(int x,
int y,
int w,
int h)
Set the board to a new location and size, rescale graphics and repaint if needed. |
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 |
setSize(java.awt.Dimension sz)
Set the board to a new size, rescale graphics and repaint if needed. |
void |
setSize(int newW,
int newH)
Set the board to a new size, rescale graphics and repaint if needed. |
void |
update(java.awt.Graphics g)
Overriden so the peer isn't painted, which clears background. |
protected void |
updateHoverTipToMode()
|
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, 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, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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 |
private static java.lang.String IMAGEDIR
public static final int PANELX
scaledPanelX scaledPanelY;
public static final int PANELY
scaledPanelX scaledPanelY;
private static final int deltaY
private static final int deltaX
private static final int halfdeltaX
private static final int[] hexX
private static final int[] hexY
private static final int[] vertRoadX
private static final int[] vertRoadY
private static final int[] upRoadX
private static final int[] upRoadY
private static final int[] downRoadX
private static final int[] downRoadY
private static final int[] settlementX
private static final int[] settlementY
private static final int[] cityX
private static final int[] cityY
private static final int[] robberX
private static final int[] robberY
private static final int[] arrowXL
rescaleCoordinateArrays())
arrowY,
ARROW_SZprivate static int[] arrowXR
arrowXL in rescaleCoordinateArrays().
private static final int[] arrowY
private static final int ARROW_SZ
private static final java.awt.Color ARROW_COLOR
public static final int NONE
public static final int PLACE_ROAD
public static final int PLACE_SETTLEMENT
public static final int PLACE_CITY
public static final int PLACE_ROBBER
public static final int PLACE_INIT_SETTLEMENT
public static final int PLACE_INIT_ROAD
public static final int CONSIDER_LM_SETTLEMENT
public static final int CONSIDER_LM_ROAD
public static final int CONSIDER_LM_CITY
public static final int CONSIDER_LT_SETTLEMENT
public static final int CONSIDER_LT_ROAD
public static final int CONSIDER_LT_CITY
public static final int GAME_FORMING
public static final int GAME_OVER
public static final int HOVER_OFFSET_X_FOR_INIT_PLACE
public static final int HOVER_OFFSET_X_FOR_ROBBER
protected static int BUILD_REQUEST_MAX_DELAY_SEC
protected static int POPUP_MENU_IGNORE_MS
private final int HEXWIDTH
private final int HEXHEIGHT
protected int scaledPanelX
PANELX, PANELY)
protected int scaledPanelY
PANELX, PANELY)
protected boolean isScaled
PANELX x PANELY pixels.
Use scaleToActualX(int), scaleFromActualX(int),
etc to convert between internal and actual screen pixel coordinates.
protected long scaledAt
System.currentTimeMillis().
Used with scaledMissedImage.
protected boolean scaledMissedImage
drawHex(Graphics, int), checked in drawBoard(Graphics).
scaledHexFailprivate int[] hexIDtoNum
private static java.awt.Image[] hexes
scaledHexesprivate static java.awt.Image[] ports
private java.awt.Image[] scaledHexes
hexesprivate java.awt.Image[] scaledPorts
private boolean[] scaledHexFail
scaledHexes,
drawHex(Graphics, int)private boolean[] scaledPortFail
private static java.awt.Image[] numbers
private java.awt.Image[] scaledNumbers
private boolean[] scaledNumberFail
private static java.awt.Image[] dice
private static final int DICE_SZ
private int[] scaledVertRoadX
private int[] scaledVertRoadY
private int[] scaledUpRoadX
private int[] scaledUpRoadY
private int[] scaledDownRoadX
private int[] scaledDownRoadY
private int[] scaledSettlementX
private int[] scaledSettlementY
private int[] scaledCityX
private int[] scaledCityY
private int[] scaledRobberX
private int[] scaledRobberY
private int[] scaledArrowXL
rescaleCoordinateArrays()private int[] scaledArrowXR
rescaleCoordinateArrays()private int[] scaledArrowY
rescaleCoordinateArrays()private int ptrOldX
private int ptrOldY
private SOCBoardPanel.BoardToolTip hoverTip
private SOCBoardPanel.BoardPopupMenu popupMenu
private long popupMenuSystime
protected SOCBoardPanel.BoardPanelSendBuildTask buildReqTimerTask
SOCBoardPanel.popupExpectingBuildRequest SOCPlayerInterface.updateAtGameState SOCBoardPanel.popupFireBuildingRequest
private int hilight
private int[] edgeMap
private int[] nodeMap
private int[] hexMap
private SOCGame game
private SOCBoard board
private SOCPlayer player
private int playerNumber
private SOCPlayer otherPlayer
private java.awt.Image buffer
private int mode
updateMode().
private int initstlmt
private SOCPlayerInterface playerInterface
protected java.awt.Color[] robberGhostFill
ColorSquare,
drawRobber(Graphics, int, boolean)protected java.awt.Color[] robberGhostOutline
ColorSquare,
drawRobber(Graphics, int, boolean)| Constructor Detail |
public SOCBoardPanel(SOCPlayerInterface pi)
pi - the player interface that spawned us| Method Detail |
private final void initEdgeMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
private final void initHexMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
private final void initNodeMapAux(int x1,
int y1,
int x2,
int y2,
int startHex)
private final void initHexIDtoNumAux(int begin,
int end,
int num)
public java.awt.Dimension getPreferredSize()
public java.awt.Dimension getMinimumSize()
public void setSize(int newW,
int newH)
throws java.lang.IllegalArgumentException
newW - New width in pixels, no less than PANELXnewH - New height in pixels, no less than PANELY
java.lang.IllegalArgumentException - if newW or newH is too small but not 0.
During initial layout, the layoutmanager may make calls to setSize(0,0);
such a call is passed to super without scaling graphics.
public void setSize(java.awt.Dimension sz)
throws java.lang.IllegalArgumentException
sz - New size in pixels, no less than PANELX wide by PANELY tall
java.lang.IllegalArgumentException - if sz is too small but not 0.
During initial layout, the layoutmanager may make calls to setSize(0,0);
such a call is passed to super without scaling graphics.
public void setBounds(int x,
int y,
int w,
int h)
throws java.lang.IllegalArgumentException
SOCPlayerInterface.doLayout().
x - New location's x-coordinatey - new location's y-coordinatew - New width in pixels, no less than PANELXh - New height in pixels, no less than PANELY
java.lang.IllegalArgumentException - if w or h is too small but not 0.
During initial layout, the layoutmanager may make calls to setBounds(0,0,0,0);
such a call is passed to super without scaling graphics.
private void rescaleBoard(int newW,
int newH)
throws java.lang.IllegalArgumentException
newW - New width in pixels, no less than PANELXnewH - New height in pixels, no less than PANELY
java.lang.IllegalArgumentException - if newW or newH is too small but not 0.
During initial layout, the layoutmanager may cause calls to rescaleBoard(0,0);
such a call is ignored, no rescaling of graphics is done.private void rescaleCoordinateArrays()
public int[] scaleCopyToActualX(int[] xorig)
xorig - Int array to be scaled; each member is an x-coordinate.
scaleToActualX(int[])public int[] scaleCopyToActualY(int[] yorig)
yorig - Int array to be scaled; each member is a y-coordinate.
scaleToActualY(int[])public void paint(java.awt.Graphics g)
Component.repaint() instead.
public void update(java.awt.Graphics g)
Component.repaint() instead.
private final void drawHex(java.awt.Graphics g,
int hexNum)
private final void drawRobber(java.awt.Graphics g,
int hexID,
boolean fullNotGhost)
g - Graphics contexthexID - Board hex encoded positionfullNotGhost - Draw normally, not "ghost" of previous position
(as during PLACE_ROBBER movement)
private final void drawRoad(java.awt.Graphics g,
int edgeNum,
int pn,
boolean isHilight)
private final void drawSettlement(java.awt.Graphics g,
int nodeNum,
int pn,
boolean isHilight)
private final void drawCity(java.awt.Graphics g,
int nodeNum,
int pn,
boolean isHilight)
private final void drawArrow(java.awt.Graphics g,
int pnum,
int diceResult)
g - Graphicspnum - Player position: 0 for top-left, 1 for top-right,
2 for bottom-right, 3 for bottom-leftdiceResult - Roll result to show, if rolled.
To show, diceResult must be at least 2,
and gamestate not SOCGame.PLAY.private void drawBoard(java.awt.Graphics g)
public void scaleToActualX(int[] xa)
xa - Int array to be scaled; each member is an x-coordinate.scaleCopyToActualX(int[])public void scaleToActualY(int[] ya)
ya - Int array to be scaled; each member is an y-coordinate.scaleCopyToActualY(int[])public int scaleToActualX(int x)
x - x-coordinate to be scaledpublic int scaleToActualY(int y)
y - y-coordinate to be scaledpublic int scaleFromActualX(int x)
x - x-coordinate to be scaledpublic int scaleFromActualY(int y)
y - y-coordinate to be scaledpublic boolean isScaled()
PANELX x PANELY pixels?
If so, use scaleToActualX(int), scaleFromActualY(int),
etc to convert between internal and actual screen pixel coordinates.
public void updateMode()
protected void updateHoverTipToMode()
protected void clearModeAndHilight()
public void setPlayer()
public void setOtherPlayer(SOCPlayer op)
op - the other playerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - DOCUMENT ME!public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - DOCUMENT ME!public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - DOCUMENT ME!public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - MouseEventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - DOCUMENT ME!public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked in interface java.awt.event.MouseListenerevt - DOCUMENT ME!
protected void doBoardMenuPopup(int x,
int y)
x - x-coordinate of click, actual screen pixels (not unscaled internal)y - y-coordinate of click, actual screen pixels (not unscaled internal)public boolean popupExpectingBuildRequest()
public void popupSetBuildRequest(int coord,
int ptype)
public void popupClearBuildRequest()
public void popupFireBuildingRequest()
private final int findEdge(int x,
int y)
x - x coordinate, in unscaled board, not actual pixels;
use scaleFromActualX(int) to converty - y coordinate, in unscaled board, not actual pixels
private final int findNode(int x,
int y)
x - x coordinate, in unscaled board, not actual pixels;
use scaleFromActualX(int) to converty - y coordinate, in unscaled board, not actual pixels
private final int findHex(int x,
int y)
x - x coordinate, in unscaled board, not actual pixels;
use scaleFromActualX(int) to converty - y coordinate, in unscaled board, not actual pixels
public void setMode(int m)
m - modeupdateMode()public int getMode()
private static void loadImages(java.awt.Component c)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||