de.grogra.pf.ui
Class Console.ConsoleWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by de.grogra.pf.ui.Console.ConsoleWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable
Enclosing interface:
Console

public abstract static class Console.ConsoleWriter
extends java.io.PrintWriter

A ConsoleWriter is a PrintWriter with the additional possibility to set the text color to use.

Author:
Ole Kniemeyer

Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
Console.ConsoleWriter(java.io.Writer out, boolean autoFlush)
           
 
Method Summary
abstract  void print(java.lang.Object text, int color)
          Prints text using the color encoded in color.
abstract  void println(java.lang.Object text, int color)
          Prints text using the color encoded in color, then terminates the line.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Console.ConsoleWriter

public Console.ConsoleWriter(java.io.Writer out,
                             boolean autoFlush)
Method Detail

print

public abstract void print(java.lang.Object text,
                           int color)
Prints text using the color encoded in color. The color has to be specified in Java's default sRGB color model (0xrrggbb).

Parameters:
text - text to print
color - color to use (0xrrggbb)

println

public abstract void println(java.lang.Object text,
                             int color)
Prints text using the color encoded in color, then terminates the line. The color has to be specified in Java's default sRGB color model (0xrrggbb).

Parameters:
text - text to print
color - color to use (0xrrggbb)