public class DefaultPrimitivesDrawer extends java.lang.Object implements PrimitivesDrawer
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
color |
protected java.awt.Graphics2D |
graphics |
protected java.awt.Color |
xorColor |
Constructor and Description |
---|
DefaultPrimitivesDrawer() |
DefaultPrimitivesDrawer(java.awt.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(java.awt.Color color)
Sets the color that is used to draw the objects that don't
have a symbol.
|
void |
setGraphics(java.awt.Graphics graphics)
This method sets the
Graphics where the
Drawer has to draw all the objects. |
void |
setRenderingHints(java.awt.RenderingHints hints) |
void |
setStroke(java.awt.Stroke stroke) |
void |
startDrawing(java.lang.Object obj)
This method is used to start a drawing process that needs to
be synchronized.
|
void |
stopDrawing(java.lang.Object obj)
This method is used to finish a drawing process that needs to
be synchronized.
|
protected java.awt.Graphics2D graphics
protected java.awt.Color color
protected java.awt.Color xorColor
public DefaultPrimitivesDrawer()
public DefaultPrimitivesDrawer(java.awt.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(java.awt.Color color)
PrimitivesDrawer
setColor
in interface PrimitivesDrawer
color
- The color to use on the drawing operations.public void setGraphics(java.awt.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(java.lang.Object obj)
PrimitivesDrawer
stopDrawing
in interface PrimitivesDrawer
obj
- The object that has locked the resource.public void startDrawing(java.lang.Object obj) throws java.lang.InterruptedException
PrimitivesDrawer
startDrawing
in interface PrimitivesDrawer
obj
- The object that locks the resource.java.lang.InterruptedException
public void setRenderingHints(java.awt.RenderingHints hints)
public void setStroke(java.awt.Stroke stroke)
public void cleanCanvas(MapControl mapCtrl)