JTP
Class Highscores

java.lang.Object
  extended by JTP.Highscores

public class Highscores
extends Object

Defines function and rendering of the highscore UI component

Author:
V.Termanis

Field Summary
static int CLOSE
           
static int COOP
           
static int NAME_CHANGED
           
static int NONE
           
static int SCORE_SET
           
static int SINGLE
           
 
Constructor Summary
Highscores(Images imgData, ScreenFrames frames, TilePainter tilePainter, Color buttonBorderColor, float buttonBorderThickness, int buttonSpacing, int maxChars)
           
 
Method Summary
 int clickResult(Point mouseLocation)
           
 void dealWithScore(boolean coop, int score)
          Decide whether the given score needs to be enterd in the highscore table
 void drawAll(Graphics2D g)
           
 void drawUpdate(Graphics2D g)
           
 int keyResult(int keyCode, Component c)
           
 int keyTypedResult(char c)
          Used to process key events for entering highscore name
 void mousePressed(int button, Point mouseLocation)
           
 void set2PTableAsActive(boolean b)
          Choose which highscore table should be shown
 Rectangle updateUI(Point mouseLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
See Also:
Constant Field Values

CLOSE

public static final int CLOSE
See Also:
Constant Field Values

SINGLE

public static final int SINGLE
See Also:
Constant Field Values

COOP

public static final int COOP
See Also:
Constant Field Values

SCORE_SET

public static final int SCORE_SET
See Also:
Constant Field Values

NAME_CHANGED

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

Highscores

public Highscores(Images imgData,
                  ScreenFrames frames,
                  TilePainter tilePainter,
                  Color buttonBorderColor,
                  float buttonBorderThickness,
                  int buttonSpacing,
                  int maxChars)
Method Detail

updateUI

public Rectangle updateUI(Point mouseLocation)

set2PTableAsActive

public void set2PTableAsActive(boolean b)
Choose which highscore table should be shown

Parameters:
b - set to true to show the two player table

clickResult

public int clickResult(Point mouseLocation)

mousePressed

public void mousePressed(int button,
                         Point mouseLocation)

keyResult

public int keyResult(int keyCode,
                     Component c)

keyTypedResult

public int keyTypedResult(char c)
Used to process key events for entering highscore name


drawUpdate

public void drawUpdate(Graphics2D g)

dealWithScore

public void dealWithScore(boolean coop,
                          int score)
Decide whether the given score needs to be enterd in the highscore table

Parameters:
coop - indicates whether the score is from cooperative mode or not
score - number of points made

drawAll

public void drawAll(Graphics2D g)