A
C
D
G
I
M
R
S
T
A
add(gobj)
-
Method in class GCompound
- Adds a new graphical object to this
GCompound
.
add(gobj, x, y)
-
Method in class GCompound
add(gobj)
-
Method in class GWindow
- Adds the graphical object to this canvas.
add(gobj, x, y)
-
Method in class GWindow
addEdge(dx, dy)
-
Method in class GPolygon
- Adds an edge to the polygon whose components are given by the displacements
dx and dy from the last vertex.
addEventListener
(type, fn) -
Method in class GWindow
- Registers a new listener for events of the specified type occuring in the
window.
addPolarEdge(r, theta)
-
Method in class GPolygon
- Adds an edge to the polygon specified in polar coordinates.
addVertex(x, y)
-
Method in class GPolygon
- Adds a vertex at (x, y) relative to the
polygon origin.
angle(x0, y0, x1, y1)
-
Static method in class GMath
- Computes the angle in degrees formed by a line segment from the
point (x0, y0) and
(x1, y1).
C
contains(x, y)
-
Method in class GObject
- Checks to see whether a point is inside the object.
cosDegrees(theta)
-
Static method in class GMath
- Returns the trigonometric cosine of its argument where angle
is expressed in degrees.
createTimer(fn, delay)
-
Method in class GWindow
- Creates a new timer object that calls fn after the
specified delay, which is measured in milliseconds.
D
distance(x, y)
-
Static method in class GMath
- Computes the distance between the origin and the point
(x, y).
distance(x0, y0, x1, y1)
-
Static method in class GMath
- Computes the distance between the points
(x0, y0) and
(x1, y1).
G
G3DRect
- Class in the Portable Graphics Library
- This class is a
GRect
whose
borders can be modified to suggest being raised or lowered.
G3DRect(x, y)
-
Constructor for class G3DRect
- Creates a new 3-D rectangle with the specified width and height,
positioned at the origin.
G3DRect(x, y, width, height)
-
Constructor for class G3DRect
- Creates a new 3-D rectangle with the specified bounds.
GArc
- Class in the Portable Graphics Library
- This class displays an elliptical arc.
GArc(width, height, start, sweep)
-
Constructor for class GArc
- Creates a new
GArc
object consisting of an elliptical arc
located at the point (0, 0).
GArc(x, y, width, height, start, sweep)
-
Constructor for class GArc
- Creates a new
GArc
object consisting of an elliptical
arc inscribed in the rectangle with the specified bounds.
GCompound
- Class in the Portable Graphics Library
- This class defines a graphical object that consists of a collection
of other graphical objects.
GCompound()
-
Constructor for class GCompound
- Creates a new
GCompound
object with no internal components.
GDimension
- Class in the Portable Graphics Library
- This class encapsulates a size containing a width and a height.
GDimension(width, height)
-
Constructor for class GDimension
- Creates a new dimension object with the specified components.
getAscent()
-
Method in class GLabel
- Returns the distance this string extends above the baseline.
getBounds()
-
Method in class GObject
- Returns the bounding box of this object, which is defined to be the
smallest rectangle that covers everything drawn by the figure.
getWindowHeight()
-
Method in class GWindow
- Gets the height of the graphics window, without its borders.
getWindowWidth()
-
Method in class GWindow
- Gets the width of the graphics window, without its borders.
getColor()
-
Method in class GObject
- Returns the color used to display this object as a string.
getDescent()
-
Method in class GLabel
- Returns the distance this string descends below the baseline.
getElement(k)
-
Method in class GCompound
- Returns the graphical object at index k, numbering from back
to front in the the z dimension.
getElement(k)
-
Method in class GWindow
- Returns the graphical object at index k, numbering from back
to front in the the z dimension.
getElementAt(x, y)
-
Method in class GWindow
- Returns the topmost graphical object that contains the point
(x, y), or
None
if no such
object exists.
getElementCount()
-
Method in class GCompound
- Returns the number of graphical objects stored in this container.
getElementCount()
-
Method in class GWindow
- Returns the number of graphical objects stored in this
GWindow
.
getEndPoint()
-
Method in class GArc
- Returns the point at which the arc ends.
getEndPoint()
-
Method in class GLine
- Returns the end point of the line as a
GPoint
object.
- Returns the color used to display the filled region of this object.
getFillColor()
-
Method in class GFillable
- Returns the color used to display the filled region of this object.
getFont()
-
Method in class GLabel
- Returns the font in which the
GLabel
is displayed.
getHeight()
-
Method in class GDimension
- Returns the height of this
GDimension
.
getHeight()
-
Method in class GObject
- Returns the height of this object, which is defined to be
the height of the bounding box.
getHeight()
-
Method in class GRectangle
- Returns the height of this
GRectangle
.
getLabel()
-
Method in class GLabel
- Returns the string displayed by this object.
getLineWidth()
-
Method in class GObject
- Returns the width of the lines used to draw the object.
getLocation()
-
Method in class GObject
- Returns the location of this object as a
GPoint
.
getSize()
-
Method in class GObject
- Returns the size of the bounding box for this object.
getStartAngle()
-
Method in class GArc
- Returns the starting angle for this
GArc
object.
getStartPoint()
-
Method in class GArc
- Returns the point at which the arc starts.
getStartPoint()
-
Method in class GLine
- Returns the coordinates of the initial point in the line.
getSweepAngle()
-
Method in class GArc
- Returns the sweep angle for this
GArc
object.
getWidth()
-
Method in class GDimension
- Returns the width of this
GDimension
.
getWidth()
-
Method in class GObject
- Returns the width of this object, which is defined to be
the width of the bounding box.
getWidth()
-
Method in class GRectangle
- Returns the width of this
GRectangle
.
getX()
-
Method in class GObject
- Returns the x-coordinate of the object.
getX()
-
Method in class GPoint
- Returns the x coordinate of this
GPoint
.
getY()
-
Method in class GObject
- Returns the y-coordinate of the object.
getY()
-
Method in class GPoint
- Returns the y coordinate of this
GPoint
.
getY()
-
Method in class GRectangle
- Returns the y coordinate of this
GRectangle
.
GFillableObject
- Class in the Portable Graphics Library
- This abstract class unifies the
GObject
subclasses that support filling.
GImage
- Class the Portable Graphics Library
- The
GImage
class is a graphical object whose appearance is
defined by an image.
GImage(filename)
-
Constructor for class GImage
- Creates a new
GImage
object by looking for an image with that
name.
GImage(array)>
-
Constructor for class GImage
- Creates a new
GImage
object from the array of pixels.
GLabel
- Class in the Portable Graphics Library
- This class displays a text string.
GLabel(text)
-
Constructor for class GLabel
- Creates a new
GLabel
object initialized to contain the
specified text.
GLabel(text, x, y)
-
Constructor for class GLabel
- Creates a new
GLabel
object with its baseline origin at the
specified position.
GLine
- Class in the Portable Graphics Library
- The class displays a line segment.
GLine(x0, y0, x1, y1)
-
Constructor for class GLine
- Creates a line segment from its endpoints.
GMath
- Class in the Portable Graphics Library
- This class defines a variety of mathematical methods that are
useful in graphical applications.
GObject
- Class in the Portable Graphics Library
- This abstract class is the common superclass of all graphical objects that can
be displayed on a graphics window.
GOval
- Class in the Portable Graphics Library
- This class displays an ellipse.
GOval(width, height)
-
Constructor for class GOval
- Creates a new oval with the specified width and height,
positioned at the origin.
GOval(x, y, width, height)
-
Constructor for class GOval
- Creates a new oval inscribed within the specified bounds.
GPoint
- Class in the Portable Graphics Library
- This class encapsulates a location combining an x and a y
coordinate.
GPoint(x, y)
-
Constructor for class GPoint
- Creates a new
GPoint
with the specified coordinates.
GPolygon
- Class in the Portable Graphics Library
- The class displays a polygon.
GPolygon()
-
Constructor for class GPolygon
- Creates a new empty polygon at the origin.
GRect
- Class in the Portable Graphics Library
- The class displays a rectangular box.
GRect(x, y)
-
Constructor for class GRect
- Creates a new rectangle with the specified width and height,
positioned at the origin.
GRect(x, y, width, height)
-
Constructor for class GRect
- Creates a new rectangle with the specified bounds.
GRectangle
- Class in the Portable Graphics Library
- This class encapsulates the location and dimensions of a rectangle.
GRectangle(x, y, width, height)
-
Constructor for class GRectangle
- Creates a new
GRectangle
with the specified coordinates
and size.
GRoundRect
- Class in the Portable Graphics Library
- This class is a
GRect
with rounded corners.
GRoundRect(x, y)
-
Constructor for class GRoundRect
- Creates a new rounded rectangle with the specified width and height,
positioned at the origin.
GRoundRect(x, y, width, height)
-
Constructor for class GRoundRect
- Creates a new rounded rectangle with the specified bounds.
GWindow
- Class in the Portable Graphics Library
- This class represents the drawing surface to which individual objects are added.
GWindow()
-
Constructor for class GWindow
- Creates a new
GWindow
with a default preferred size.
GWindow(width, height)
-
Constructor for class GWindow
- Creates a new
GWindow
and sets the size of its canvas
to the specified width and height.
I
isFilled()
-
Method in class GFillable
- Returns whether this object is filled.
isVisible()
-
Method in class GObject
- Checks to see whether this object is visible.
M
move(dx, dy)
-
Method in class GObject
- Moves the object on the screen using the displacements
dx and dy.
movePolar(r, theta)
-
Method in class GObject
- Moves the object using displacements given in polar coordinates.
R
remove(gobj)
-
Method in class GCompound
- Removes a graphical object from this
GCompound
.
remove(gobj)
-
Method in class GWindow
- Removes a graphical object from this
GWindow
.
removeAll()
-
Method in class GCompound
- Removes all graphical objects from this
GCompound
.
rotate(theta)
-
Method in class GObject
- Rotates the object on the screen theta degrees around
its origin.
round(n)
-
Static method in class GMath
- Rounds a number to the nearest integer.
S
scale(sf)
-
Method in class GObject
- Scales the object on the screen by the scale factor sf,
which applies in both dimensions.
sendBackward()
-
Method in class GObject
- Moves this object one step toward the back in the z dimension.
sendForward()
-
Method in class GObject
- Moves this object one step toward the front in the z dimension.
sendToBack()
-
Method in class GObject
- Moves this object to the back of the display in the z dimension.
sendToFront()
-
Method in class GObject
- Moves this object to the front of the display in the z dimension.
setBounds(x, y, width, height)
-
Method in class GOval
- Changes the bounds of this object to the specified values.
setBounds(x, y, width, height)
-
Method in class GRect
setColor(color)
-
Method in class GObject
- Sets the color used to display this object.
setEndPoint(x, y)
-
Method in class GLine
- Sets the end point of the line to the point
(x, y).
setFillColor(color)
-
Method in interface GFillable
- Sets the color used to display the filled region of this object.
setFilled(flag)
-
Method in interface GFillable
- Sets whether this object is filled.
setFont(font)
-
Method in class GLabel
- Changes the font used to display the
GLabel
as specified by
the string font, which is usually specified as a CSS font.
setFrameRectangle(x, y, width, height)
-
Method in class GArc
- Changes the arc bounds to the specified values.
setImage(filename)
-
Method in class GImage
- Resets the image used by this
GImage
object to the one
identified by the argument filename.
setLabel(text)
-
Method in class GLabel
- Changes the string stored within the
GLabel
object, so that
a new text string appears on the display.
setLineWidth(width)
-
Method in class GObject
- Sets the width of the lines used to draw the object.
setLocation(x, y)
-
Method in class GObject
- Sets the location of this object to the point
(
x
, y
).
setSize(width, height)
-
Method in class GImage
- Changes the size of this object to the specified width and height.
setSize(width, height)
-
Method in class GOval
- Changes the size of this object to the specified width and height.
setSize(width, height)
-
Method in class GRect
- Changes the size of this object to the specified width and height.
setStartAngle(theta)
-
Method in class GArc
- Sets the starting angle for this
GArc
object.
setStartPoint(x, y)
-
Method in class GLine
- Sets the initial point in the line to (x, y),
leaving the end point unchanged.
setSweepAngle(sweep)
-
Method in class GArc
- Sets the sweep angle for this
GArc
object.
setVisible(flag)
-
Method in class GObject
- Sets whether this object is visible.
sinDegrees(theta)
-
Static method in class GMath
- Returns the trigonometric sine of its argument where angle
is expressed in degrees.
T
tanDegrees(theta)
-
Static method in class GMath
- Returns the trigonometric tangent of its argument where angle
is expressed in degrees.
toDegrees(radians)
-
Static method in class GMath
- Converts an angle from radians to degrees.
toRadians(degrees)
-
Static method in class GMath
- Converts an angle from degrees to radians.
A
C
D
G
I
M
R
S
T