de.mud.jta.plugin
Class Terminal

java.lang.Object
  |
  +--de.mud.jta.Plugin
        |
        +--de.mud.jta.plugin.Terminal
All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner, FilterPlugin, java.lang.Runnable, VisualPlugin, VisualTransferPlugin

public class Terminal
extends Plugin
implements FilterPlugin, VisualTransferPlugin, java.awt.datatransfer.ClipboardOwner, java.lang.Runnable

The terminal plugin represents the actual terminal where the data will be displayed and the gets the keyboard input to sent back to the remote host.

Maintainer: Matthias L. Jugel

Version:
$Id: Terminal.java,v 2.41 2002/05/08 16:32:36 leo Exp $
Author:
Matthias L. Jugel, Marcus Meißner

Field Summary
protected  SoundRequest audioBeep
          if we have a url to an audioclip use it as ping
protected  vt320 emulation
           
protected  java.lang.String encoding
          The default encoding is ISO 8859-1 (western).
protected  javax.swing.JMenu menu
          holds the terminal menu
protected  FilterPlugin source
           
protected  SwingTerminal terminal
          holds the actual terminal emulation
protected  javax.swing.JPanel tPanel
          the terminal panel that is displayed on-screen
 
Fields inherited from class de.mud.jta.Plugin
bus, id
 
Constructor Summary
Terminal(PluginBus bus, java.lang.String id)
          Create a new terminal plugin and initialize the terminal emulation.
 
Method Summary
 void copy(java.awt.datatransfer.Clipboard clipboard)
          Copy currently selected text into the clipboard.
 FilterPlugin getFilterSource()
           
 javax.swing.JMenu getPluginMenu()
          Get the menu entry for this component.
 javax.swing.JComponent getPluginVisual()
          Get the visible components from the plugin.
 void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
           
 void paste(java.awt.datatransfer.Clipboard clipboard)
          Paste text from clipboard to the plugin.
 int read(byte[] b)
          Read a block of data from the back end.
 void run()
          Continuously read from our back end and display the data on screen.
 void setFilterSource(FilterPlugin source)
          Set the source plugin where we get our data from and where the data sink (write) is.
 void write(byte[] b)
          Write a block of data to the back end.
 
Methods inherited from class de.mud.jta.Plugin
error, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

terminal

protected SwingTerminal terminal
holds the actual terminal emulation


emulation

protected vt320 emulation

encoding

protected java.lang.String encoding
The default encoding is ISO 8859-1 (western). However, as you see the value is set to latin1 which is a value that is not even documented and thus incorrect, but it forces the default behaviour for western encodings. The correct value does not work in most available browsers.


audioBeep

protected SoundRequest audioBeep
if we have a url to an audioclip use it as ping


tPanel

protected javax.swing.JPanel tPanel
the terminal panel that is displayed on-screen


menu

protected javax.swing.JMenu menu
holds the terminal menu


source

protected FilterPlugin source
Constructor Detail

Terminal

public Terminal(PluginBus bus,
                java.lang.String id)
Create a new terminal plugin and initialize the terminal emulation.

Method Detail

run

public void run()
Continuously read from our back end and display the data on screen.

Specified by:
run in interface java.lang.Runnable

setFilterSource

public void setFilterSource(FilterPlugin source)
Description copied from interface: FilterPlugin
Set the source plugin where we get our data from and where the data sink (write) is. The actual data handling should be done in the read() and write() methods.

Specified by:
setFilterSource in interface FilterPlugin
Parameters:
source - the data source

getFilterSource

public FilterPlugin getFilterSource()
Specified by:
getFilterSource in interface FilterPlugin

read

public int read(byte[] b)
         throws java.io.IOException
Description copied from interface: FilterPlugin
Read a block of data from the back end.

Specified by:
read in interface FilterPlugin
Parameters:
b - the buffer to read the data into
Returns:
the amount of bytes actually read
java.io.IOException

write

public void write(byte[] b)
           throws java.io.IOException
Description copied from interface: FilterPlugin
Write a block of data to the back end.

Specified by:
write in interface FilterPlugin
Parameters:
b - the buffer to be sent
java.io.IOException

getPluginVisual

public javax.swing.JComponent getPluginVisual()
Description copied from interface: VisualPlugin
Get the visible components from the plugin.

Specified by:
getPluginVisual in interface VisualPlugin
Returns:
a component that represents the plugin

getPluginMenu

public javax.swing.JMenu getPluginMenu()
Description copied from interface: VisualPlugin
Get the menu entry for this component.

Specified by:
getPluginMenu in interface VisualPlugin
Returns:
a menu that can be used to change the plugin state

copy

public void copy(java.awt.datatransfer.Clipboard clipboard)
Description copied from interface: VisualTransferPlugin
Copy currently selected text into the clipboard.

Specified by:
copy in interface VisualTransferPlugin
Parameters:
clipboard - the clipboard

paste

public void paste(java.awt.datatransfer.Clipboard clipboard)
Description copied from interface: VisualTransferPlugin
Paste text from clipboard to the plugin.

Specified by:
paste in interface VisualTransferPlugin
Parameters:
clipboard - the clipboard

lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable contents)
Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner