ti.swing.console
Class ConsoleGraphics

java.lang.Object
  extended byti.swing.console.ConsoleGraphics

public class ConsoleGraphics
extends java.lang.Object

Sorta like java.awt.Graphics, except that it is tailored to drawing text. You can set an inverse attribute, a background color, a foreground color. When drawing text, the background is cleared to the bg color. Text is always draw as monospace, extra padding inserted as needed. Also, clearRect(int, int, int, int) clears to the bg color.

Version:
0.1
Author:
Rob Clark

Constructor Summary
ConsoleGraphics(java.awt.Graphics g)
          Class Constructor.
 
Method Summary
 void clearRect(int x, int y, int width, int height)
           
 void drawString(java.lang.String str, int x, int y)
          upper-left corner to draw is at x,y, rather than the baseline...
 java.awt.Color getBackgroundColor()
           
 java.awt.Color getColor()
           
 java.awt.Font getFont()
           
 void setBackgroundColor(java.awt.Color bgColor)
           
 void setColor(java.awt.Color fgColor)
           
 void setFont(java.awt.Font f)
           
 void toggleInverse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleGraphics

public ConsoleGraphics(java.awt.Graphics g)
Class Constructor.

Parameters:
g - the actual Graphics implementation
Method Detail

toggleInverse

public void toggleInverse()

getBackgroundColor

public java.awt.Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(java.awt.Color bgColor)

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color fgColor)

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
upper-left corner to draw is at x,y, rather than the baseline... also clears background as it draws...


setFont

public void setFont(java.awt.Font f)

getFont

public java.awt.Font getFont()