|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.misc.LyResourceBundle
leon.misc.LyColors
public class LyColors
This class is used to manage color resources of an application. For each instance a mapping is done between color key and color name (e.g. LY_MENU_COLOR and Gray75) using the LyResourceBundle mechanism. A static Hashtable of color codes is kept in memory: the table contains color name as a key and the RGB components of the color (eg Gray75 and 191 191 191).
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static java.lang.String |
COLOR_CODES_FILE
Default color codes file. |
static java.lang.String |
DEFAULT_COLOR
Default color key. |
static java.lang.String |
SYSTEM_COLOR
System color key. |
Fields inherited from class leon.misc.LyResourceBundle |
---|
PACKAGE_DIR, PROPERTIES_DIR, UPPER_CASE_KEYS_ONLY |
Constructor Summary | |
---|---|
LyColors(LyEnvironment environment)
Constructor with a given environment. |
|
LyColors(LyEnvironment environment,
java.lang.String name)
Constructor with a given environment and name. |
|
LyColors(LyEnvironment environment,
java.lang.String name,
java.lang.String skin)
Constructor with a given environment and name. |
Method Summary | |
---|---|
static LyColor |
getBarycentricColor(LyColor minColor,
LyColor maxColor,
float ratio)
Gets theColor computed with two colors and a ratio. |
LyColor |
getColor(java.lang.String key)
Gets the color corresponding to the given key. |
java.util.Vector<java.lang.String> |
getColorCodes()
Gets the list of color keys of the color_codes properties file. |
static LyColor |
getColorFromHexString(java.lang.String hexColor)
Gets the Color representation of the given hexedecimal color code. |
static java.lang.String |
getHexString(int r,
int g,
int b)
Gets the hexadecimal string representation of the given RGB components. |
static java.lang.String |
getHexString(LyColor color)
Gets the hexadecimal string representation of the given color. |
Methods inherited from class leon.misc.LyResourceBundle |
---|
checkKey, clearCache, free, get, getKeyList, getKeys, getSonEnvironments, hasKey, put, remove, removeBundles, saveTo |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final java.lang.String SYSTEM_COLOR
public static java.lang.String DEFAULT_COLOR
public static java.lang.String COLOR_CODES_FILE
Constructor Detail |
---|
public LyColors(LyEnvironment environment)
environment
- The environment of the colors bundle.public LyColors(LyEnvironment environment, java.lang.String name)
environment
- The environment of the colors bundle.name
- The name of the colors bundle.public LyColors(LyEnvironment environment, java.lang.String name, java.lang.String skin)
environment
- The environment of the colors bundle.name
- The name of the colors bundle.skin
- The name of the skinMethod Detail |
---|
public static java.lang.String getHexString(int r, int g, int b)
r
- The red component of the color.g
- The green component of the color.b
- The blue component of the color.
public static java.lang.String getHexString(LyColor color)
color
- The color to convert.
public static LyColor getColorFromHexString(java.lang.String hexColor)
hexColor
- the hexadecimal code for the color.
public static LyColor getBarycentricColor(LyColor minColor, LyColor maxColor, float ratio)
minColor
- the first colormaxColor
- the second colorratio
- the ratio that must be used to compute the color. If ratio equals 0, the
first color is returned. If ratio equals 1, the second color is returned. If
ratio is between 0 and 1, use a barycentric algorithm to compute the color.
public java.util.Vector<java.lang.String> getColorCodes()
color_codes
properties file.
public LyColor getColor(java.lang.String key)
key
- the color key.
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |