com.jpemartin.jgt
Class DrawTextGlyph

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

public class DrawTextGlyph
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. This version does the same thing as DrawText, but it tries to do it faster by caching the intermediate glyphs. Testing, however, shows that this is not faster at all (see DrawTextBench).


Constructor Summary
DrawTextGlyph(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
 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

DrawTextGlyph

public DrawTextGlyph(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