Method Summary |
void |
addArc(double arcWidth,
double arcHeight,
double start,
double sweep)
Adds a series of edges to the polygon that simulates the arc specified by
the parameters. |
void |
addEdge(double dx,
double dy)
Adds an edge to the polygon whose components are given by the displacements
dx and dy from the last vertex. |
void |
addPolarEdge(double r,
double theta)
Adds an edge to the polygon specified in polar coordinates. |
void |
addVertex(double x,
double y)
Adds a vertex at (x , y ) relative to the polygon origin. |
boolean |
contains(double x,
double y)
Checks to see whether a point is inside the object. |
GRectangle |
getBounds()
Returns the bounding box of this object, which is defined to be the
smallest rectangle that covers everything drawn by the figure. |
GPoint |
getCurrentPoint()
Returns the coordinates of the last vertex added to the polygon, or null
if the polygon is empty. |
Color |
getFillColor()
Returns the color used to display the filled region of this object. |
boolean |
isFilled()
Returns whether this object is filled. |
void |
recenter()
Recalculates the vertices of the polygon so that they are positioned
relative to the geometric center of the object. |
void |
rotate(double theta)
Rotates the polygon around its origin by the angle theta, measured in degrees. |
void |
scale(double sf)
Scales the object on the screen by the scale factor sf , which applies
in both dimensions. |
void |
scale(double sx,
double sy)
Scales the polygon by the scale factors sx and sy . |
void |
setFillColor(Color color)
Sets the color used to display the filled region of this object. |
void |
setFilled(boolean fill)
Sets whether this object is filled. |
Inherited Method Summary |
void | addMouseListener(MouseListener listener)
Adds a mouse listener to this graphical object.
|
void | addMouseMotionListener(MouseMotionListener listener)
Adds a mouse motion listener to this graphical object.
|
boolean | contains(GPoint pt)
Checks to see whether a point is inside the object.
|
Color | getColor()
Returns the color used to display this object.
|
double | getHeight()
Returns the height of this object, which is defined to be
the height of the bounding box.
|
GPoint | getLocation()
Returns the location of this object as a GPoint .
|
GDimension | getSize()
Returns the size of the bounding box for this object.
|
double | getWidth()
Returns the width of this object, which is defined to be
the width of the bounding box.
|
double | getX()
Returns the x-coordinate of the object.
|
double | getY()
Returns the y-coordinate of the object.
|
boolean | isVisible()
Checks to see whether this object is visible.
|
void | move(double dx, double dy)
Moves the object on the screen using the displacements dx and dy .
|
void | movePolar(double r, double theta)
Moves the object using displacements given in polar coordinates.
|
void | removeMouseListener(MouseListener listener)
Removes a mouse listener from this graphical object.
|
void | removeMouseMotionListener(MouseMotionListener listener)
Removes a mouse motion listener from this graphical object.
|
void | sendBackward()
Moves this object one step toward the back in the z dimension.
|
void | sendForward()
Moves this object one step toward the front in the z dimension.
|
void | sendToBack()
Moves this object to the back of the display in the z dimension.
|
void | sendToFront()
Moves this object to the front of the display in the z dimension.
|
void | setColor(Color color)
Sets the color used to display this object.
|
void | setLocation(GPoint pt)
Sets the location of this object to the specified point.
|
void | setLocation(double x, double y)
Sets the location of this object to the point (x , y ).
|
void | setVisible(boolean visible)
Sets whether this object is visible.
|