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 |
|
void |
add(GObject gobj)
Adds a new graphical object to this GCompound. |
|
void |
add(GObject gobj,
double x,
double y)
Adds a new graphical object to this GCompound and sets its location
to the point (x, y). |
|
void |
add(GObject gobj,
java.awt.Point pt)
Adds the graphical object to this and sets its location to the specified point. |
|
Rectangle |
getBounds()
Returns the bounding rectangle for this compound object, which consists of
the union of the bounding rectangles for each of the components. |
|
GObject |
getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the stacking order. |
|
GObject |
getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(x, y), or null if no such
object exists. |
|
GObject |
getElementAt(Point pt)
Returns the topmost graphical object that contains the specified point,
or null if no such object exists. |
|
int |
getElementCount()
Returns the number of graphical objects stored in this container. |
|
double |
getHeight()
Returns the height of this compound object, which is the vertical extent of
its components. |
|
Dimension |
getSize()
Returns the size of this compound object, which is defined to be the size
of the bounding box containing all of its components. |
|
double |
getWidth()
Returns the width of this compound object, which is the horizontal extent of
its components. |
|
Iterator |
iterator()
Returns an Iterator that cycles through the elements within
this container in the default direction, which is from back to front. |
|
Iterator |
iterator(int direction)
Returns an Iterator that cycles through the elements
within this container in the specified direction, which must be one
of the constants FRONT_TO_BACK
or BACK_TO_FRONT. |
|
void |
paint(Graphics g)
Implements the paint operation for this graphical object. |
|
void |
remove(GObject gobj)
Removes a graphical object from this GCompound. |
|
void |
removeAll()
Removes all graphical objects from this GCompound. |
|
void |
scale(double sx,
double sy)
Scales every object contained in this compound by the scale factors
sx and sy. |
|
Inherited Method Summary |
|
void |
addMouseListener(MouseListener listener)
Adds a mouse listener to this graphical object.
[Inherited from GObject]
|
|
void |
addMouseMotionListener(MouseMotionListener listener)
Adds a mouse motion listener to this graphical object.
[Inherited from GObject]
|
|
boolean |
contains(double x,
double y)
Checks to see whether a point is inside the object.
[Inherited from GObject]
|
|
Point |
getLocation()
Returns the nearest Point corresponding to the location of this object.
[Inherited from GObject]
|
|
double |
getX()
Returns the x-coordinate of the object.
[Inherited from GObject]
|
|
double |
getY()
Returns the y-coordinate of the object.
[Inherited from GObject]
|
|
boolean |
isVisible()
Checks to see whether this object is visible.
[Inherited from GObject]
|
|
void |
moveToBack()
Moves this object to the back of the display in stacking order.
[Inherited from GObject]
|
|
void |
moveToFront()
Moves this object to the front of the display in stacking order.
[Inherited from GObject]
|
|
void |
removeMouseListener(MouseListener listener)
Removes a mouse listener from this graphical object.
[Inherited from GObject]
|
|
void |
removeMouseMotionListener(MouseMotionListener listener)
Removes a mouse motion listener from this graphical object.
[Inherited from GObject]
|
|
void |
scale(double sf)
Scales the object on the screen by the scale factor sf, which applies
in both dimensions.
[Inherited from GObject]
|
|
void |
setLocation(double x,
double y)
Sets the location of this object to the point (x, y).
[Inherited from GObject]
|
|
void |
setVisible(boolean visible)
Sets whether this object is visible.
[Inherited from GObject]
|
|
void |
translate(double dx,
double dy)
Moves the object on the screen using the displacements dx and dy.
[Inherited from GObject]
|