Package com.lowagie.rups.view
Class Console
java.lang.Object
com.lowagie.rups.view.Console
- All Implemented Interfaces:
Observer
A Class that redirects everything written to System.out and System.err to a JTextPane.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
The style context defining the styles of each type of PrintStream.(package private) class
The thread that will write everything to the text area. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Console
Single Console instance.(package private) PipedInputStream
Custom InputStream.(package private) PipedInputStream
InputStream for System.err.(package private) PipedInputStream
InputStream for System.out.(package private) PipedOutputStream
Custom OutputStream.(package private) PipedOutputStream
OutputStream for System.err.(package private) PipedOutputStream
OutputStream for System.out.(package private) PrintStream
Custom PrintStream.(package private) Console.ConsoleStyleContext
The StyleContext for the Console.(package private) JTextPane
The text area to which everything is written. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Console
Console is a Singleton class: you can only get one Console.Get the custom PrintStream of the console.Get the JTextArea to which everything is written.static void
Allows you to print something to the custom PrintStream.void
update
(Observable observable, Object obj)
-
Field Details
-
console
Single Console instance. -
printStream
PrintStream printStreamCustom PrintStream. -
poCustom
PipedOutputStream poCustomCustom OutputStream. -
piCustom
PipedInputStream piCustomCustom InputStream. -
poOut
PipedOutputStream poOutOutputStream for System.out. -
piOut
PipedInputStream piOutInputStream for System.out. -
poErr
PipedOutputStream poErrOutputStream for System.err. -
piErr
PipedInputStream piErrInputStream for System.err. -
styleContext
Console.ConsoleStyleContext styleContextThe StyleContext for the Console. -
textArea
JTextPane textAreaThe text area to which everything is written.
-
-
Constructor Details
-
Console
Creates a new Console object.- Throws:
IOException
-
-
Method Details
-
getInstance
Console is a Singleton class: you can only get one Console.- Returns:
- the Console
-
println
Allows you to print something to the custom PrintStream.- Parameters:
s
- the message you want to send to the Console
-
update
-
getPrintStream
Get the custom PrintStream of the console.- Returns:
- the PrintStream
-
getTextArea
Get the JTextArea to which everything is written.- Returns:
- the JTextArea
-