org.gvsig.fmap.mapcontrol.impl
Class DefaultPrimitivesDrawer

java.lang.Object
  extended by org.gvsig.fmap.mapcontrol.impl.DefaultPrimitivesDrawer
All Implemented Interfaces:
PrimitivesDrawer
Direct Known Subclasses:
MapControlDrawer2D

public class DefaultPrimitivesDrawer
extends java.lang.Object
implements PrimitivesDrawer

Author:
Jorge Piera

Field Summary
protected  java.awt.Color color
           
protected  java.awt.Graphics2D graphics
           
protected  java.awt.Color xorColor
           
 
Constructor Summary
DefaultPrimitivesDrawer()
           
DefaultPrimitivesDrawer(java.awt.Graphics2D graphics)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

protected java.awt.Color color

graphics

protected java.awt.Graphics2D graphics

xorColor

protected java.awt.Color xorColor
Constructor Detail

DefaultPrimitivesDrawer

public DefaultPrimitivesDrawer()

DefaultPrimitivesDrawer

public DefaultPrimitivesDrawer(java.awt.Graphics2D graphics)
Method Detail

cleanCanvas

public void cleanCanvas(MapControl mapCtrl)

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Specified by:
drawLine in interface PrimitivesDrawer

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Specified by:
drawOval in interface PrimitivesDrawer

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: PrimitivesDrawer
It draws a rectangle on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.

Specified by:
drawRect in interface PrimitivesDrawer
Parameters:
x - The minimum X coordinate.
y - The minimum Y coordinate.
width - The rectangle width.
height - The rectangle height.

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: PrimitivesDrawer
It fills a rectangle on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.

Specified by:
fillRect in interface PrimitivesDrawer
Parameters:
x - The minimum X coordinate.
y - The minimum Y coordinate.
width - The rectangle width.
height - The rectangle height.

setColor

public void setColor(java.awt.Color color)
Description copied from interface: PrimitivesDrawer
Sets the color that is used to draw the objects that don't have a symbol.

Specified by:
setColor in interface PrimitivesDrawer
Parameters:
color - The color to use on the drawing operations.

setGraphics

public void setGraphics(java.awt.Graphics graphics)
Description copied from interface: PrimitivesDrawer
This method sets the Graphics where the Drawer has to draw all the objects.

Specified by:
setGraphics in interface PrimitivesDrawer
Parameters:
graphics - The component where the new objects has to be drawn.

setRenderingHints

public void setRenderingHints(java.awt.RenderingHints hints)

setStroke

public void setStroke(java.awt.Stroke stroke)

startDrawing

public void startDrawing(java.lang.Object obj)
                  throws java.lang.InterruptedException
Description copied from interface: PrimitivesDrawer
This method is used to start a drawing process that needs to be synchronized.

Specified by:
startDrawing in interface PrimitivesDrawer
Parameters:
obj - The object that locks the resource.
Throws:
java.lang.InterruptedException

stopDrawing

public void stopDrawing(java.lang.Object obj)
Description copied from interface: PrimitivesDrawer
This method is used to finish a drawing process that needs to be synchronized.

Specified by:
stopDrawing in interface PrimitivesDrawer
Parameters:
obj - The object that has locked the resource.


Copyright © 2014 gvSIG Association. All Rights Reserved.