sbrt.shell.gui
Class TextPaneOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by sbrt.shell.gui.TextPaneOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class TextPaneOutputStream
extends java.io.OutputStream

An output stream that writes its output to a javax.swing.JTextPane. This class is intended to work in conjuction with SbrtOutputPane.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab, and was based on a class written by Ranganath Kini.

Constructor Summary
TextPaneOutputStream(javax.swing.JTextPane textPane, java.lang.String style)
          Creates a new instance of TextAreaOutputStream which writes to the specified instance of javax.swing.JTextArea control.
 
Method Summary
 void write(int b)
          Writes the specified byte as a character to the javax.swing.JTextArea.
 
Methods inherited from class java.io.OutputStream
close, flush, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextPaneOutputStream

public TextPaneOutputStream(javax.swing.JTextPane textPane,
                            java.lang.String style)
Creates a new instance of TextAreaOutputStream which writes to the specified instance of javax.swing.JTextArea control.

Parameters:
textPane - A reference to the javax.swing.JTextArea control to which the output must be redirected to.
style -
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes the specified byte as a character to the javax.swing.JTextArea.

Specified by:
write in class java.io.OutputStream
Parameters:
b - The byte to be written as character to the JTextArea.
Throws:
java.io.IOException