jmathlib.ui.awt
Class GUIOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by jmathlib.ui.awt.GUIOutput
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class GUIOutput
extends java.io.OutputStream

Simple OutputStream extension for redirecting the System.out to a specified TextArea.


Field Summary
private static java.io.PrintStream oldPrintStream
           
private static java.awt.TextArea outputTextArea
           
private static java.io.PrintStream redirectedOut
           
 
Constructor Summary
GUIOutput(java.awt.TextArea _outputTextArea)
          Creates a new PrintStream object to redirect the standard System.out objectDoes the redirection
 
Method Summary
 void dispose()
          Restores the original System.out PrintStream.
 void write(int b)
          Covert the specified int to an array of bytesConvert the array of bytes to a StringCalls to write(String s) method
 void write(int[] b)
          Covert the specified array of ints to an array of bytesConvert the array of bytes to a StringCalls to write(String s) method
 void write(java.lang.String s)
          Appends the specified String to the java.awt.TextArea specified at constructor's time
 
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
 

Field Detail

redirectedOut

private static java.io.PrintStream redirectedOut

outputTextArea

private static java.awt.TextArea outputTextArea

oldPrintStream

private static java.io.PrintStream oldPrintStream
Constructor Detail

GUIOutput

public GUIOutput(java.awt.TextArea _outputTextArea)
  1. Creates a new PrintStream object to redirect the standard System.out object
  2. Does the redirection

Method Detail

write

public void write(int b)
  1. Covert the specified int to an array of bytes
  2. Convert the array of bytes to a String
  3. Calls to write(String s) method

Specified by:
write in class java.io.OutputStream

write

public void write(int[] b)
  1. Covert the specified array of ints to an array of bytes
  2. Convert the array of bytes to a String
  3. Calls to write(String s) method


write

public void write(java.lang.String s)
Appends the specified String to the java.awt.TextArea specified at constructor's time


dispose

public void dispose()
Restores the original System.out PrintStream.


FOOTER

BOTTOM