com.lowagie.rups.view

Class Console

public class Console extends Object implements Observer

A Class that redirects everything written to System.out and System.err to a JTextPane.
Nested Class Summary
classConsole.ConsoleStyleContext
The style context defining the styles of each type of PrintStream.
classConsole.ReadWriteThread
The thread that will write everything to the text area.
Field Summary
static Consoleconsole
Single Console instance.
PipedInputStreampiCustom
Custom InputStream.
PipedInputStreampiErr
InputStream for System.err.
PipedInputStreampiOut
InputStream for System.out.
PipedOutputStreampoCustom
Custom OutputStream.
PipedOutputStreampoErr
OutputStream for System.err.
PipedOutputStreampoOut
OutputStream for System.out.
PrintStreamprintStream
Custom PrintStream.
Console.ConsoleStyleContextstyleContext
The StyleContext for the Console.
JTextPanetextArea
The text area to which everything is written.
Constructor Summary
Console()
Creates a new Console object.
Method Summary
static ConsolegetInstance()
Console is a Singleton class: you can only get one Console.
PrintStreamgetPrintStream()
Get the custom PrintStream of the console.
JTextPanegetTextArea()
Get the JTextArea to which everything is written.
static voidprintln(String s)
Allows you to print something to the custom PrintStream.
voidupdate(Observable observable, Object obj)

Field Detail

console

private static Console console
Single Console instance.

piCustom

PipedInputStream piCustom
Custom InputStream.

piErr

PipedInputStream piErr
InputStream for System.err.

piOut

PipedInputStream piOut
InputStream for System.out.

poCustom

PipedOutputStream poCustom
Custom OutputStream.

poErr

PipedOutputStream poErr
OutputStream for System.err.

poOut

PipedOutputStream poOut
OutputStream for System.out.

printStream

PrintStream printStream
Custom PrintStream.

styleContext

Console.ConsoleStyleContext styleContext
The StyleContext for the Console.

textArea

JTextPane textArea
The text area to which everything is written.

Constructor Detail

Console

private Console()
Creates a new Console object.

Throws: IOException

Method Detail

getInstance

public static Console getInstance()
Console is a Singleton class: you can only get one Console.

getPrintStream

public PrintStream getPrintStream()
Get the custom PrintStream of the console.

getTextArea

public JTextPane getTextArea()
Get the JTextArea to which everything is written.

println

public static void println(String s)
Allows you to print something to the custom PrintStream.

Parameters: s the message you want to send to the Console

update

public void update(Observable observable, Object obj)

See Also: java.util.Observer#update(java.util.Observable, java.lang.Object)