com.jpemartin.jgt
Class DrawText

java.lang.Object
  extended by com.jpemartin.jgt.DrawText
All Implemented Interfaces:
Drawable

public class DrawText
extends java.lang.Object
implements Drawable

Draw the given text with the given color. Typically you'd only use the ctor and the draw(g,x,y) methods.


Constructor Summary
DrawText(java.lang.String text, java.awt.Color color)
          Initialize the object with a given text and color
 
Method Summary
 void draw(java.awt.Graphics g, int x, int y)
          draw the text at the given position, using the default font
 void draw(java.awt.Graphics g, int x, int y, java.awt.Color colorOverride)
          draw the text at the given position, using the default font, but with a different color
 java.awt.Color getColor()
           
 void setColor(java.awt.Color _color)
          Set the text color
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawText

public DrawText(java.lang.String text,
                java.awt.Color color)
Initialize the object with a given text and color

Method Detail

getColor

public java.awt.Color getColor()
Returns:
the color of the text

setColor

public void setColor(java.awt.Color _color)
Set the text color


draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y)
draw the text at the given position, using the default font

Specified by:
draw in interface Drawable

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 java.awt.Color colorOverride)
draw the text at the given position, using the default font, but with a different color