Package com.lowagie.rups.view
Class Console
- java.lang.Object
-
- com.lowagie.rups.view.Console
-
- All Implemented Interfaces:
java.util.Observer
public class Console extends java.lang.Object implements java.util.Observer
A Class that redirects everything written to System.out and System.err to a JTextPane.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
Console.ConsoleStyleContext
The style context defining the styles of each type of PrintStream.(package private) class
Console.ReadWriteThread
The thread that will write everything to the text area.
-
Field Summary
Fields Modifier and Type Field Description private static Console
console
Single Console instance.(package private) java.io.PipedInputStream
piCustom
Custom InputStream.(package private) java.io.PipedInputStream
piErr
InputStream for System.err.(package private) java.io.PipedInputStream
piOut
InputStream for System.out.(package private) java.io.PipedOutputStream
poCustom
Custom OutputStream.(package private) java.io.PipedOutputStream
poErr
OutputStream for System.err.(package private) java.io.PipedOutputStream
poOut
OutputStream for System.out.(package private) java.io.PrintStream
printStream
Custom PrintStream.(package private) Console.ConsoleStyleContext
styleContext
The StyleContext for the Console.(package private) javax.swing.JTextPane
textArea
The text area to which everything is written.
-
Constructor Summary
Constructors Modifier Constructor Description private
Console()
Creates a new Console object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Console
getInstance()
Console is a Singleton class: you can only get one Console.java.io.PrintStream
getPrintStream()
Get the custom PrintStream of the console.javax.swing.JTextPane
getTextArea()
Get the JTextArea to which everything is written.static void
println(java.lang.String s)
Allows you to print something to the custom PrintStream.void
update(java.util.Observable observable, java.lang.Object obj)
-
-
-
Field Detail
-
console
private static Console console
Single Console instance.
-
printStream
java.io.PrintStream printStream
Custom PrintStream.
-
poCustom
java.io.PipedOutputStream poCustom
Custom OutputStream.
-
piCustom
java.io.PipedInputStream piCustom
Custom InputStream.
-
poOut
java.io.PipedOutputStream poOut
OutputStream for System.out.
-
piOut
java.io.PipedInputStream piOut
InputStream for System.out.
-
poErr
java.io.PipedOutputStream poErr
OutputStream for System.err.
-
piErr
java.io.PipedInputStream piErr
InputStream for System.err.
-
styleContext
Console.ConsoleStyleContext styleContext
The StyleContext for the Console.
-
textArea
javax.swing.JTextPane textArea
The text area to which everything is written.
-
-
Method Detail
-
getInstance
public static Console getInstance()
Console is a Singleton class: you can only get one Console.- Returns:
- the Console
-
println
public static void println(java.lang.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(java.util.Observable observable, java.lang.Object obj)
- Specified by:
update
in interfacejava.util.Observer
- See Also:
Observer.update(java.util.Observable, java.lang.Object)
-
getPrintStream
public java.io.PrintStream getPrintStream()
Get the custom PrintStream of the console.- Returns:
- the PrintStream
-
getTextArea
public javax.swing.JTextPane getTextArea()
Get the JTextArea to which everything is written.- Returns:
- the JTextArea
-
-