de.mud.jta.plugin
Class MUDColorizer
java.lang.Object
|
+--de.mud.jta.Plugin
|
+--de.mud.jta.plugin.MUDColorizer
- All Implemented Interfaces:
- ConfigurationListener, EndOfRecordListener, FilterPlugin, PluginListener
- public class MUDColorizer
- extends Plugin
- implements FilterPlugin, EndOfRecordListener, ConfigurationListener
Some little hack for colors and prompts.
We are using GNU, so we should release this under the GPL :)
- needs gnu.regexp package (approx. 22 kB)
- handles prompt with EOR (maybe buggy, but testet with mglib 3.2.6)
- colorizes single lines using regular expressions
- Author:
- Thomas Kriegelstein
Field Summary |
static java.lang.String |
BBLUE
|
static java.lang.String |
BCYAN
|
static java.lang.String |
BGREEN
|
static java.lang.String |
BLACK
|
static java.lang.String |
BLUE
|
static java.lang.String |
BOLD
|
static java.lang.String |
BPINK
|
static java.lang.String |
BRED
|
static java.lang.String |
BWHITE
|
static java.lang.String |
BYELLOW
|
static java.lang.String |
CYAN
|
static java.lang.String |
GREEN
|
static java.lang.String |
NORMAL
|
static java.lang.String |
PINK
|
static java.lang.String |
RED
|
static java.lang.String |
WHITE
|
static java.lang.String |
YELLOW
|
Method Summary |
void |
EndOfRecord()
Called if the end of record event appears |
int |
read(byte[] b)
Read a block of data from the back end. |
void |
setConfiguration(PluginConfig cfg)
Called for configuration changes. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BLACK
public static java.lang.String BLACK
RED
public static java.lang.String RED
BRED
public static java.lang.String BRED
GREEN
public static java.lang.String GREEN
BGREEN
public static java.lang.String BGREEN
YELLOW
public static java.lang.String YELLOW
BYELLOW
public static java.lang.String BYELLOW
BLUE
public static java.lang.String BLUE
BBLUE
public static java.lang.String BBLUE
PINK
public static java.lang.String PINK
BPINK
public static java.lang.String BPINK
CYAN
public static java.lang.String CYAN
BCYAN
public static java.lang.String BCYAN
WHITE
public static java.lang.String WHITE
BWHITE
public static java.lang.String BWHITE
NORMAL
public static java.lang.String NORMAL
BOLD
public static java.lang.String BOLD
MUDColorizer
public MUDColorizer(PluginBus bus,
java.lang.String id)
setConfiguration
public void setConfiguration(PluginConfig cfg)
- Description copied from interface:
ConfigurationListener
- Called for configuration changes.
- Specified by:
setConfiguration
in interface ConfigurationListener
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
- Following copied from interface:
de.mud.jta.FilterPlugin
- Parameters:
source
- the data source
EndOfRecord
public void EndOfRecord()
- Description copied from interface:
EndOfRecordListener
- Called if the end of record event appears
- Specified by:
EndOfRecord
in interface EndOfRecordListener
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
- Following copied from interface:
de.mud.jta.FilterPlugin
- Parameters:
b
- the buffer to read the data into- Returns:
- the amount of bytes actually read
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
- Following copied from interface:
de.mud.jta.FilterPlugin
- Parameters:
b
- the buffer to be sent