Package | Description |
---|---|
acm.graphics |
This package provides a set of classes that support the creation of simple,
object-oriented graphical displays.
|
acm.program |
This package provides a set of classes that simplify the creation of programs.
|
Modifier and Type | Class and Description |
---|---|
class |
G3DRect
The
G3DRect class is used to represent a rectangle whose
borders are drawn to create a three-dimensional effect. |
class |
GArc
The
GArc class is a graphical object whose appearance consists
of an arc. |
class |
GCompound
This class defines a graphical object that consists of a collection
of other graphical objects.
|
class |
GImage
The
GImage class is a graphical object whose appearance is
defined by an image. |
class |
GLabel
The
GLabel class is a graphical object whose appearance consists
of a text string. |
class |
GLine
The
GLine class is a graphical object whose appearance consists
of a line segment. |
class |
GOval
The
GOval class is a graphical object whose appearance consists
of an oval. |
class |
GPen
The
GPen class simulates a pen drawing on a canvas. |
class |
GPolygon
The
GPolygon class is a graphical object whose appearance consists
of a polygon. |
class |
GRect
The
GRect class is a graphical object whose appearance consists
of a rectangular box. |
class |
GRoundRect
The
GRoundRect class is a graphical object whose appearance consists
of a rounded rectangle. |
class |
GTurtle
The
GTurtle class simulates a turtle moving on a canvas. |
Modifier and Type | Method and Description |
---|---|
GObject |
GCanvas.getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension.
|
GObject |
GCompound.getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension.
|
GObject |
GContainer.getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension.
|
GObject |
GCanvas.getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(
x , y ), or null if no such
object exists. |
GObject |
GCompound.getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(
x , y ), or null if no such
object exists. |
GObject |
GContainer.getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(
x , y ), or null if no such
object exists. |
GObject |
GCanvas.getElementAt(GPoint pt)
Returns the topmost graphical object that contains the specified point,
or
null if no such object exists. |
GObject |
GCompound.getElementAt(GPoint pt)
Returns the topmost graphical object that contains the specified point,
or
null if no such object exists. |
GObject |
GContainer.getElementAt(GPoint pt)
Returns the topmost graphical object that contains the specified point,
or
null if no such object exists. |
Modifier and Type | Method and Description |
---|---|
void |
GCanvas.add(GObject gobj)
Adds the graphical object to this canvas.
|
void |
GCompound.add(GObject gobj)
Adds a new graphical object to this
GCompound . |
void |
GContainer.add(GObject gobj)
Adds a new graphical object to this container.
|
void |
GCanvas.add(GObject gobj,
double x,
double y)
Adds the graphical object to this canvas and sets its location
to the point (
x , y ). |
void |
GCompound.add(GObject gobj,
double x,
double y)
Adds the graphical object to this canvas and sets its location
to the point (
x , y ). |
void |
GContainer.add(GObject gobj,
double x,
double y)
Adds the graphical object to this canvas and sets its location
to the point (
x , y ). |
void |
GCanvas.add(GObject gobj,
GPoint pt)
Adds the graphical object to this canvas and sets its location to the specified point.
|
void |
GCompound.add(GObject gobj,
GPoint pt)
Adds the graphical object to this canvas and sets its location to the specified point.
|
void |
GContainer.add(GObject gobj,
GPoint pt)
Adds the graphical object to this canvas and sets its location to the specified point.
|
void |
GCanvas.remove(GObject gobj)
Removes a graphical object from this
GCanvas . |
void |
GCompound.remove(GObject gobj)
Removes a graphical object from this
GCompound . |
void |
GContainer.remove(GObject gobj)
Removes a graphical object from this container.
|
Modifier and Type | Method and Description |
---|---|
GObject |
GraphicsProgram.getElement(int index)
Returns the graphical object at the specified index, numbering from back
to front in the the z dimension.
|
GObject |
GraphicsProgram.getElementAt(double x,
double y)
Returns the topmost graphical object that contains the point
(
x , y ), or null if no such
object exists. |
GObject |
GraphicsProgram.getElementAt(GPoint pt)
Returns the topmost graphical object that contains the specified point,
or
null if no such object exists. |
Modifier and Type | Method and Description |
---|---|
void |
GraphicsProgram.add(GObject gobj)
Adds a new graphical object to this container.
|
void |
GraphicsProgram.add(GObject gobj,
double x,
double y)
Adds the graphical object to this canvas and sets its location
to the point (
x , y ). |
void |
GraphicsProgram.add(GObject gobj,
GPoint pt)
Adds the graphical object to this canvas and sets its location to the specified point.
|
void |
GraphicsProgram.remove(GObject gobj)
Removes a graphical object from this container.
|
static void |
GraphicsProgram.startGraphicsProgram(GObject gobj,
java.lang.String[] args)
Creates a
GraphicsProgram containing the specified GObject
and then starts it. |