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 PrimitivesDrawer
public void drawOval(int x, int y, int width, int height)
drawOval
in interface PrimitivesDrawer
public void drawRect(int x, int y, int width, int height)
PrimitivesDrawer
PrimitivesDrawer.setColor(Color)
method.drawRect
in interface PrimitivesDrawer
x
- 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)
PrimitivesDrawer
PrimitivesDrawer.setColor(Color)
method.fillRect
in interface PrimitivesDrawer
x
- The minimum X coordinate.y
- The minimum Y coordinate.width
- The rectangle width.height
- The rectangle height.public void setColor(Color color)
PrimitivesDrawer
setColor
in interface PrimitivesDrawer
color
- The color to use on the drawing operations.public void setGraphics(Graphics graphics)
PrimitivesDrawer
Graphics
where the
Drawer
has to draw all the objects.setGraphics
in interface PrimitivesDrawer
graphics
- The component where the new objects has to be drawn.public void stopDrawing(Object obj)
PrimitivesDrawer
stopDrawing
in interface PrimitivesDrawer
obj
- The object that has locked the resource.public void startDrawing(Object obj) throws InterruptedException
PrimitivesDrawer
startDrawing
in interface PrimitivesDrawer
obj
- The object that locks the resource.InterruptedException
public void setRenderingHints(RenderingHints hints)
public void setStroke(Stroke stroke)
public void cleanCanvas(MapControl mapCtrl)