ti.swing.console
Class ConsoleGraphics
java.lang.Object
ti.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConsoleGraphics
public ConsoleGraphics(java.awt.Graphics g)
- Class Constructor.
- Parameters:
g
- the actual Graphics implementation
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()