|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTurtleGraphics.Shapes
public class Shapes
Copyright 2006 by Ken Lambert and Martin Osborne.
Provides an application window with a pen for drawing lines,
circles, and rectangles.
Constructor Summary | |
---|---|
Shapes()
|
|
Shapes(int width,
int height)
|
Method Summary | |
---|---|
void |
drawCircle(double x,
double y,
double r)
Action: Draws a circle. |
void |
drawLine(double x1,
double y1,
double x2,
double y2)
Action: Draws a line segment. |
void |
drawRectangle(double x,
double y,
double w,
double h)
Action: Draws a rectangle. |
void |
setColor(java.awt.Color color)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Shapes()
public Shapes(int width, int height)
Method Detail |
---|
public void setColor(java.awt.Color color)
public void drawLine(double x1, double y1, double x2, double y2)
x1
- The line segment's initial x coordinatey1
- The line segment's initial y coordinatex2
- The line segment's ending x coordinatey2
- The line segment's ending y coordinatepublic void drawCircle(double x, double y, double r)
x
- The x coordinate of the circle's center pointy
- The y coordinate of the circle's center pointr
- The circle's radiuspublic void drawRectangle(double x, double y, double w, double h)
x
- The x coordinate of the rectangle's upper left corner pointy
- The y coordinate of the rectangle's upper left corner pointw
- The rectangle's widthh
- The rectangle's height
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |