public interface DrawInterface
extends java.awt.event.ActionListener
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the screen.
|
void |
drawCircle(int x0,
int y0,
int circleRadius,
boolean isFilled)
Draws a circle.
|
void |
drawRectangle(int x0,
int y0,
int w,
int h,
boolean isFilled)
Draws a rectangle.
|
void |
drawText(int x0,
int y0,
java.lang.String text)
Draws text.
|
void |
drawTriangle(int x0,
int y0,
int x1,
int y1,
int x2,
int y2)
Draws a triangle.
|
int |
graphicsHeight()
Returns drawing surface height.
|
int |
graphicsWidth()
Returns drawing surface width.
|
void |
initializeGraphics() |
void initializeGraphics()
int graphicsWidth()
int graphicsHeight()
void drawCircle(int x0, int y0, int circleRadius, boolean isFilled)
x0
- the x coordinate of the upper left corner of the oval to be drawn.y0
- the y coordinate of the upper left corner of the oval to be drawn.circleRadius
- the radius of the circle.isFilled
- true if the oval is solid, false if it's the outline.void drawRectangle(int x0, int y0, int w, int h, boolean isFilled)
x0
- the x coordinate of the rectangle to be drawn.y0
- the y coordinate of the rectangle to be drawn.w
- the width of the rectangle to be drawn.h
- the height of the rectangle to be drawn.isFilled
- true if the rectangle is solid, false if it's the outline.void drawTriangle(int x0, int y0, int x1, int y1, int x2, int y2)
x0
- the x coordinate of the location where the first angle should be rendered.y0
- the y coordinate of the location where the first angle should be rendered.x1
- the x coordinate of the location where the second angle should be rendered.y1
- the y coordinate of the location where the second angle should be rendered.x2
- the x coordinate of the location where the third angle should be rendered.y2
- the y coordinate of the location where the third angle should be rendered.void drawText(int x0, int y0, java.lang.String text)
DrawPrimitives.rand(int)
with 0, 1, or 2. These numbers represent plain, bold, or
italic.
DrawPrimitives.rand(int)
with 35. This will return a random number for the size of
the font.
x0
- the x coordinate of the location where the String should be rendered.y0
- the y coordinate of the location where the String should be rendered.text
- the text to be rendered.void clear()