net.curre.prefcount.gui
Class ScoreBoardLocationsMap

java.lang.Object
  extended by net.curre.prefcount.gui.ScoreBoardLocationsMap

public class ScoreBoardLocationsMap
extends java.lang.Object

This class determines locaitons of all items on the score board given the current dimensions of the table/board.

Created date: Jun 16, 2007

Author:
Yevgeny Nyden

Field Summary
static java.lang.String FINAL_MOUNT
          Location Map key that represents player's final mountain.
static java.lang.String FINAL_SCORE
          Location Map key that represents player's final score.
static java.lang.String PLAYER_BULLET
          Location Map key that represents player bullet.
static java.lang.String PLAYER_MOUNT
          Location Map key that represents player mountain.
static java.lang.String PLAYER_NAME
          Location Map key that represents player name.
static java.lang.String VIST_SALDO
          Location Map key that represents player's total vist saldo.
static java.lang.String VIST_SALDO_FOR
          Location Map key that represents player's vist saldo against other players.
static java.lang.String VISTS_FOR
          Location Map key prefix that represents player's vists agains another player.
 
Constructor Summary
ScoreBoardLocationsMap(ScoreBoardPanel scoreBoard)
          Constructor.
 
Method Summary
 void computeLocations()
          Computes or recomputes if necessary locations of all items on the score board and stores the values in the locationsMap map.
 java.util.Map<java.lang.String,java.awt.geom.Point2D.Float> getLocationsMap(int playerIndex)
          Getter for the locations maps for 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

PLAYER_NAME

public static final java.lang.String PLAYER_NAME
Location Map key that represents player name.

See Also:
Constant Field Values

PLAYER_MOUNT

public static final java.lang.String PLAYER_MOUNT
Location Map key that represents player mountain.

See Also:
Constant Field Values

PLAYER_BULLET

public static final java.lang.String PLAYER_BULLET
Location Map key that represents player bullet.

See Also:
Constant Field Values

VISTS_FOR

public static final java.lang.String VISTS_FOR
Location Map key prefix that represents player's vists agains another player. Full key string is comprised of the prefix and the other player's index.

See Also:
Constant Field Values

VIST_SALDO_FOR

public static final java.lang.String VIST_SALDO_FOR
Location Map key that represents player's vist saldo against other players. Full key string is comprised of the prefix and the other player's index.

See Also:
Constant Field Values

VIST_SALDO

public static final java.lang.String VIST_SALDO
Location Map key that represents player's total vist saldo.

See Also:
Constant Field Values

FINAL_MOUNT

public static final java.lang.String FINAL_MOUNT
Location Map key that represents player's final mountain.

See Also:
Constant Field Values

FINAL_SCORE

public static final java.lang.String FINAL_SCORE
Location Map key that represents player's final score.

See Also:
Constant Field Values
Constructor Detail

ScoreBoardLocationsMap

public ScoreBoardLocationsMap(ScoreBoardPanel scoreBoard)
Constructor. After the number of players in the game is known (scoreBoard.results.getPlayerStats() is created), the initialize() method must be called.

Parameters:
scoreBoard - Reference to the score board panel.
Method Detail

initialize

public void initialize(int numberOfPlayers)
Method that initializes properties and computes the locations for the first time. This method must be called as soon as the number of players is set (scoreBoard.results.getPlayerStats() is created).

Parameters:
numberOfPlayers - Number of players in the game.
Throws:
java.lang.IllegalArgumentException - If number of players is not supported.

getLocationsMap

public java.util.Map<java.lang.String,java.awt.geom.Point2D.Float> getLocationsMap(int playerIndex)
Getter for the locations maps for the given player.

Parameters:
playerIndex - Players index.
Returns:
The locations maps for the given player.

computeLocations

public void computeLocations()
Computes or recomputes if necessary locations of all items on the score board and stores the values in the locationsMap map.

Throws:
java.lang.UnsupportedOperationException - If numberof player is not supported.


Copyright © 2008. All Rights Reserved.