public class DefaultPrimitivesDrawer extends Object implements PrimitivesDrawer
| Modifier and Type | Field and Description |
|---|---|
protected Color |
color |
protected Graphics2D |
graphics |
protected Color |
xorColor |
| Constructor and Description |
|---|
DefaultPrimitivesDrawer() |
DefaultPrimitivesDrawer(Graphics2D graphics) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanCanvas(MapControl mapCtrl) |
void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawOval(int x,
int y,
int width,
int height) |
void |
drawRect(int x,
int y,
int width,
int height)
It draws a rectangle on the map using the color
specified using the
PrimitivesDrawer.setColor(Color) method. |
void |
fillRect(int x,
int y,
int width,
int height)
It fills a rectangle on the map using the color
specified using the
PrimitivesDrawer.setColor(Color) method. |
void |
setColor(Color color)
Sets the color that is used to draw the objects that don't
have a symbol.
|
void |
setGraphics(Graphics graphics)
This method sets the
Graphics where the
Drawer has to draw all the objects. |
void |
setRenderingHints(RenderingHints hints) |
void |
setStroke(Stroke stroke) |
void |
startDrawing(Object obj)
This method is used to start a drawing process that needs to
be synchronized.
|
void |
stopDrawing(Object obj)
This method is used to finish a drawing process that needs to
be synchronized.
|
protected Graphics2D graphics
protected Color color
protected Color xorColor
public DefaultPrimitivesDrawer()
public DefaultPrimitivesDrawer(Graphics2D graphics)
public void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in interface PrimitivesDrawerpublic void drawOval(int x,
int y,
int width,
int height)
drawOval in interface PrimitivesDrawerpublic void drawRect(int x,
int y,
int width,
int height)
PrimitivesDrawerPrimitivesDrawer.setColor(Color) method.drawRect in interface PrimitivesDrawerx - The minimum X coordinate.y - The minimum Y coordinate.width - The rectangle width.height - The rectangle height.public void fillRect(int x,
int y,
int width,
int height)
PrimitivesDrawerPrimitivesDrawer.setColor(Color) method.fillRect in interface PrimitivesDrawerx - The minimum X coordinate.y - The minimum Y coordinate.width - The rectangle width.height - The rectangle height.public void setColor(Color color)
PrimitivesDrawersetColor in interface PrimitivesDrawercolor - The color to use on the drawing operations.public void setGraphics(Graphics graphics)
PrimitivesDrawerGraphics where the
Drawer has to draw all the objects.setGraphics in interface PrimitivesDrawergraphics - The component where the new objects has to be drawn.public void stopDrawing(Object obj)
PrimitivesDrawerstopDrawing in interface PrimitivesDrawerobj - The object that has locked the resource.public void startDrawing(Object obj) throws InterruptedException
PrimitivesDrawerstartDrawing in interface PrimitivesDrawerobj - The object that locks the resource.InterruptedExceptionpublic void setRenderingHints(RenderingHints hints)
public void setStroke(Stroke stroke)
public void cleanCanvas(MapControl mapCtrl)