public class ColorSpec
extends java.lang.Object
This class does not interpret the meaning of the color value.
Modifier and Type | Class and Description |
---|---|
private static class |
ColorSpec.ChUIColorConvertor
Color convertor for ChUI clients.
|
private static class |
ColorSpec.ChUIWorkArea
ChUI-specific work area with context-local data.
|
private static interface |
ColorSpec.ColorConvertor
Convert the color based on the current client type.
|
private static class |
ColorSpec.GUIColorConvertor
Color convertor for ChGUI clients.
|
private static class |
ColorSpec.GUIWorkArea
GUI-specific work area with context-local data.
|
private static class |
ColorSpec.WorkArea
Context-local data for color specification.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLOR_BLINK
Color name constant for BLINK color.
|
static java.lang.String |
COLOR_BOLD
Color name constant for BOLD color.
|
static java.lang.String |
COLOR_INPUT
Color name constant for INPUT color.
|
static java.lang.String |
COLOR_MESSAGES
Color name constant for MESSAGES color.
|
static java.lang.String |
COLOR_NORMAL
Color name constant for NORMAL color.
|
static int |
COLOR_VALUE
COLOR_VALUE definition
|
private java.lang.Object |
colorValue
Color name (String) or index (Integer) definition value
|
private static org.apache.commons.logging.Log |
LOG
Logger
|
private static ContextLocal<ColorSpec.WorkArea> |
workArea
Context-local global data area for color state
|
Constructor and Description |
---|
ColorSpec(ColorSpec color)
Copy constructor.
|
ColorSpec(int intValue)
Build color specification using integer value.
|
ColorSpec(java.lang.String value)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
Color |
convert()
Convert color specification into real color.
|
private static <T extends ColorSpec.WorkArea> |
locate()
Get the
ColorSpec.WorkArea instance for this context. |
private static int |
processAttribute(int attribute,
java.lang.String attr)
Process color attribute.
|
private static final org.apache.commons.logging.Log LOG
private static ContextLocal<ColorSpec.WorkArea> workArea
public static final int COLOR_VALUE
public static final java.lang.String COLOR_NORMAL
public static final java.lang.String COLOR_INPUT
public static final java.lang.String COLOR_MESSAGES
public static final java.lang.String COLOR_BOLD
public static final java.lang.String COLOR_BLINK
private java.lang.Object colorValue
public ColorSpec(ColorSpec color)
color
- existing color specification to duplicatepublic ColorSpec(java.lang.String value)
value
- color name.public ColorSpec(int intValue)
intValue
- Color number.private static <T extends ColorSpec.WorkArea> T locate()
ColorSpec.WorkArea
instance for this context.private static int processAttribute(int attribute, java.lang.String attr)
attribute
- Current attributes.attr
- Attribute string.public Color convert()