public final class SimpleDrawing2 extends Object
(0.0, 0.0)
. The
x-coordinates of the left and right edges of the canvas are approximately
x = -10.0
and x = 10.0
, respectively. The
y-coordinates of the bottom and top edges of the canvas are approximately
y = -8.0
and y = 8.0
, respectively.Modifier and Type | Field and Description |
---|---|
static Color |
BLACK
The color black.
|
static Color |
BLUE
The color blue.
|
static Color |
CYAN
The color cyan.
|
static Color |
DARK_GRAY
The color dark gray.
|
static Color |
GRAY
The color gray.
|
static Color |
GREEN
The color green.
|
static Color |
LIGHT_GRAY
The color light gray.
|
static Color |
MAGENTA
The color magenta.
|
static Color |
ORANGE
The color orange.
|
static Color |
PINK
The color pink.
|
static Color |
RED
The color red.
|
static Color |
WHITE
The color white.
|
static Color |
YELLOW
The color yellow.
|
Modifier and Type | Method and Description |
---|---|
static void |
drawLine(IPoint2D from,
IPoint2D to)
Draws a line on the canvas connecting two points.
|
static void |
drawPoint(IPoint2D point)
Draws a point on the canvas.
|
static void |
setPenColor(Color color)
Sets the current pen color for all subsequent points.
|
static void |
setPenRadius(double radius)
Sets the radius of the pen for all subsequent points.
|
public static final Color BLACK
public static final Color BLUE
public static final Color CYAN
public static final Color DARK_GRAY
public static final Color GRAY
public static final Color GREEN
public static final Color LIGHT_GRAY
public static final Color MAGENTA
public static final Color ORANGE
public static final Color PINK
public static final Color RED
public static final Color WHITE
public static final Color YELLOW
public static void drawPoint(IPoint2D point)
point
- the point to drawpublic static void drawLine(IPoint2D from, IPoint2D to)
from
- the starting point of the lineto
- the ending point of the linepublic static void setPenColor(Color color)
color
- the color to draw all subsequent pointspublic static void setPenRadius(double radius)
radius <= 0.0
radius
-