|
Method Summary |
|
void |
addEdge(double dx,
double dy)
Adds an edge to the polygon whose components are given by the displacements
dx and dy. |
|
void |
addEdgeInPolarCoordinates(double r,
double theta)
Adds an edge to the polygon specified in polar coordinates. |
|
static double |
angle(double x,
double y)
Returns the angle in degrees from the origin to the point
(x, y). |
|
Object |
clone()
Overrides clone in Object to make sure
that the point arrays are copied rather than shared. |
|
boolean |
contains(double x,
double y)
Checks to see whether a point is inside the object. |
|
static double |
cosD(double angle)
Returns the trigonometric sine of its argument where angle
is expressed in degrees. |
|
static double |
distance(double x,
double y)
Computes the distance between the origin and the point
(x, y). |
|
static double |
distance(double x0,
double y0,
double x1,
double y1)
Computes the distance between the points (x0, y0)
and (x1, y1). |
|
void |
endPolygon()
Ends the polygon and makes it available for display. |
|
Rectangle |
getBounds()
Returns the bounding box of this object, which is defined to be the
smallest rectangle that covers everything drawn by the figure. |
|
double |
getHeight()
Returns the height of this polygon. |
|
Polygon |
getPolygon()
Returns an AWT Polygon whose point are as close as possible
to the ones in this GPolygon. |
|
Dimension |
getSize()
Returns the size of this polygon. |
|
double |
getWidth()
Returns the width of this polygon. |
|
void |
paint(Graphics g)
Implements the paint operation for this graphical object. |
|
void |
rotate(double theta)
Rotates the polygon around its origin by the angle theta, measured in degrees. |
|
void |
scale(double sx,
double sy)
Scales the polygon by the scale factors sx and sy. |
|
static double |
sinD(double angle)
Returns the trigonometric sine of its argument where angle
is expressed in degrees. |
|
void |
startPolygon()
Starts a polygon at its origin. |
|
void |
startPolygon(double x,
double y)
Sets the start location of the polygon relative to its origin. |
|
static double |
tanD(double angle)
Returns the trigonometric sine of its argument where angle
is expressed in degrees. |
|
static double |
toDegrees(double radians)
Converts an angle from radians to degrees. |
|
static double |
toRadians(double degrees)
Converts an angle from degrees to radians. |
|
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]
|
|
Color |
getColor()
Returns the color used to display this object.
[Inherited from GObject]
|
|
Color |
getFillColor()
Returns the color used to display the filled region of this 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 |
isFilled()
Returns whether this object is filled.
[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 |
setColor(Color c)
Sets the color used to display this object.
[Inherited from GObject]
|
|
void |
setFillColor(Color c)
Sets the color used to display the filled region of this object.
[Inherited from GObject]
|
|
void |
setFilled(boolean fill)
Sets whether this object is filled.
[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]
|