|
TelnetD at SF | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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. colors and style). |
java.lang.String |
formatBold(java.lang.String str)
Returns a "bold formatted" string containing terminal dependent GR escape sequences (i.e. colors and style). |
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. |
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. |
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. |
byte[] |
getSpecialSequence(int sequence)
Returns the terminal dependent escape sequence for a given defined special function. |
boolean |
supportsScrolling()
Returns if the terminal implementation supports scrolling (i.e. setting scroll margins). |
boolean |
supportsSGR()
Returns if the terminal implementation supports graphics rendition (i.e. colors and styles). |
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 |
public static final byte EOT
public static final byte BS
public static final byte DEL
public static final byte HT
public static final byte FF
public static final byte SGR
public static final byte CAN
public static final byte ESC
public static final byte LSB
public static final byte SEMICOLON
public static final byte A
public static final byte B
public static final byte C
public static final byte D
public static final byte E
public static final byte H
public static final byte f
public static final byte r
public static final byte LE
public static final byte SE
| Method Detail |
public int translateControlCharacter(int byteread)
byteread - int read from the input stream.
public int translateEscapeSequence(int[] buffer)
buffer - array of integers containing a escape sequence.
public byte[] getEraseSequence(int eraseFunc)
eraseFunc - representing one of the specified erase functions.
TerminalIO.EEOL,
TerminalIO.EBOL,
TerminalIO.EEL,
TerminalIO.EEOS,
TerminalIO.EBOS,
TerminalIO.EES
public byte[] getCursorMoveSequence(int dir,
int times)
dir - Direction of movement.times - Number of movements into given direction.
public byte[] getCursorPositioningSequence(int[] pos)
pos - Position to move the cursor to.
TerminalIO.HOMEpublic byte[] getSpecialSequence(int sequence)
sequence - the special sequence defined as int in TerminalIO.
TerminalIO.STORECURSOR,
TerminalIO.RESTORECURSOR
public 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.
public byte[] getGRSequence(int type,
int param)
type - Type of graphics rendition request.param - Parameter to the type requested.
public java.lang.String format(java.lang.String str)
str - String to be formatted.
public java.lang.String formatBold(java.lang.String str)
str - String to be formatted.
public byte[] getInitSequence()
public boolean supportsSGR()
public boolean supportsScrolling()
public int getAtomicSequenceLength()
|
TelnetD at SF | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||