public class TokenFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static int |
count
The Token counter used for assigning the numerical portion of an ObjID
|
private static int |
INITIAL_ENERGY
The initial energy constant of a Token
|
Modifier | Constructor and Description |
---|---|
private |
TokenFactory()
Restricts factory instantiation since all class data is static
|
Modifier and Type | Method and Description |
---|---|
static Token |
produce(java.lang.String buttonText,
java.lang.String buttonTooltip,
java.awt.Color bgColor,
java.awt.Color fgColor,
int x,
int y,
Image image,
java.util.Map<ObjID,NetPuzlObject> cache)
Produces a Token with a unique object ID and the given parameters
|
private static int count
private static final int INITIAL_ENERGY
private TokenFactory()
public static Token produce(java.lang.String buttonText, java.lang.String buttonTooltip, java.awt.Color bgColor, java.awt.Color fgColor, int x, int y, Image image, java.util.Map<ObjID,NetPuzlObject> cache)
buttonText
- The name (button text) to produce the Token withbuttonTooltip
- The text (button tooltip) to produce the Token withbgColor
- The background color to produce the Token withfgColor
- The foreground color to produce the Token withx
- The x value (grid coordinate) to produce the Token withy
- The y value (grid coordinate) to produce the Token withimage
- The Image to produce the Token withcache
- The Map to cache the Token in