|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object us.asciiroth.client.Util
public class Util
Static utility methods for the game.
Field Summary | |
---|---|
static com.google.gwt.core.client.GWT.UncaughtExceptionHandler |
UNCAUGHT_EXCEPTION_HANDLER
A generic uncaught exception handler that defers to the minimal logging implementation. |
Constructor Summary | |
---|---|
Util()
|
Method Summary | ||
---|---|---|
static java.lang.String |
format(java.lang.String format,
int... values)
Format a string of the format "This is a {0} format string {1}" by substituting the int values provided (there must be one for each braced substitution marker in the string). |
|
static java.lang.String |
format(java.lang.String format,
java.lang.String... values)
Format a string of the format "This is a {0} format string {1}" by substituting the string values provided (there must be one for each braced substitution marker in the string). |
|
static Item |
getItemOtherColor(Item item,
Color color)
Get an item of a similar type, but change it to the specified color. |
|
static
|
getType(java.lang.Class<T> c)
Get the simple name for this class (the class name without the package), which is used for serializing and serializing pieces. |
|
static java.lang.String |
getType(java.lang.Object obj)
Get the simple name of this object's class, which is used for serializing and deserializing pieces in the game. |
|
static int |
inRange(int value,
int lower,
int upper)
Return a value or the lower/upper bound of a range within which the value should fall. |
|
static boolean |
isBlank(java.lang.String str)
|
|
static boolean |
isNotBlank(java.lang.String str)
|
|
static Color |
oscillate(Color from,
Color to,
int rate,
int frame)
Given a base color and an alternate, oscillate between them. |
|
static java.lang.String |
renderSymbolAndLabel(boolean outside,
Piece piece,
int count)
Render the symbol with a label and a count of items, in both the cell info panel and the inventory palette. |
|
static java.lang.String |
renderSymbolAndLabel2(boolean outside,
Bag.Entry<Item> entry)
|
|
static void |
setOpacity(com.google.gwt.user.client.Element el,
double opacity)
Set the opacity on this element. |
|
static void |
showError(java.lang.String error)
Show an error to the user. |
|
static void |
showError(java.lang.String error,
java.lang.String... args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final com.google.gwt.core.client.GWT.UncaughtExceptionHandler UNCAUGHT_EXCEPTION_HANDLER
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.lang.String format(java.lang.String format, int... values)
format
- a string to formatvalues
- one or more values to substitute into the string.
public static java.lang.String format(java.lang.String format, java.lang.String... values)
format
- a string to formatvalues
- one or more values to substitute into the string.
public static Item getItemOtherColor(Item item, Color color)
item
- the item serving as a prototypecolor
- the new color for the new item created
public static <T> java.lang.String getType(java.lang.Class<T> c)
c
- the class of the piece
public static java.lang.String getType(java.lang.Object obj)
obj
- a piece
public static int inRange(int value, int lower, int upper)
value
- the value being testedlower
- the lowest number that can be returnedupper
- the highest number that can be returned
public static boolean isBlank(java.lang.String str)
public static boolean isNotBlank(java.lang.String str)
public static Color oscillate(Color from, Color to, int rate, int frame)
from
- to
- rate
- frame
-
public static java.lang.String renderSymbolAndLabel(boolean outside, Piece piece, int count)
outside
- piece
- count
-
public static java.lang.String renderSymbolAndLabel2(boolean outside, Bag.Entry<Item> entry)
public static void setOpacity(com.google.gwt.user.client.Element el, double opacity)
el
- opacity
- a double value for opacity (from 0.0 to 1.0)public static void showError(java.lang.String error)
error
- public static void showError(java.lang.String error, java.lang.String... args)
|
0.7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
© 2009 Alx Dark