public class ColorManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ColorManager.WorkArea
Context-local data for this color manager.
|
Modifier and Type | Field and Description |
---|---|
static ColorRgb |
DEFAULT_RGB
Return value when any error occurs.
|
private static ContextLocal<ColorManager.WorkArea> |
local
Context local instance of this class.
|
private static java.util.logging.Logger |
LOG
Logger.
|
Constructor and Description |
---|
ColorManager() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
checkRange(int index,
int size)
Check color table index range.
|
static ColorRgb |
getBgColor(Window<?> window,
int index)
Get BGCOLOR RGB value for specified index from color table associate to a Window.
|
private static ColorRgb |
getColor(Window<?> window,
int index,
boolean kind)
Get a RGB color value from color table for specified index.
|
static ColorRgb |
getFgColor(Window<?> window,
int index)
Get FGCOLOR RGB value for specified index from color table associate to a Window.
|
private static ColorRgb |
getStdColor(ColorTable.EnvironmentColorTable ect,
java.lang.String std,
boolean kind)
Get foreground or background RGB color of a standard color.
|
static ColorRgb |
getStdColor(Window<?> window,
java.lang.String stdColor,
boolean kind)
Get foreground or background RGB color of a standard color.
|
static ColorRgb |
getSysColor(int index)
Return system color for a given index.
|
private static ColorManager.WorkArea |
locate()
Locate the context-local data of this class.
|
static void |
unload(java.lang.String envName)
Unload environment.
|
static void |
update(java.util.List<ColorTable.EnvironmentColorTable> envs)
Update environments collection.
|
public static final ColorRgb DEFAULT_RGB
private static final java.util.logging.Logger LOG
private static final ContextLocal<ColorManager.WorkArea> local
public static ColorRgb getSysColor(int index)
index
- System color index.public static ColorRgb getFgColor(Window<?> window, int index)
window
- Window instance.index
- Color table index.public static ColorRgb getBgColor(Window<?> window, int index)
window
- Window instance.index
- Color table index.public static ColorRgb getStdColor(Window<?> window, java.lang.String stdColor, boolean kind)
window
- Window instance.stdColor
- Standard color.kind
- true
get foreground color.
false
get background color.public static void update(java.util.List<ColorTable.EnvironmentColorTable> envs)
envs
- An array of environments objects.private static ColorRgb getColor(Window<?> window, int index, boolean kind)
window
- Window instance.index
- Color table index.kind
- true
get foreground color. false
get background color.private static boolean checkRange(int index, int size)
index
- Color table index.size
- Color table size.true
if index is in range 0..size false
otherwise.private static ColorRgb getStdColor(ColorTable.EnvironmentColorTable ect, java.lang.String std, boolean kind)
ect
- Environment color table.std
- Standard color.kind
- true
to get the foreground color, false
for the
background color.public static void unload(java.lang.String envName)
UNLOAD environment
statement is executed.envName
- Environment name.private static ColorManager.WorkArea locate()
ColorManager.WorkArea
instance.