de.mud.terminal
Class vt320

java.lang.Object
  |
  +--java.awt.Component
        |
        +--de.mud.terminal.VDU
              |
              +--de.mud.terminal.vt320
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public abstract class vt320
extends VDU
implements java.awt.event.KeyListener

Implementation of a VT terminal emulation plus ANSI compatible.

Maintainer: Marcus Meißner

Version:
$Id: vt320.java,v 2.79 2002/02/17 20:37:37 marcus Exp $
Author:
Matthias L. Jugel, Marcus Meißner
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static java.lang.String ID
          The current version id tag.
 
Fields inherited from class de.mud.terminal.VDU
BOLD, COLOR, COLOR_0, COLOR_1, COLOR_2, COLOR_3, COLOR_4, COLOR_5, COLOR_6, COLOR_7, COLOR_BG, COLOR_BOLD, COLOR_FG, COLOR_INVERT, debug, INVERT, LOW, NORMAL, RESIZE_FONT, RESIZE_NONE, RESIZE_SCREEN, SCROLL_DOWN, SCROLL_UP, UNDERLINE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
vt320()
          Create a new terminal emulation with a specific font.
vt320(java.awt.Font font)
          Create a new terminal emulation with a specific font.
vt320(int width, int height)
          Create a new terminal emulation with specific width and height.
vt320(int width, int height, java.awt.Font font)
          Create a new vt320 terminal and intialize it with useful settings.
 
Method Summary
protected  void beep()
          Play the beep sound ...
 java.lang.String getTerminalID()
          Get the terminal id used to identify this terminal.
 void keyPressed(java.awt.event.KeyEvent evt)
          main keytyping event handler...
 void keyReleased(java.awt.event.KeyEvent evt)
          Not used.
 void keyTyped(java.awt.event.KeyEvent evt)
          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 putString(java.lang.String s)
          Put string at current cursor position.
 void reset()
           
protected  void sendTelnetCommand(byte cmd)
           
 void setAnswerBack(java.lang.String ab)
           
 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 setTerminalID(java.lang.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 abstract  void write(byte[] b)
          Write an answer back to the remote host.
 
Methods inherited from class de.mud.terminal.VDU
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, clearSelection, deleteArea, deleteArea, deleteChar, deleteLine, getAttributes, getBottomMargin, getBufferSize, getChar, getColorSet, getColumns, getCursorPosition, getInsets, getMaxBufferSize, getPreferredSize, getRows, getScreenSize, getSelection, getSize, getTopMargin, getWindowBase, insertChar, insertLine, insertLine, insertLine, insertLine, markLine, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseGetPos, mouseMoved, mousePressed, mouseReleased, paint, print, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putChar, putChar, putString, putString, redraw, redraw, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setBorder, setBottomMargin, setBounds, setBufferSize, setColorPrinting, setColorSet, setCursorColors, setCursorPosition, setFont, setResizeStrategy, setScreenSize, setScrollbar, setTopMargin, setWindowBase, showCursor
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, processComponentEvent, processEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeComponentListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
The current version id tag.

$Id: vt320.java,v 2.79 2002/02/17 20:37:37 marcus Exp $

Constructor Detail

vt320

public vt320(int width,
             int height,
             java.awt.Font font)
Create a new vt320 terminal and intialize it with useful settings.
Parameters:
width - the width of the character screen
height - the amount of rows on screen
font - the font to be used for rendering characters

vt320

public vt320(int width,
             int height)
Create a new terminal emulation with specific width and height.
Parameters:
width - the width of the character screen
height - the amount of rows on screen

vt320

public vt320(java.awt.Font font)
Create a new terminal emulation with a specific font.
Parameters:
font - the font to be used for rendering characters

vt320

public vt320()
Create a new terminal emulation with a specific font.
Method Detail

write

protected 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

beep

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

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)

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.
Parameters:
codes - a properties object containing key code definitions

setTerminalID

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

setAnswerBack

public void setAnswerBack(java.lang.String ab)

getTerminalID

public java.lang.String getTerminalID()
Get the terminal id used to identify this terminal.
Parameters:
terminalID - the id string

keyPressed

public void keyPressed(java.awt.event.KeyEvent evt)
main keytyping event handler...
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Not used.
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
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 java.awt.event.KeyListener
Parameters:
evt - the event

map_cp850_unicode

public char map_cp850_unicode(char x)

reset

public void reset()