com.sshtools.sshterm.emulation
Class TerminalEmulation

java.lang.Object
  |
  +--com.sshtools.sshterm.emulation.VDUBuffer
        |
        +--com.sshtools.sshterm.emulation.TerminalEmulation
All Implemented Interfaces:
PseudoTerminal, VDUInput

public abstract class TerminalEmulation
extends VDUBuffer
implements VDUInput, PseudoTerminal

Implementation of a VT terminal emulation plus ANSI compatible.

Maintainer: Marcus Meißner

Version:
$Id: TerminalEmulation.java,v 1.2 2002/09/16 20:02:16 martianx Exp $
Author:
Matthias L. Jugel, Marcus Meißner

Field Summary
static java.lang.String ANSI
          Description of the Field
static java.lang.String VT100
          Description of the Field
static java.lang.String VT220
          Description of the Field
static java.lang.String VT320
          Description of the Field
 
Fields inherited from class com.sshtools.sshterm.emulation.VDUBuffer
BOLD, bufSize, charArray, charAttributes, COLOR, COLOR_BG, COLOR_FG, cursorX, cursorY, debug, display, height, INVERT, LOW, maxBufSize, NORMAL, screenBase, SCROLL_DOWN, SCROLL_UP, scrollMarker, showcursor, UNDERLINE, update, width, windowBase
 
Fields inherited from interface com.sshtools.sshterm.emulation.VDUInput
KEY_ACTION, KEY_ALT, KEY_CONTROL, KEY_SHIFT
 
Constructor Summary
TerminalEmulation(java.lang.String term)
          Create a default vt320 terminal with 80 columns and 24 lines.
TerminalEmulation(java.lang.String term, int width, int height)
          Create a new vt320 terminal and intialize it with useful settings.
 
Method Summary
 void beep()
          Play the beep sound ...
 void clearScreen()
          Description of the Method
 java.lang.String getEncodedTerminalModes()
          Gets the encodedTerminalModes attribute of the TerminalEmulation object
 int getHeight()
          Gets the height attribute of the TerminalEmulation object
static java.util.List getSupportedEmulations()
          Gets the supportedEmulations attribute of the TerminalEmulation class
 java.lang.String getTerm()
          Gets the terminalId attribute of the TerminalEmulation object
 int getWidth()
          Gets the width attribute of the TerminalEmulation object
 void keyPressed(int keyCode, char keyChar, int modifiers)
          main keytyping event handler...
 void keyReleased(java.awt.event.KeyEvent evt)
          Description of the Method
 void keyTyped(int keyCode, char keyChar, int modifiers)
          Handle key Typed events for the terminal, this will get all normal key types, but no shift/alt/control/numlock.
 char map_cp850_unicode(char x)
          Description of the Method
 void mousePressed(int x, int y, int modifiers)
          Terminal is mouse-aware and requires (x,y) coordinates of on the terminal (character coordinates) and the button clicked.
 void mouseReleased(int x, int y, int modifiers)
          Terminal is mouse-aware and requires the coordinates and button of the release.
 void putString(java.lang.String s)
          Put string at current cursor position.
 void reset()
          Description of the Method
protected  void sendTelnetCommand(byte cmd)
          Description of the Method
 void setAnswerBack(java.lang.String ab)
          Sets the answerBack attribute of the vt320 object
 void setIBMCharset(boolean ibm)
          Enable the usage of the IBM character set used by some BBS's.
 void setKeyCodes(java.util.Properties codes)
          Override the standard key codes used by the terminal emulation.
 void setLocalEcho(boolean echo)
          Enable or disable the local echo property of the terminal.
 void setTerminalType(java.lang.String term)
          Sets the terminal type
 void setVMS(boolean vms)
          Enable the VMS mode of the terminal to handle some things differently for VMS hosts.
abstract  void write(byte[] b)
          Write an answer back to the remote host.
 
Methods inherited from class com.sshtools.sshterm.emulation.VDUBuffer
deleteArea, deleteArea, deleteChar, deleteLine, getAttributes, getBottomMargin, getBufferSize, getChar, getColumns, getCursorColumn, getCursorRow, getMaxBufferSize, getRows, getTopMargin, getWindowBase, insertChar, insertLine, insertLine, insertLine, insertLine, markLine, putChar, putChar, putString, putString, redraw, setBottomMargin, setBufferSize, setCursorPosition, setDisplay, setScreenSize, setTopMargin, setWindowBase, showCursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sshtools.j2ssh.client.PseudoTerminal
getColumns, getRows
 

Field Detail

VT320

public static final java.lang.String VT320
Description of the Field

See Also:
Constant Field Values

VT220

public static final java.lang.String VT220
Description of the Field

See Also:
Constant Field Values

VT100

public static final java.lang.String VT100
Description of the Field

See Also:
Constant Field Values

ANSI

public static final java.lang.String ANSI
Description of the Field

See Also:
Constant Field Values
Constructor Detail

TerminalEmulation

public TerminalEmulation(java.lang.String term,
                         int width,
                         int height)
Create a new vt320 terminal and intialize it with useful settings.

Parameters:
width - Description of the Parameter
height - Description of the Parameter
term - Description of the Parameter

TerminalEmulation

public TerminalEmulation(java.lang.String term)
Create a default vt320 terminal with 80 columns and 24 lines.

Parameters:
term - Description of the Parameter
Method Detail

getSupportedEmulations

public static java.util.List getSupportedEmulations()
Gets the supportedEmulations attribute of the TerminalEmulation class

Returns:
The supportedEmulations value

write

public abstract void write(byte[] b)
Write an answer back to the remote host. This is needed to be able to send terminal answers requests like status and type information.

Specified by:
write in interface VDUInput
Parameters:
b - the array of bytes to be sent

beep

public void beep()
Play the beep sound ...


setTerminalType

public void setTerminalType(java.lang.String term)
Sets the terminal type

Parameters:
term - The new terminalType value

putString

public void putString(java.lang.String s)
Put string at current cursor position. Moves cursor according to the String. Does NOT wrap.

Parameters:
s - the string

sendTelnetCommand

protected void sendTelnetCommand(byte cmd)
Description of the Method

Parameters:
cmd - Description of the Parameter

getTerm

public java.lang.String getTerm()
Gets the terminalId attribute of the TerminalEmulation object

Specified by:
getTerm in interface PseudoTerminal
Returns:
The terminalId value

clearScreen

public void clearScreen()
Description of the Method


mousePressed

public void mousePressed(int x,
                         int y,
                         int modifiers)
Terminal is mouse-aware and requires (x,y) coordinates of on the terminal (character coordinates) and the button clicked.

Specified by:
mousePressed in interface VDUInput
Parameters:
x -
y -
modifiers -

mouseReleased

public void mouseReleased(int x,
                          int y,
                          int modifiers)
Terminal is mouse-aware and requires the coordinates and button of the release.

Specified by:
mouseReleased in interface VDUInput
Parameters:
x -
y -
modifiers -

setLocalEcho

public void setLocalEcho(boolean echo)
Enable or disable the local echo property of the terminal.

Parameters:
echo - true if the terminal should echo locally

setVMS

public void setVMS(boolean vms)
Enable the VMS mode of the terminal to handle some things differently for VMS hosts.

Parameters:
vms - true for vms mode, false for normal mode

setIBMCharset

public void setIBMCharset(boolean ibm)
Enable the usage of the IBM character set used by some BBS's. Special graphical character are available in this mode.

Parameters:
ibm - true to use the ibm character set

setKeyCodes

public void setKeyCodes(java.util.Properties codes)
Override the standard key codes used by the terminal emulation.

Specified by:
setKeyCodes in interface VDUInput
Parameters:
codes - a properties object containing key code definitions

setAnswerBack

public void setAnswerBack(java.lang.String ab)
Sets the answerBack attribute of the vt320 object

Parameters:
ab - The new answerBack value

getWidth

public int getWidth()
Gets the width attribute of the TerminalEmulation object

Specified by:
getWidth in interface PseudoTerminal
Returns:
The width value

getHeight

public int getHeight()
Gets the height attribute of the TerminalEmulation object

Specified by:
getHeight in interface PseudoTerminal
Returns:
The height value

getEncodedTerminalModes

public java.lang.String getEncodedTerminalModes()
Gets the encodedTerminalModes attribute of the TerminalEmulation object

Specified by:
getEncodedTerminalModes in interface PseudoTerminal
Returns:
The encodedTerminalModes value

keyPressed

public void keyPressed(int keyCode,
                       char keyChar,
                       int modifiers)
main keytyping event handler...

Specified by:
keyPressed in interface VDUInput
Parameters:
keyCode - Description of the Parameter
keyChar - Description of the Parameter
modifiers - Description of the Parameter

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Description of the Method

Parameters:
evt - Description of the Parameter

keyTyped

public void keyTyped(int keyCode,
                     char keyChar,
                     int modifiers)
Handle key Typed events for the terminal, this will get all normal key types, but no shift/alt/control/numlock.

Specified by:
keyTyped in interface VDUInput
Parameters:
keyCode - Description of the Parameter
keyChar - Description of the Parameter
modifiers - Description of the Parameter

map_cp850_unicode

public char map_cp850_unicode(char x)
Description of the Method

Parameters:
x - Description of the Parameter
Returns:
Description of the Return Value

reset

public void reset()
Description of the Method



Copyright © 2002 Sshtools.com. All Rights Reserved.