Class GString

java.lang.Object
  |
  +--Subject
        |
        +--Shape
              |
              +--GString

public class GString
extends Shape

A GString (Graphical String) is a Shape. GStrings have all methods and attributes of Shape and then some more.


Constructor Summary
GString(java.awt.Color c, java.lang.String text, int x, int y)
          Initialize a new GString with specified Color, text and position
 
Method Summary
 void display(java.awt.Graphics g)
          produce a graphical representation of this
 java.lang.String getText()
           
 void setText(java.lang.String t)
          Set the text of this and tell our observer that we have changed
 java.lang.String toString()
           
 
Methods inherited from class Shape
getColor, getX, getY, setColor, setPosition, setX, setY
 
Methods inherited from class Subject
attachObserver, detachObserver, notifyObserver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GString

public GString(java.awt.Color c,
               java.lang.String text,
               int x,
               int y)
Initialize a new GString with specified Color, text and position
Parameters:
c - the desired color
text - the desired text
x - the desired x coordinate
y - the desired x coordinate
Method Detail

setText

public void setText(java.lang.String t)
Set the text of this and tell our observer that we have changed
Parameters:
t - the desired text
Returns:
nothing

getText

public java.lang.String getText()
Returns:
the text of this

toString

public java.lang.String toString()
Returns:
a String representation of this
Overrides:
toString in class Shape

display

public void display(java.awt.Graphics g)
produce a graphical representation of this
Parameters:
g - the pen we use to display this
Overrides:
display in class Shape