Modifier and Type | Field and Description |
---|---|
static int |
BACK_TO_FRONT
Specifies that iterators should run from back to front
|
static int |
FRONT_TO_BACK
Specifies that iterators should run from front to back
|
Modifier and Type | Method and Description |
---|---|
void |
add(GObject gobj)
Adds a new graphical object to this container.
|
void |
add(GObject gobj,
double x,
double y)
Adds the graphical object to this canvas and sets its location
to the point (
x , y ). |
void |
add(GObject gobj,
GPoint pt)
Adds the graphical object to this canvas and sets its location to the specified point.
|
<T extends GObject> |
getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension.
|
<T extends GObject> |
getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(
x , y ), or null if no such
object exists. |
<T extends GObject> |
getElementAt(GPoint 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
GCanvas . |
void |
remove(GObject gobj)
Removes a graphical object from this container.
|
void |
removeAll()
Removes all graphical objects from this container.
|
static final int BACK_TO_FRONT
static final int FRONT_TO_BACK
void add(GObject gobj)
gobj
- The graphical object to addvoid add(GObject gobj, double x, double y)
x
, y
).gobj
- The graphical object to addx
- The new x-coordinate for the objecty
- The new y-coordinate for the objectvoid add(GObject gobj, GPoint pt)
gobj
- The graphical object to addpt
- A GPoint
object giving the coordinates of the pointvoid remove(GObject gobj)
gobj
- The graphical object to removevoid removeAll()
int getElementCount()
GCanvas
.GCanvas
<T extends GObject> T getElement(int index)
index
- The index of the component to return<T extends GObject> T getElementAt(double x, double y)
x
, y
), or null
if no such
object exists.x
- The x-coordinate of the point being testedy
- The y-coordinate of the point being testednull
if no such object exists.<T extends GObject> T getElementAt(GPoint pt)
null
if no such object exists.pt
- The coordinates being testednull
if no such object exists