|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.client.reference.util.GUISupport
Provides support for color, font, integer, and icon properties. The values of various properties are stored in "config/display.properties", and retrieved by supplying the appropriate key string.
Colors are specified as RGB triples (e.g. COLOR_BOARD=200, 150, 50).
Fonts are specified as family, style, size triples (e.g.
FONT_BOARD=Helvetica,plain,12). Valid values for style are plain, bold,
italic, and bold_italic.
Icons are specified as the filepath (e.g.
ICON_ABOUT=/org/moyoman/client/reference/icons/About24.gif).
Field Summary | |
private static Properties |
_displayProperties
Properties. |
private static int |
BOLD_ITALIC_INT
|
private static String |
BOLD_ITALIC_STRING
|
private static String |
BOLD_STRING
|
private static String |
GUI_PROPERTIES_FILEPATH
Display properties filepath. |
private static String |
ITALIC_STRING
|
private static String |
PLAIN_STRING
|
Fields inherited from interface org.moyoman.client.reference.util.IGUIConstants |
DEBUG, DIRTY_PROPERTY, GAP, MARGIN, TRANSPARENT_COLOR |
Constructor Summary | |
private |
GUISupport()
Private constructor to disallow direct instantiation. |
Method Summary | |
private static Color |
colorFromString(String colorDesc)
Return a Color object described by the given
String . |
private static int |
convertStyleFromString(String styleDesc)
Return a string representing the given style integer. |
private static Font |
fontFromString(String fontDesc)
Return a Font object described by the given
String . |
static Color |
getColor(String key)
Return the color specified by the given key. |
static Font |
getFont(String key)
Return the font specified by the given key. |
static Icon |
getIcon(String key)
Return the icon specified by the given key. |
static int |
getInt(String key)
Return the integer specified by the given key. |
private static int |
getIntFromString(String string)
Return an integer from the given string. |
static String |
getString(String key)
Return the string specified by the given key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String PLAIN_STRING
private static final String BOLD_STRING
private static final String ITALIC_STRING
private static final String BOLD_ITALIC_STRING
private static final int BOLD_ITALIC_INT
private static final String GUI_PROPERTIES_FILEPATH
private static Properties _displayProperties
Constructor Detail |
private GUISupport()
Method Detail |
public static Color getColor(String key)
key
- Key which identifies the desired resource.public static Font getFont(String key)
key
- Key which identifies the desired resource.public static Icon getIcon(String key)
public static int getInt(String key)
key
- Key which identifies the desired resource.
public static String getString(String key)
key
- Key which identifies the desired resource.
private static int getIntFromString(String string)
string
- The String
to parse.
IllegalArgumentException
- if string is null.
NumberFormatException
- if the string does not contain a parsable
integer.private static Color colorFromString(String colorDesc)
Color
object described by the given
String
. The method calls convertFromString(
convertToString( color ) ) return the original color.
colorDesc
- A String
description of a color.
IllegalArgumentException
- if colorDesc is null.
NumberFormatException
- if the description is improperly
formatted.private static int convertStyleFromString(String styleDesc)
styleDesc
- The style descriptor of interest.
IllegalArgumentException
- if styleDesc is null.private static Font fontFromString(String fontDesc)
Font
object described by the given
String
. The method calls convertFromString(
convertToString( font ) ) return the original font.
fontDesc
- A String
description of a font.
IllegalArgumentException
- if fontDesc is null.
NumberFormatException
- if the description is improperly
formatted.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |