psgraphics
Class DrawableString

java.lang.Object
  extended bypsgraphics.Figure
      extended bypsgraphics.DrawableString

public class DrawableString
extends Figure

Represents a string that can be drawn to the screen. The parameters x, y describe the location coordinates on the drawing area.


Constructor Summary
DrawableString(java.awt.Point position, java.lang.String str)
          Creates a new DrawableString and initializes the coordinates which describe it and the string that will be shown.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws the string on the drawing area of the postscript interpreter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableString

public DrawableString(java.awt.Point position,
                      java.lang.String str)
Creates a new DrawableString and initializes the coordinates which describe it and the string that will be shown.

Precondition: The right parameters must be given.
Postcondition : A new DrawableString will be created.

Parameters:
position - The position coordinates.
str - The string that need to be shown.
Method Detail

draw

public void draw(java.awt.Graphics g)
Draws the string on the drawing area of the postscript interpreter.

Precondition : Must be called by the paint method of the component it draws on and given the same Graphics parameter.
Postcondition : The string will be drawn on the drawing area.

Specified by:
draw in class Figure
Parameters:
g - The same Graphics parameter passed to the paint method of the drawing area.