|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--acm.graphics.GObject
|
+--acm.graphics.GArc
public class GArc extends GObject implements GFillable, GScalableThe GArc class is a graphical object whose appearance consists of an arc. If unfilled, the arc is simply a portion of the circumference of an ellipse; if filled, the arc is a pie-shaped wedge connected to the center of the figure.
| Field Summary | |
| double | ARC_TOLERANCE |
| Constructor Summary |
| GArc(double width,
double height,
double start,
double sweep) |
| GArc(double x,
double y,
double width,
double height,
double start,
double sweep) |
| Method Summary | |
| boolean | contains(double x,
double y) |
| GRectangle | getBounds() |
| GPoint | getEndPoint() |
| Color | getFillColor() |
| GRectangle | getFrameRectangle() |
| double | getStartAngle() |
| GPoint | getStartPoint() |
| double | getSweepAngle() |
| boolean | isFilled() |
| void | scale(double sf) |
| void | scale(double sx,
double sy) |
| void | setFillColor(Color c) |
| void | setFilled(boolean fill) |
| void | setFrameRectangle(double x,
double y,
double width,
double height) |
| void | setFrameRectangle(GRectangle bounds) |
| void | setStartAngle(double start) |
| void | setSweepAngle(double sweep) |
| Inherited Method Summary | |
| void | addMouseListener(MouseListener listener) |
| void | addMouseMotionListener(MouseMotionListener listener) |
| boolean | contains(GPoint pt) |
| Color | getColor() |
| double | getHeight() |
| GPoint | getLocation()GPoint.
|
| GDimension | getSize() |
| double | getWidth() |
| double | getX() |
| double | getY() |
| boolean | isVisible() |
| void | move(double dx, double dy)dx and dy.
|
| void | movePolar(double r, double theta) |
| void | removeMouseListener(MouseListener listener) |
| void | removeMouseMotionListener(MouseMotionListener listener) |
| void | sendBackward() |
| void | sendForward() |
| void | sendToBack() |
| void | sendToFront() |
| void | setColor(Color color) |
| void | setLocation(GPoint pt) |
| void | setLocation(double x, double y)x, y).
|
| void | setVisible(boolean visible) |
| Field Detail |
public static final double ARC_TOLERANCE| Constructor Detail |
public GArc(double width,
double height,
double start,
double sweep)| Usage: | GArc garc = new GArc(width, height, start, sweep); | ||||||||
| Parameters: |
|
public GArc(double x,
double y,
double width,
double height,
double start,
double sweep)| Usage: | GArc garc = new GArc(x, y, width, height, start, sweep); | ||||||||||||
| Parameters: |
|
| Method Detail |
public boolean contains(double x,
double y)| Usage: | if (garc.contains(x, y)) . . . | ||||
| Parameters: |
| ||||
| Returns: | true if the point (x, y) is inside |
public GRectangle getBounds()| Usage: | GRectangle bounds = garc.getBounds(); |
| Returns: | The bounding box of this object |
public GPoint getEndPoint()| Usage: | GPoint pt = garc.getEndPoint(); |
| Returns: | The point at which the arc ends |
public Color getFillColor()| Usage: | Color color = garc.getFillColor(); |
| Returns: | The color used to display the filled region of this object |
| Specified by: | getFillColor in interface GFillable |
public GRectangle getFrameRectangle()| Usage: | GRectangle bounds = garc.getFrameRectangle(); |
| Returns: | The GRectangle in which this arc is inscribed |
public double getStartAngle()| Usage: | double start = garc.getStartAngle(); |
| Returns: | The starting angle for this arc |
public GPoint getStartPoint()| Usage: | GPoint pt = garc.getStartPoint(); |
| Returns: | The point at which the arc starts |
public double getSweepAngle()| Usage: | double sweep = garc.getSweepAngle(); |
| Returns: | The sweep angle for this arc |
public boolean isFilled()| Usage: | if (garc.isFilled()) . . . |
| Returns: | The color used to display the object |
| Specified by: | isFilled in interface GFillable |
public final void scale(double sf)| Usage: | gobj.scale(sf); | ||
| Parameter: |
| ||
| Specified by: | scale in interface GScalable |
public void scale(double sx,
double sy)| Usage: | gobj.scale(sx, sy); | ||||
| Parameters: |
| ||||
| Specified by: | scale in interface GScalable |
public void setFillColor(Color c)| Usage: | garc.setFillColor(color); | ||
| Parameter: |
| ||
| Specified by: | setFillColor in interface GFillable |
public void setFilled(boolean fill)| Usage: | garc.setFilled(fill); | ||
| Parameter: |
| ||
| Specified by: | setFilled in interface GFillable |
public void setFrameRectangle(double x,
double y,
double width,
double height)| Usage: | garc.setBounds(x, y, width, height); | ||||||||
| Parameters: |
|
public final void setFrameRectangle(GRectangle bounds)| Usage: | garc.setFrameRectangle(bounds); | ||
| Parameter: |
|
public void setStartAngle(double start)| Usage: | garc.setStartAngle(start); | ||
| Parameter: |
|
public void setSweepAngle(double sweep)| Usage: | garc.setSweepAngle(sweep); | ||
| Parameter: |
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||