|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.curre.prefcount.gui.ScoreBoardLocationsMap
public class ScoreBoardLocationsMap
This class is a utility to determine locaitons of all items on the score board given the current dimensions of the table/board.
Created date: Jun 16, 2007
| Field Summary | |
|---|---|
int |
centerX
Center's current X coordinate. |
int |
centerY
Center's current X coordinate. |
int |
height
Current board height. |
static int |
MARGIN
Number of pixels to leave near the borders. |
int |
oneFifthY
Computed 1/5 of the half height value. |
int |
poolMountDividerX
Computed pool-mount divider X coordinate. |
int |
poolMountDividerY
Computed pool-mount divider Y coordinate. |
int |
threeFifthX
Computed 3/5 of the half width value. |
int |
threeFifthY
Computed 3/5 of the half height value. |
int |
twoFifthX
Computed 2/5 of half width value. |
int |
twoFifthY
Computed 2/5 of the half height value. |
int |
whistDividerX1
Computed value for whist division lines. |
int |
whistDividerX2
Computed value for whist division lines. |
int |
whistDividerY1
Computed value for whist division lines. |
int |
whistDividerY2
Computed value for whist division lines. |
int |
whistPoolDividerX
Computed whist-pool divider X coordinate. |
int |
whistPoolDividerY
Computed whist-pool divider Y coordinate. |
int |
width
Current board width. |
| Constructor Summary | |
|---|---|
ScoreBoardLocationsMap(ScoreBoardPanel scoreBoard)
Constructor. |
|
| Method Summary | |
|---|---|
void |
computeLocations(int newWidth,
int newHeight,
int offsetX,
int offsetY,
boolean force)
Computes or recomputes if necessary locations of all items on the score board and stores the values in the locationsMap map. |
java.util.Map<ScoreItem,java.awt.geom.Point2D.Double> |
getLocationsMap(Place place)
Getter for the locations maps for the given player. |
ScoreItem[] |
getOtherWhistItems(Place place)
Gets whist score items for all other players relative to the given player. |
ScoreItem[] |
getOtherWhistSaldoItems(Place place)
Gets whist saldo score items for all other players relative to the given player. |
void |
initialize(int numberOfPlayers)
Method that initializes properties and computes the locations for the first time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MARGIN
public int width
public int height
public int centerX
public int centerY
public int twoFifthX
public int threeFifthX
public int oneFifthY
public int twoFifthY
public int threeFifthY
public int whistPoolDividerX
public int whistPoolDividerY
public int poolMountDividerX
public int poolMountDividerY
public int whistDividerX1
public int whistDividerX2
public int whistDividerY1
public int whistDividerY2
| Constructor Detail |
|---|
public ScoreBoardLocationsMap(ScoreBoardPanel scoreBoard)
scoreBoard - Reference to the score board panel.| Method Detail |
|---|
public void initialize(int numberOfPlayers)
numberOfPlayers - Number of players in the game.
java.lang.IllegalArgumentException - If number of players is not supported.public java.util.Map<ScoreItem,java.awt.geom.Point2D.Double> getLocationsMap(Place place)
place - Players place.
public void computeLocations(int newWidth,
int newHeight,
int offsetX,
int offsetY,
boolean force)
newWidth - new width of the score board.newHeight - new height of the score board.offsetX - canvas X coordinate.offsetY - canvas Y coordinate.force - true will ensure that all locations will get recomputed;
when false, the method does nothing if the scoreboard width.public ScoreItem[] getOtherWhistItems(Place place)
place - player's place.
public ScoreItem[] getOtherWhistSaldoItems(Place place)
place - player's place.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||