This class defines a graphical object that consists of a collection
of other graphical objects.
Once assembled, the internal objects can be manipulated as a unit.
|
Method Summary |
add(gobj)
Adds a new graphical object to this GCompound. |
add(gobj, x, y)
Adds the graphical object to this canvas and sets its location
to the point (x, y). |
contains(x, y)
Checks to see whether a point is “inside” the compound,
which means that it is inside one of the components. |
get_bounds()
Returns the bounding rectangle for this compound object, which consists of
the union of the bounding rectangles for each of the components. |
get_element(k)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension. |
get_element_at(x, y)
Returns the topmost graphical object that contains the point
(x, y), or None if no such
object exists. |
get_element_count()
Returns the number of graphical objects stored in this container. |
remove(gobj)
Removes a graphical object from this GCompound. |
remove_all()
Removes all graphical objects from this GCompound. |
|
Inherited Method Summary |
get_bounds()
Returns the bounding box for this object.
|
get_color()
Returns the color used to display this object.
|
get_height()
Returns the height of this object, which is defined to be
the height of the bounding box.
|
get_location()
Returns the location of this object as a GPoint.
|
get_size()
Returns the size of the bounding box for this object.
|
get_width()
Returns the width of this object, which is defined to be
the width of the bounding box.
|
get_x()
Returns the x-coordinate of the object.
|
get_y()
Returns the y-coordinate of the object.
|
is_visible()
Checks to see whether the object is visible.
|
move(dx, dy)
Moves the object on the screen using the displacements
dx and dy.
|
move_polar(r, theta)
Moves the object using displacements given in polar coordinates.
|
scale(sf)
Scales the object on the screen by the scale factor
sf, which applies in both dimensions.
|
send_backward()
Moves this object one step toward the back in the z dimension.
|
send_forward()
Moves this object one step toward the front in the z dimension.
|
send_to_back()
Moves this object to the back of the display in the z dimension.
|
send_to_front()
Moves this object to the front of the display in the z dimension.
|
set_color(color)
Sets the color used to display this object.
|
set_location(x, y)
Sets the location of the GCompound to the point
(x, y).
|
set_visible(flag)
Sets the visibility status of the GCompound.
|