|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.htwdd.rosenkoenig.gui.genuts.Counter
public class Counter
This class holds the GUI representation of a counter. The counter consists of two rows, the first row is able to show up to four digits, while the second row is able to show up to three smaller digits with a "+" in front. The first row of digits is called "score", the second row is called "increase".
| Field Summary | |
|---|---|
private ImageSequenceSprite[] |
digits
|
private ImageSequenceSprite[] |
digitsChange
|
private static int |
DIST
|
private org.apache.log4j.Logger |
log
|
private Position |
position
|
private ImageSequenceSprite |
sign
|
| Constructor Summary | |
|---|---|
Counter(PlayField playfield)
Creates the different sprites needed to represent the digits and adds them to the playfield. |
|
| Method Summary | |
|---|---|
int |
getHeight()
|
int |
getWidth()
|
void |
hideChange()
hides the increase (digits and "+") |
void |
setChange(int change)
updates and shows the counter's increase. |
void |
setPosition(Position position)
|
void |
setScore(int score)
updates the counter's score. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int DIST
private org.apache.log4j.Logger log
private ImageSequenceSprite[] digits
private ImageSequenceSprite[] digitsChange
private ImageSequenceSprite sign
private Position position
| Constructor Detail |
|---|
public Counter(PlayField playfield)
playfield - the playfield that contains the counter| Method Detail |
|---|
public void setScore(int score)
score - 0 <= score <= 9999public void setChange(int change)
change - 0 <= increase <= 999public void hideChange()
public int getHeight()
public int getWidth()
public void setPosition(Position position)
position - the position to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||