com.monica.javacom.terminal
Class MJCVT220Terminal

java.lang.Object
  |
  +--com.monica.javacom.terminal.MJCVT220Terminal
All Implemented Interfaces:
MJCConfigureable, MJCReader, MJCTerminal, MJCWriteable, MJCWriter

public class MJCVT220Terminal
extends java.lang.Object
implements MJCTerminal

Class for providing terminal functionality according to the VT 220 standard.

This class handles the following incoming character sequences:

This class handles the keys: Configureable values:


Constructor Summary
MJCVT220Terminal()
           
 
Method Summary
 void connectionClosedEvent(MJCReadable readable)
          Indicates that the source connection of the specified MJCReadable has been closed.
 void errorEvent(java.lang.String errorDescription, MJCReadable readable)
          Indicates that there was an error in the source connection of the specified MJCReadable.
 void flush()
          Flushes the contents of the write buffer to bottom layers.
 MJCConfiguration getConfiguration()
          Returns the MJCConfiguration with which this object is customized.
 java.lang.String getLastWriteableError()
          Returns the error message of the last occured error.
 MJCReadable getReadable()
          Returns the MJCReadable from which data will be read.
 java.lang.String getReaderName()
          Returns the MJC name of the MJCReader.
 java.lang.String getReaderVersion()
          Returns the MJC version of the MJCReader.
 java.lang.String getTerminalName()
          Returns the MJC name of the MJCTerminal.
 java.lang.String getTerminalVersion()
          Returns the MJC version of the MJCTerminal.
 java.lang.String getType()
          Returns the name of the terminal.
 MJCVirtualDisplay getVirtualDisplay()
          Returns the MJCVirtualDisplay to which the interpreted contents of the input stream will be sent.
 MJCWriteable getWriteable()
          Returns the MJCWriteable to which this MCJWriter will write.
 java.lang.String getWriteableName()
          Returns the MJC name of the MJCWriteable.
 java.lang.String getWriteableVersion()
          Returns the MJC version of the MJCWriteable.
 java.lang.String getWriterName()
          Returns the MJC name of the MJCWriter.
 java.lang.String getWriterVersion()
          Returns the MJC version of the MJCWriter.
 boolean isWriteableConnected()
          Returns wether the MJCWriteable is connected to its target.
 void readEvent(MJCReadable readable)
          Indicates that there is data available from the specified MJCReadable.
 void setConfiguration(MJCConfiguration configuration)
          Sets the MJCConfiguration for this object.
 void setReadable(MJCReadable readable)
          Sets the MJCReadable from which data has to be read.
 void setVirtualDisplay(MJCVirtualDisplay display)
          Sets the MJCVirtualDisplay for this object to which the interpreted contents of the input stream have to be sent.
 void setWriteable(MJCWriteable writeable)
          Sets the MJCWriteable to which this MJCWriter will write.
 boolean write(char c)
          Writes one single char.
 boolean write(char[] ca)
          Writes a char array.
 boolean write(java.lang.String s)
          Writes a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MJCVT220Terminal

public MJCVT220Terminal()
Method Detail

setConfiguration

public void setConfiguration(MJCConfiguration configuration)
Sets the MJCConfiguration for this object.
Specified by:
setConfiguration in interface MJCConfigureable
Parameters:
MJCConfiguration - configuration: the MJCConfiguration object for the customization

getConfiguration

public MJCConfiguration getConfiguration()
Returns the MJCConfiguration with which this object is customized.
Specified by:
getConfiguration in interface MJCConfigureable
Returns:
MJCConfiguration: the MJCConfiguration with which this object is customized

getReaderName

public java.lang.String getReaderName()
Returns the MJC name of the MJCReader.
Specified by:
getReaderName in interface MJCReader
Returns:
String: the MJC name of the MJCReader

getReaderVersion

public java.lang.String getReaderVersion()
Returns the MJC version of the MJCReader.
Specified by:
getReaderVersion in interface MJCReader
Returns:
String: the MJC version of the MJCReader

readEvent

public void readEvent(MJCReadable readable)
Indicates that there is data available from the specified MJCReadable.
Specified by:
readEvent in interface MJCReader
Parameters:
MJCReadable - readable: there is data available from the readable

connectionClosedEvent

public void connectionClosedEvent(MJCReadable readable)
Indicates that the source connection of the specified MJCReadable has been closed.
Specified by:
connectionClosedEvent in interface MJCReader
Parameters:
MJCReadable - readable: the MJCReadable whose source connection has been closed

errorEvent

public void errorEvent(java.lang.String errorDescription,
                       MJCReadable readable)
Indicates that there was an error in the source connection of the specified MJCReadable.
Specified by:
errorEvent in interface MJCReader
Parameters:
String - errorDescription: the error message
MJCReadable - readable: the MJCReadable where the error occured

setReadable

public void setReadable(MJCReadable readable)
Sets the MJCReadable from which data has to be read.
Specified by:
setReadable in interface MJCReader
Parameters:
MJCReadable - readable: the MJCReadable from which data has to be read

getReadable

public MJCReadable getReadable()
Returns the MJCReadable from which data will be read.
Specified by:
getReadable in interface MJCReader
Returns:
MJCReadable: the MJCReadable from which data will be read

getWriteableName

public java.lang.String getWriteableName()
Returns the MJC name of the MJCWriteable.
Specified by:
getWriteableName in interface MJCWriteable
Returns:
String: the MJC name of the MJCWriteable

getWriteableVersion

public java.lang.String getWriteableVersion()
Returns the MJC version of the MJCWriteable.
Specified by:
getWriteableVersion in interface MJCWriteable
Returns:
String: the MJC version of the MJCWriteable

write

public boolean write(char c)
Writes one single char. Writing is synchronous and can be buffered. Write functionality is only handled by write(String). This method always returns false.
Specified by:
write in interface MJCWriteable
Parameters:
char - c: the char to be written
Returns:
boolean: wether the writing has been successful

write

public boolean write(java.lang.String s)
Writes a String. Writing is synchronous and can be buffered.
Specified by:
write in interface MJCWriteable
Parameters:
String - s: the String to be written
Returns:
boolean: wether the writing has been successful

write

public boolean write(char[] ca)
Writes a char array. Writing is synchronous and can be buffered. Write functionality is only handled by write(String). This method always returns false.
Specified by:
write in interface MJCWriteable
Parameters:
char[] - c: the char array to be written
Returns:
boolean: wether the writing has been successful

flush

public void flush()
Flushes the contents of the write buffer to bottom layers.
Specified by:
flush in interface MJCWriteable

getLastWriteableError

public java.lang.String getLastWriteableError()
Returns the error message of the last occured error. After returning it, the error message will be deleted and cannot be queried again.
Specified by:
getLastWriteableError in interface MJCWriteable
Returns:
String: the last error message

isWriteableConnected

public boolean isWriteableConnected()
Returns wether the MJCWriteable is connected to its target.
Specified by:
isWriteableConnected in interface MJCWriteable
Returns:
boolean: wether the MJCWriteable is connected to its target

getWriterName

public java.lang.String getWriterName()
Returns the MJC name of the MJCWriter.
Specified by:
getWriterName in interface MJCWriter
Returns:
String: the MJC name of the MJCWriter

getWriterVersion

public java.lang.String getWriterVersion()
Returns the MJC version of the MJCWriter.
Specified by:
getWriterVersion in interface MJCWriter
Returns:
String: the MJC version of the MJCWriter

setWriteable

public void setWriteable(MJCWriteable writeable)
Sets the MJCWriteable to which this MJCWriter will write.
Specified by:
setWriteable in interface MJCWriter
Parameters:
MJCWriteable - writeable: the MJCWriteable to which this MJCWriter will write

getWriteable

public MJCWriteable getWriteable()
Returns the MJCWriteable to which this MCJWriter will write.
Specified by:
getWriteable in interface MJCWriter
Returns:
MJCWriteable: the MJCWriteable to which this MJCWriter will write

getTerminalName

public java.lang.String getTerminalName()
Returns the MJC name of the MJCTerminal.
Specified by:
getTerminalName in interface MJCTerminal
Returns:
String: the MJC name of the MJCTerminal

getTerminalVersion

public java.lang.String getTerminalVersion()
Returns the MJC version of the MJCTerminal.
Specified by:
getTerminalVersion in interface MJCTerminal
Returns:
String: the MJC version of the MJCTerminal

setVirtualDisplay

public void setVirtualDisplay(MJCVirtualDisplay display)
Sets the MJCVirtualDisplay for this object to which the interpreted contents of the input stream have to be sent.
Specified by:
setVirtualDisplay in interface MJCTerminal
Parameters:
MJCVirtualDisplay - display: the MJCVirtualDisplay to which the interpreted contents have to be sent

getVirtualDisplay

public MJCVirtualDisplay getVirtualDisplay()
Returns the MJCVirtualDisplay to which the interpreted contents of the input stream will be sent.
Specified by:
getVirtualDisplay in interface MJCTerminal
Returns:
MJCVirtualDisplay: the MJCVirtualDisplay to which the interpreted contents of the input stream will be sent

getType

public java.lang.String getType()
Returns the name of the terminal.
Returns:
String: the type of the terminal ("vt220")