|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.htwdd.rosenkoenig.gui.genuts.Name
public class Name
This class holds the GUI representation of a String. The Name can consist of up to
nine letters.
A Name can have two states: activated and deactivated. Activated names are drawn red,
deactivated names black.
| Field Summary | |
|---|---|
private ImageSequenceSprite[][] |
letters
|
static int |
MAX_LETTERS
|
private Position |
position
|
private static char[] |
UMLAUTS
|
| Constructor Summary | |
|---|---|
Name(PlayField playfield,
java.lang.String playerName)
Creates the different sprites needed to represent the player's name and adds them to the playfield. |
|
Name(PlayField playfield,
java.lang.String playerName,
boolean activate)
|
|
| Method Summary | |
|---|---|
void |
activate()
Changes the letter color to red. |
void |
deactivate()
Changes the letter color to black. |
int |
getCharHeight()
|
int |
getCharWidth()
|
int |
getHeight()
|
int |
getWidth()
|
private void |
placeLetters()
Places the single letters this Name consists of. |
private void |
setName(java.lang.String playerName)
Changes the string this Name represents. |
void |
setPosition(Position position)
Positions the letters of this Name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_LETTERS
private static final char[] UMLAUTS
private ImageSequenceSprite[][] letters
private Position position
| Constructor Detail |
|---|
public Name(PlayField playfield,
java.lang.String playerName,
boolean activate)
throws java.lang.Exception
java.lang.Exception
public Name(PlayField playfield,
java.lang.String playerName)
throws java.lang.Exception
playfield - the playfield that contains the NameplayerName - take a guess!
java.lang.Exception| Method Detail |
|---|
private void setName(java.lang.String playerName)
playerName - Obermopsprivate void placeLetters()
public int getHeight()
public int getWidth()
public int getCharHeight()
public int getCharWidth()
public void activate()
public void deactivate()
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 | |||||||||