|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Color
com.miginfocom.util.gfx.UIColor
public class UIColor
A subclass to Color that stores it's value as string for later decoding to a Color
depending of the UI and platform. Also supports brighter/darker tinting of the named color and the
possibility to force the alpha channel to a specific value.
Since a Color is immutable the colorName is converted to a specific color at construction
and never changed after that. After Persistence the color is recreated in the new context depending on
the Look&Feel and platform when de-persisting.
| Field Summary |
|---|
| Fields inherited from class java.awt.Color |
|---|
black, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOW |
| Fields inherited from interface java.awt.Transparency |
|---|
BITMASK, OPAQUE, TRANSLUCENT |
| Constructor Summary | |
|---|---|
UIColor(java.lang.String colorName)
Creates a color from a string associated with this color. |
|
UIColor(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
Creates a color from a string associated with this color. |
|
| Method Summary | |
|---|---|
static java.awt.Color |
decodeToColor(java.lang.String colorName)
Uses the text to decode the color. |
static java.awt.Color |
decodeToColor(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
Uses the text to decode the color. |
static int |
decodeToRGBA(java.lang.String colorName)
Uses the text to decode the color. |
static int |
decodeToRGBA(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
Convert costructor arguments to an int color. |
java.lang.String |
getColorName()
Returns the name associated with this color. |
static java.lang.String[] |
getColorStrings()
Return the color string keys that the current UI stores a Color for. |
java.lang.Integer |
getForcedAlpha()
Returns the tint used for making the color darker or brighter. |
java.lang.Float |
getTint()
Returns the tint used for making the color darker or brighter. |
| Methods inherited from class java.awt.Color |
|---|
brighter, createContext, darker, decode, equals, getAlpha, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGB, getRGBColorComponents, getRGBComponents, getTransparency, hashCode, HSBtoRGB, RGBtoHSB, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UIColor(java.lang.String colorName)
Button.background or
controlDkShadow.
colorName - The color string. Not null.UIManager.getLookAndFeelDefaults()
public UIColor(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
Button.background or
controlDkShadow.
colorName - The color string. Not null.tint - The tint used for making the color darker or brighter. Between -1f and 1f, respectively. 0f means unchanged.
null leaves the color unchanged (I.e. No tint).forcedAlpha - The alpha of the color. 0..255. 255 is fully opaque. null leaves the alpha unchanged.GfxUtil.tintColor(java.awt.Color, float),
UIManager.getLookAndFeelDefaults()| Method Detail |
|---|
public java.lang.String getColorName()
Button.background or controlDkShadow.
public java.lang.Float getTint()
public java.lang.Integer getForcedAlpha()
public static int decodeToRGBA(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
colorName - The color string. Not null.tint - negative darkens, positive brightens. Between -1f and 1f.forcedAlpha - The alpha of the color. 0..255. 255 is fully opaque. null leaves the alpha unchanged.
public static final int decodeToRGBA(java.lang.String colorName)
Button.background or controlDkShadow.
colorName - The color string. Not null.
public static final java.awt.Color decodeToColor(java.lang.String colorName)
Button.background or controlDkShadow.
colorName - The color string. Not null.
Color for the found color or null if unknown or null is stored.
public static final java.awt.Color decodeToColor(java.lang.String colorName,
java.lang.Float tint,
java.lang.Integer forcedAlpha)
Button.background or controlDkShadow.
colorName - The color string. Not null.forcedAlpha - The alpha of the color. 0..255. 255 is fully opaque. null leaves the alpha unchanged.
Color for the found color or null if unknown or null is stored.public static java.lang.String[] getColorStrings()
Color for. Can be used to populate a combo box
for instance.
Button.background or controlDkShadow. Never null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||