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:
-
- setFill(color)
- Sets the interior of the object to the
given color.
- setOutline(color)
- Sets the outline of the object to the given
color.
- setWidth(pixels)
- Sets the width of the outline of the object to
this many pixels. (Does not work for Point.)
- draw(aGraphWin)
- Draws the object into the given
GraphWin. An object may only be drawn in one window at a time.
- undraw()
- Undraws the object from a graphics window.
Returns silently if object is not drawn.
- move(dx,dy)
- Moves the object dx units in the
direction and dy units in the
direction. If the object is
currently drawn, its image is adjusted to the new position.
- clone()
- Returns a duplicate of the object. Clones are
always created in an undrawn state. Other than that, they are
identical to the cloned object.
Subsections
John Zelle
2005-06-04