Graphics Objects

The module provides the following classes of drawable objects: Point, Line, Circle, Oval, Rectangle, Polygon, and Text. All objects are initially created unfilled with a black outline. All graphics objects support the following generic set of methods:
Sets the interior of the object to the given color.

Example: someObject.setFill("red")

Sets the outline of the object to the given color.

Example: someObject.setOutline("yellow")

Sets the width of the outline of the object to the desired number of pixels. (Does not work for Point.)

Example: someObject.setWidth(3)

Draws the object into the given GraphWin and returns the drawn object.

Example: someObject.draw(someGraphWin)

Undraws the object from a graphics window. If the object is not currently drawn, no action is taken.

Example: someObject.undraw()

Moves the object dx units in the $x$ direction and dy units in the $y$ direction. If the object is currently drawn, the image is adjusted to the new position.

Example: someObject.move(10, 15.5)

Returns a duplicate of the object. Clones are always created in an undrawn state. Other than that, they are identical to the cloned object.

Example: objectCopy = someObject.clone()