|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
ObjectEnum<X364>
X364
public enum X364
Escape codes from ANSI X3.64 standard (aka ECMA-48 and ISO/IEC 6429).
Colors
| utility/geotk-utility (download) | View source code for this class |
| Enum Constant Summary | |
|---|---|
BACKGROUND_BLUE
Blue background color, normal intensity. |
|
BACKGROUND_CYAN
Cyan background color, normal intensity. |
|
BACKGROUND_DEFAULT
Reset the background color. |
|
BACKGROUND_GRAY
Gray background color, normal intensity. |
|
BACKGROUND_GREEN
Green background color, normal intensity. |
|
BACKGROUND_MAGENTA
Magenta background color, normal intensity. |
|
BACKGROUND_RED
Red background color, normal intensity. |
|
BACKGROUND_YELLOW
Yellow background color, normal intensity. |
|
BOLD
Bold intensity. |
|
FAINT
Faint intensity. |
|
FOREGROUND_BLUE
Blue foreground color, normal intensity. |
|
FOREGROUND_CYAN
Cyan foreground color, normal intensity. |
|
FOREGROUND_DEFAULT
Reset the foreground color. |
|
FOREGROUND_GRAY
Gray foreground color, normal intensity. |
|
FOREGROUND_GREEN
Green foreground color, normal intensity. |
|
FOREGROUND_MAGENTA
Magenta foreground color, normal intensity. |
|
FOREGROUND_RED
Red foreground color, normal intensity. |
|
FOREGROUND_YELLOW
Yellow foreground color, normal intensity. |
|
NORMAL
Normal intensity (not BOLD). |
|
RESET
Reset all attributes to their default value. |
|
| Method Summary | |
|---|---|
X364 |
background()
Returns the enum for the background color. |
X364 |
foreground()
Returns the enum for the foreground color. |
static boolean |
isSupported()
Returns true if we think that the operating system supports X3.64 sequences. |
static int |
lengthOfPlain(String text)
Returns the length of the given string without the ANSI escape codes. |
static String |
plain(String text)
Removes all escape codes from the given string. |
String |
sequence()
Returns the X3.64 escape sequence. |
static String |
toHTML(String text)
Replaces escape codes in the given string by HTML <font> instructions. |
static X364 |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static X364[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final X364 RESET
public static final X364 NORMAL
BOLD).
public static final X364 BOLD
public static final X364 FAINT
public static final X364 FOREGROUND_RED
public static final X364 FOREGROUND_GREEN
public static final X364 FOREGROUND_YELLOW
public static final X364 FOREGROUND_BLUE
public static final X364 FOREGROUND_MAGENTA
public static final X364 FOREGROUND_CYAN
public static final X364 FOREGROUND_GRAY
public static final X364 FOREGROUND_DEFAULT
public static final X364 BACKGROUND_RED
public static final X364 BACKGROUND_GREEN
public static final X364 BACKGROUND_YELLOW
public static final X364 BACKGROUND_BLUE
public static final X364 BACKGROUND_MAGENTA
public static final X364 BACKGROUND_CYAN
public static final X364 BACKGROUND_GRAY
public static final X364 BACKGROUND_DEFAULT
| Method Detail |
|---|
public static X364[] values()
for (X364 c : X364.values()) System.out.println(c);
public static X364 valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic X364 foreground()
this if this enum is already a foreground color.public X364 background()
this if this enum is already a background color.public String sequence()
public static String toHTML(String text)
<font> instructions.
If no HTML instruction is associated to the given escape code, then the escape
sequence is removed.
text - The text with X3.64 sequences.
<font> instructions.public static String plain(String text)
text - The string which may contains escape codes.
text reference if
it didn't contained any escape codes.public static int lengthOfPlain(String text)
plain(text).length()
without the cost of creating a temporary string.
text - The string which may contains escape codes.
public static boolean isSupported()
true if we think that the operating system supports X3.64 sequences.
This method performs a very naive and approximative check. Result is just a hint and
may be wrong.
This method does not check if a console is attached to the running JVM because the caller may want to write to the standard error stream instead than the standard output stream, in which case the console information is not applicable.
true if we think that the operating system supports X3.64.
This method may conservatively returns false in case of doubt.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||