Constructor and Description |
---|
CanvasAWT(Graphics2D graphic)
Creates a new instance of Pencil2dAWT.
|
Modifier and Type | Method and Description |
---|---|
static Color |
awt(Color color)
Converts a
Imaging Color
into a AWT Color . |
void |
drawBackground(Color color,
int width,
int height)
Draws the picture background in the given color.
|
void |
drawDot(Color color,
int x,
int y)
Draws a dot, represented by a small rectangle.
|
void |
drawOval(Color color,
int x,
int y,
int width,
int height)
Draws an oval.
|
void |
drawRect(Color color,
int x,
int y,
int width,
int height)
Draws a rectangle.
|
void |
drawRect(Color color,
int x,
int y,
int width,
int height,
boolean border)
Draws a rectangle.
|
void |
drawString(int x,
int y,
String text)
Draws a text.
|
public CanvasAWT(Graphics2D graphic)
public void drawString(int x, int y, String text)
Canvas
drawString
in interface Canvas
x
- x value of the text.y
- y value of the text.text
- text to be displayed.public void drawRect(Color color, int x, int y, int width, int height, boolean border)
Canvas
public void drawRect(Color color, int x, int y, int width, int height)
Canvas
public void drawDot(Color color, int x, int y)
Canvas
public void drawOval(Color color, int x, int y, int width, int height)
Canvas
public void drawBackground(Color color, int width, int height)
Canvas
drawBackground
in interface Canvas
color
- the background color.width
- width of the picture.height
- height of the picture.public static Color awt(Color color)
Imaging Color
into a AWT Color
.
Note that this converter does not use the AWT color's alpha channel, in order
to offer the same behaviour than the SWT converter.Copyright © 2016. All rights reserved.