de.mud.terminal

Class vt320

Implemented Interfaces:
VDUInput

public abstract class vt320
extends VDUBuffer
implements VDUInput

Implementation of a VT terminal emulation plus ANSI compatible.

Maintainer: Marcus Mei\u00dfner

Version:
$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $
Author:
Matthias L. Jugel, Marcus Mei\u00dfner

Field Summary

static String
ID
The current version id tag.

Fields inherited from class de.mud.terminal.VDUBuffer

BOLD, COLOR, COLOR_BG, COLOR_BG_SHIFT, COLOR_FG, COLOR_FG_SHIFT, ID, INVERT, INVISIBLE, LOW, NORMAL, SCROLL_DOWN, SCROLL_UP, UNDERLINE, bufSize, charArray, charAttributes, cursorX, cursorY, debug, display, height, maxBufSize, screenBase, scrollMarker, showcursor, update, width, windowBase

Fields inherited from interface de.mud.terminal.VDUInput

KEY_ACTION, KEY_ALT, KEY_CONTROL, KEY_SHIFT

Constructor Summary

vt320()
Create a default vt320 terminal with 80 columns and 24 lines.
vt320(int width, int height)
Create a new vt320 terminal and intialize it with useful settings.

Method Summary

void
beep()
Play the beep sound ...
String
getTerminalID()
Get the terminal id used to identify this terminal.
void
keyPressed(int keyCode, char keyChar, int modifiers)
main keytyping event handler...
void
keyReleased(KeyEvent evt)
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)
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(String s)
Put string at current cursor position.
void
reset()
protected void
sendTelnetCommand(byte cmd)
void
setAnswerBack(String ab)
void
setIBMCharset(boolean ibm)
Enable the usage of the IBM character set used by some BBS's.
void
setKeyCodes(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
setScreenSize(int c, int r, boolean broadcast)
Change the size of the screen.
void
setTerminalID(String terminalID)
Set the terminal id used to identify this terminal.
void
setVMS(boolean vms)
Enable the VMS mode of the terminal to handle some things differently for VMS hosts.
protected void
setWindowSize(int c, int r)
Sent the changed window size from the terminal to all listeners.
abstract void
write(byte[] b)
Write an answer back to the remote host.

Methods inherited from class de.mud.terminal.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

Field Details

ID

public static final String ID
The current version id tag.

$Id: vt320.java 507 2005-10-25 10:14:52Z marcus $

Constructor Details

vt320

public vt320()
Create a default vt320 terminal with 80 columns and 24 lines.

vt320

public vt320(int width,
             int height)
Create a new vt320 terminal and intialize it with useful settings.

Method Details

beep

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

getTerminalID

public String getTerminalID()
Get the terminal id used to identify this terminal.

keyPressed

public void keyPressed(int keyCode,
                       char keyChar,
                       int modifiers)
main keytyping event handler...
Specified by:
keyPressed in interface VDUInput

keyReleased

public void keyReleased(KeyEvent evt)

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

map_cp850_unicode

public char map_cp850_unicode(char x)

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 -

putString

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

reset

public void reset()

sendTelnetCommand

protected void sendTelnetCommand(byte cmd)

setAnswerBack

public void setAnswerBack(String ab)

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(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

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

setScreenSize

public void setScreenSize(int c,
                          int r,
                          boolean broadcast)
Change the size of the screen. This will include adjustment of the scrollback buffer.
Overrides:
setScreenSize in interface VDUBuffer
Parameters:

setTerminalID

public void setTerminalID(String terminalID)
Set the terminal id used to identify this terminal.
Parameters:
terminalID - the id string

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

setWindowSize

protected void setWindowSize(int c,
                             int r)
Sent the changed window size from the terminal to all listeners.

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.
Parameters:
b - the array of bytes to be sent