Package com.gigamonkeys.bhs
Class Canvas
java.lang.Object
com.gigamonkeys.bhs.Canvas
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncode()
void
drawCircle
(double x, double y, double r, String color, double lineWidth) Draws a circle centered at x,y with radius r using the given color and the given lineWidth.void
drawFilledCircle
(double x, double y, double r, String color) Draws a filled circle centered at x,y with radius r using the given color.void
drawFilledRect
(double x, double y, double width, double height, String color) Draws a filled rectangle starting at x,y with the given width, height, and color.void
Draws a line from x1,y1 to x2,y2 using the give color and the given line width.void
Draws a rectangle starting at x,y with the given width, height, color, and lineWidth.double
height()
double
width()
-
Constructor Details
-
Canvas
public Canvas(double width, double height)
-
-
Method Details
-
width
public double width() -
height
public double height() -
code
-
drawLine
Draws a line from x1,y1 to x2,y2 using the give color and the given line width. -
drawCircle
Draws a circle centered at x,y with radius r using the given color and the given lineWidth. -
drawRect
public void drawRect(double x, double y, double width, double height, String color, double lineWidth) Draws a rectangle starting at x,y with the given width, height, color, and lineWidth. Positive widths go to the right and negative to the left; positive heights go down and negative heights go up. -
drawFilledRect
Draws a filled rectangle starting at x,y with the given width, height, and color. Positive widths go to the right and negative to the left; positive heights go down and negative heights go up. -
drawFilledCircle
Draws a filled circle centered at x,y with radius r using the given color.
-