de.mud.jta.plugin
Class EInput01
java.lang.Object
|
+--de.mud.jta.Plugin
|
+--de.mud.jta.plugin.EInput01
- All Implemented Interfaces:
- FilterPlugin, VisualPlugin
- public class EInput01
- extends Plugin
- implements FilterPlugin, VisualPlugin
An example plugin that creates a text area and sends the text entered
there to the remote host. The example explains how to create a filter
plugin (for sending only) and a visual plugin.
Maintainer: Matthias L. Jugel
- Version:
- $Id: EInput01.java,v 1.1 2000/06/16 09:15:24 leo Exp $
- Author:
- Matthias L. Jugel, Marcus Meißner
Field Summary |
protected java.awt.TextArea |
input
|
protected java.awt.Panel |
panel
|
protected java.awt.Button |
send
|
protected FilterPlugin |
source
the source where we get data from |
Method Summary |
java.awt.Menu |
getPluginMenu()
If you want to have a menu configure it and return it here. |
java.awt.Component |
getPluginVisual()
This method returns the visual part of the component to be displayed
by the applet or application at the specified location in the config
file. |
int |
read(byte[] b)
Read data from the filter plugin source and return the amount read. |
void |
setFilterSource(FilterPlugin plugin)
Set the source plugin where we get our data from and where the data
sink (write) is. |
void |
write(byte[] b)
Write data to the filter plugin source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
input
protected java.awt.TextArea input
send
protected java.awt.Button send
panel
protected java.awt.Panel panel
source
protected FilterPlugin source
- the source where we get data from
EInput01
public EInput01(PluginBus bus,
java.lang.String id)
setFilterSource
public void setFilterSource(FilterPlugin plugin)
- 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
- Following copied from interface:
de.mud.jta.FilterPlugin
- Parameters:
source
- the data source
read
public int read(byte[] b)
throws java.io.IOException
- Read data from the filter plugin source and return the amount read.
We do not really do anything here
- Specified by:
read
in interface FilterPlugin
- Parameters:
b
- the array where to read the bytes in- Returns:
- the amount of bytes actually read
write
public void write(byte[] b)
throws java.io.IOException
- Write data to the filter plugin source. This method is used by the
visual components of the plugin to send data.
- Specified by:
write
in interface FilterPlugin
- Following copied from interface:
de.mud.jta.FilterPlugin
- Parameters:
b
- the buffer to be sent
getPluginVisual
public java.awt.Component getPluginVisual()
- This method returns the visual part of the component to be displayed
by the applet or application at the specified location in the config
file.
- Specified by:
getPluginVisual
in interface VisualPlugin
- Returns:
- a visual Component
getPluginMenu
public java.awt.Menu getPluginMenu()
- If you want to have a menu configure it and return it here.
- Specified by:
getPluginMenu
in interface VisualPlugin
- Returns:
- the plugin menu