de.unifreiburg.twodeedoo.scene
Class SimpleTextPuppet

java.lang.Object
  extended by de.unifreiburg.twodeedoo.scene.AbstractPuppet
      extended by de.unifreiburg.twodeedoo.scene.SimpleTextPuppet
All Implemented Interfaces:
IPuppet, ITextPuppet, IPainter

public class SimpleTextPuppet
extends AbstractPuppet
implements ITextPuppet, IPainter

IPuppet which displays a string of text in default font and color. The reference point is the leftmost end of the text baseline.


Field Summary
 
Fields inherited from class de.unifreiburg.twodeedoo.scene.AbstractPuppet
containingScene, x, y
 
Fields inherited from interface de.unifreiburg.twodeedoo.scene.IPuppet
NULL_OBJECT
 
Constructor Summary
SimpleTextPuppet(int x, int y)
          Init with coordinates and empty text.
 
Method Summary
 void paint(java.awt.Graphics g)
          Paint the text.
 void setText(java.lang.String text)
          Set the text.
 
Methods inherited from class de.unifreiburg.twodeedoo.scene.AbstractPuppet
getX, getY, moveAbs, removeFromScene, setContainingScene
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.unifreiburg.twodeedoo.scene.IPuppet
getX, getY, moveAbs, removeFromScene, setContainingScene
 

Constructor Detail

SimpleTextPuppet

public SimpleTextPuppet(int x,
                        int y)
Init with coordinates and empty text.

Parameters:
x - x coordinate of left end of text baseline
y - y coordinate of left end of text baseline
Method Detail

setText

public void setText(java.lang.String text)
Set the text.

Specified by:
setText in interface ITextPuppet
Parameters:
text - new text.

paint

public void paint(java.awt.Graphics g)
Paint the text.

Specified by:
paint in interface IPainter
Specified by:
paint in class AbstractPuppet
Parameters:
g - some graphics context.