|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Terminal
On top of the telnet protocol communication layer
there is a layer for terminal communication. This layer
is represented by so called escape sequences that are filtered
and interpreted.
This interface defines abstracts filtering and translation
methods so that the TerminalIO is independent of a specific
terminal implementation.
TerminalIO| Field Summary | |
|---|---|
static byte |
A
A (UP) The byte code of A, as used in escape sequences for cursor up. |
static byte |
B
B (DOWN) The byte code of B, as used in escape sequences for cursor down. |
static byte |
BS
BackSpace The ANSI defined byte code of backspace. |
static byte |
C
C (RIGHT) The byte code of C, as used in escape sequences for cursor right. |
static byte |
CAN
Cancel The ANSI defined byte code for cancelling an escape sequence. |
static byte |
D
D (LEFT) The byte code of D, as used in escape sequences for cursor left. |
static byte |
DEL
Delete The ANSI defined byte code of delete. |
static byte |
E
Other characters used in escape sequences. |
static byte |
EOT
End of transmission Ctrl-d, which flags end of transmission, or better said a client logout request. |
static byte |
ESC
Escape The ANSI definde byte code of escape. |
static byte |
f
|
static byte |
FF
FormFeed The ANSI defined byte code of a form feed. |
static byte |
H
|
static byte |
HT
Horizontal Tab The ANSI defined byte code of a horizontal tabulator. |
static byte |
LE
Characters needed for erase sequences. |
static byte |
LSB
[ Left Square Bracket The ANSI defined byte code of a left square bracket, as used in escape sequences. |
static byte |
r
|
static byte |
SE
|
static byte |
SEMICOLON
; Semicolon The ANSI defined byte code of a semicolon, as used in escape sequences. |
static byte |
SGR
SGR Input Key Ctrl-a as defined byte code. |
| Method Summary | |
|---|---|
java.lang.String |
format(java.lang.String str)
Returns a "formatted" string containing terminal dependent GR escape sequences (i.e. |
java.lang.String |
formatBold(java.lang.String str)
Returns a "bold formatted" string containing terminal dependent GR escape sequences (i.e. |
int |
getAtomicSequenceLength()
Returns the atomic escape sequence length of the terminal implementation as integer (without counting the escape itself). |
byte[] |
getCursorMoveSequence(int dir,
int times)
Returns a terminal dependent escape sequence for a given cursor movement. The directions available are: up (UP) down (DOWN) right (RIGHT) left (LEFT) |
byte[] |
getCursorPositioningSequence(int[] pos)
Returns a terminal dependent escape sequence for positioning the cursor to a given position: index 0: row coordinate index 1: column coordinate Note that home is a special positioning sequence. |
byte[] |
getEraseSequence(int eraseFunc)
Returns a terminal dependent escape sequence for a given defined erase function: erase to end of line (EEOL) erase to begin of line (EBOL) erase entire line (EEL) erase to end of screen (EEOS) erase to beginning of screen (EBOS) erase entire screen (EES) |
byte[] |
getGRSequence(int type,
int param)
Returns the terminal dependent escape sequence for a given graphics rendition request. Defined are following types: foreground color (FCOLOR) with any color defined in BasicTerminalIO as parameter. |
byte[] |
getInitSequence()
Returns the byte sequence that will init the terminal. |
byte[] |
getScrollMarginsSequence(int topmargin,
int bottommargin)
Returns the terminal dependent escape sequence for establishing the given scrollmargins. Note that this method is experimental and not available through the BasicTerminalIO interface yet. |
byte[] |
getSpecialSequence(int sequence)
Returns the terminal dependent escape sequence for a given defined special function. There are two special functions that should be implemented: store current cursor position (STORECURSOR) restore previously stored cursor position (RESTORECURSOR) |
boolean |
supportsScrolling()
Returns if the terminal implementation supports scrolling (i.e. |
boolean |
supportsSGR()
Returns if the terminal implementation supports graphics rendition (i.e. |
int |
translateControlCharacter(int byteread)
Translates a control character into terminal independent representation. |
int |
translateEscapeSequence(int[] buffer)
Translates an escape sequence into a terminal independent representation. |
| Field Detail |
|---|
static final byte EOT
static final byte BS
static final byte DEL
static final byte HT
static final byte FF
static final byte SGR
static final byte CAN
static final byte ESC
static final byte LSB
static final byte SEMICOLON
static final byte A
static final byte B
static final byte C
static final byte D
static final byte E
static final byte H
static final byte f
static final byte r
static final byte LE
static final byte SE
| Method Detail |
|---|
int translateControlCharacter(int byteread)
byteread - int read from the input stream.
int translateEscapeSequence(int[] buffer)
buffer - array of integers containing a escape sequence.
byte[] getEraseSequence(int eraseFunc)
eraseFunc - representing one of the specified erase functions.
TerminalIO.EEOL,
TerminalIO.EBOL,
TerminalIO.EEL,
TerminalIO.EEOS,
TerminalIO.EBOS,
TerminalIO.EES
byte[] getCursorMoveSequence(int dir,
int times)
dir - Direction of movement.times - Number of movements into given direction.
byte[] getCursorPositioningSequence(int[] pos)
pos - Position to move the cursor to.
TerminalIO.HOMEbyte[] getSpecialSequence(int sequence)
sequence - the special sequence defined as int in TerminalIO.
TerminalIO.STORECURSOR,
TerminalIO.RESTORECURSOR
byte[] getScrollMarginsSequence(int topmargin,
int bottommargin)
topmargin - upper border of the scrolling area as row coordinate.bottommargin - lower border of the scrolling area as row coordinate.
byte[] getGRSequence(int type,
int param)
type - Type of graphics rendition request.param - Parameter to the type requested.
java.lang.String format(java.lang.String str)
str - String to be formatted.
java.lang.String formatBold(java.lang.String str)
str - String to be formatted.
byte[] getInitSequence()
boolean supportsSGR()
boolean supportsScrolling()
int getAtomicSequenceLength()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||