|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsoc.client.SOCBoardPanel.BoardToolTip
| Field Summary | |
private int |
boxH
Our size |
private int |
boxW
Our size |
private int |
boxX
Our position (upper-left of tooltip box) |
private int |
boxY
Our position (upper-left of tooltip box) |
private SOCBoardPanel |
bpanel
|
(package private) int |
hoverCityID
hover settlement or city node ID, or 0. |
private int |
hoverID
"ID" coord as returned by findNode, findEdge, findHex |
(package private) boolean |
hoverIsPort
is hover a port at coordinate hoverID? |
private int |
hoverMode
Uses board mode constants: Will be NONE, PLACE_ROAD, PLACE_SETTLEMENT, PLACE_ROBBER for hex, or PLACE_INIT_SETTLEMENT for port. |
private SOCPlayingPiece |
hoverPiece
Object last pointed at; null for hexes and ports |
(package private) int |
hoverRoadID
hover road ID, or 0. |
(package private) int |
hoverSettlementID
hover settlement or city node ID, or 0. |
private java.lang.String |
hoverText
Text to hover-display, or null if nothing to show |
private int |
mouseX
Mouse position |
private int |
mouseY
Mouse position |
private int |
offsetX
Requested X-offset from mouse pointer (used for robber placement) |
private int |
PADDING_HORIZ
|
private int |
TEXT_INSET
|
| Constructor Summary | |
(package private) |
SOCBoardPanel.BoardToolTip(SOCBoardPanel ourBoardPanel)
|
| Method Summary | |
java.lang.String |
getHoverText()
Currently displayed text. |
private void |
handleHover(int x,
int y)
Mouse is hovering during normal play; look for info for tooltip text. |
void |
hideHoverAndPieces()
Clear hover text, and cancel any hovering roads/settlements/cities |
boolean |
isVisible()
|
void |
paint(java.awt.Graphics g)
Draw; Graphics should be the boardpanel's gc, as seen in its paint method. |
java.lang.String |
portDescAtNode(int id)
Check at this node coordinate for a port, and return its descriptive text. |
void |
positionToMouse(int x,
int y)
Show tooltip at appropriate location when mouse is at (x,y) relative to the board. |
void |
setHoverText(java.lang.String t)
|
void |
setOffsetX(int ofsX)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private SOCBoardPanel bpanel
private java.lang.String hoverText
private int hoverMode
private int hoverID
private SOCPlayingPiece hoverPiece
int hoverRoadID
int hoverSettlementID
int hoverCityID
boolean hoverIsPort
private int mouseX
private int mouseY
private int boxX
private int boxY
private int offsetX
private int boxW
private int boxH
private final int TEXT_INSET
private final int PADDING_HORIZ
| Constructor Detail |
SOCBoardPanel.BoardToolTip(SOCBoardPanel ourBoardPanel)
| Method Detail |
public java.lang.String getHoverText()
public boolean isVisible()
public void positionToMouse(int x,
int y)
x - x-coordinate of mouse, actual screen pixels (not unscaled internal)y - y-coordinate of mouse, actual screen pixels (not unscaled internal)public void setOffsetX(int ofsX)
public void setHoverText(java.lang.String t)
public void hideHoverAndPieces()
public void paint(java.awt.Graphics g)
private void handleHover(int x,
int y)
x - Cursor x, from upper-left of board: actual coordinates, not board-internal coordinatesy - Cursor y, from upper-left of board: actual coordinates, not board-internal coordinatespublic java.lang.String portDescAtNode(int id)
id - Node coordinate ID for potential port
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||