Package org.openpdf.rups.view
Class Console
java.lang.Object
org.openpdf.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) classThe style context defining the styles of each type of PrintStream.(package private) classThe thread that will write everything to the text area. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ConsoleSingle Console instance.(package private) PipedInputStreamCustom InputStream.(package private) PipedInputStreamInputStream for System.err.(package private) PipedInputStreamInputStream for System.out.(package private) PipedOutputStreamCustom OutputStream.(package private) PipedOutputStreamOutputStream for System.err.(package private) PipedOutputStreamOutputStream for System.out.(package private) PrintStreamCustom PrintStream.(package private) Console.ConsoleStyleContextThe StyleContext for the Console.(package private) JTextPaneThe text area to which everything is written. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConsoleConsole 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 voidAllows you to print something to the custom PrintStream.voidupdate(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
-