public class VT100Attribs
extends java.lang.Object
Vona's utils: VT100 terminal attribute codes.
From ANSI/VT100 Terminal Control (local copy):
Set Attribute Mode <ESC>[{attr1};...;{attrn}mSets multiple display attribute settings. The following lists standard attributes:
0 Reset all attributes 1 Bright 2 Dim 4 Underscore 5 Blink 7 Reverse 8 Hidden Foreground Colours 30 Black 31 Red 32 Green 33 Yellow 34 Blue 35 Magenta 36 Cyan 37 White Background Colours 40 Black 41 Red 42 Green 43 Yellow 44 Blue 45 Magenta 46 Cyan 47 White
Also see VT100 escape codes (local copy).
Copyright (C) 2004 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Modifier and Type | Field and Description |
---|---|
static VT100Attribs |
BLACK
The foreground black code.
|
static VT100Attribs |
BLUE
The foreground blue code.
|
private static java.lang.String |
cvsid
CVS id.
|
static VT100Attribs |
CYAN
The foreground cyan code.
|
static char |
ESC
The VT100 escape character, ASCII 27(dec), 033(oct), 1B(hex).
|
static VT100Attribs |
GREEN
The foreground green code.
|
static VT100Attribs |
MAGENTA
The foreground magenta code.
|
static VT100Attribs |
RED
The foreground red code.
|
static VT100Attribs |
RESET
The VT100 reset code.
|
private java.lang.String |
s
The escape sequence.
|
static java.lang.String |
TERMINAL_TYPE_PROPERTY
terminal type property, see
getTermType() |
static VT100Attribs |
WHITE
The foreground white code.
|
static VT100Attribs |
YELLOW
The foreground yellow code.
|
Constructor and Description |
---|
VT100Attribs(int[] attrs)
Create a new VT100 attributes code.
|
Modifier and Type | Method and Description |
---|---|
static void |
dump(java.io.PrintStream s)
dump terminal type and whether we guess it's VT100 compatible
|
static java.lang.String |
getTermType()
Try to get the terminal type associated with the invocation environment
of the JVM.
|
static java.lang.String |
getTermTypeSafely()
covers
getTermType() , eats AccessControlException |
static boolean |
guessVT100()
|
static boolean |
guessVT100(java.lang.String term)
Try to guess wether the indicated terminal type accepts VT100
codes.
|
static boolean |
guessVT100Safely()
|
static void |
main(java.lang.String[] arg)
test driver
|
java.lang.String |
toString()
Return the VT100 escape string corresponding to the attribute code
sequence that was passed to the constructor.
|
private static final java.lang.String cvsid
CVS id.
public static final java.lang.String TERMINAL_TYPE_PROPERTY
getTermType()
public static final char ESC
The VT100 escape character, ASCII 27(dec), 033(oct), 1B(hex).
public static final VT100Attribs RESET
The VT100 reset code.
public static final VT100Attribs BLACK
The foreground black code.
public static final VT100Attribs RED
The foreground red code.
public static final VT100Attribs GREEN
The foreground green code.
public static final VT100Attribs YELLOW
The foreground yellow code.
public static final VT100Attribs BLUE
The foreground blue code.
public static final VT100Attribs MAGENTA
The foreground magenta code.
public static final VT100Attribs CYAN
The foreground cyan code.
public static final VT100Attribs WHITE
The foreground white code.
private java.lang.String s
The escape sequence.
public VT100Attribs(int[] attrs)
Create a new VT100 attributes code.
The string version of the resulting object will be a VT100 escape string corresponding to the specified attribute code sequence.
attrs
- a sequence of attribute codespublic java.lang.String toString()
Return the VT100 escape string corresponding to the attribute code sequence that was passed to the constructor.
toString
in class java.lang.Object
public static java.lang.String getTermType()
Try to get the terminal type associated with the invocation environment of the JVM.
AccessControlException
- if there is a security manager that
won't let us get system properties or environment variablespublic static java.lang.String getTermTypeSafely()
getTermType()
, eats AccessControlExceptionpublic static boolean guessVT100(java.lang.String term)
Try to guess wether the indicated terminal type accepts VT100 codes.
public static boolean guessVT100()
public static boolean guessVT100Safely()
public static void dump(java.io.PrintStream s)
public static void main(java.lang.String[] arg)