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 Object
implements PrimitivesDrawer

Author:
Jorge Piera

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

Field Detail

graphics

protected Graphics2D graphics

color

protected Color color

xorColor

protected Color xorColor
Constructor Detail

DefaultPrimitivesDrawer

public DefaultPrimitivesDrawer()

DefaultPrimitivesDrawer

public DefaultPrimitivesDrawer(Graphics2D graphics)
Method Detail

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(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(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.

stopDrawing

public void stopDrawing(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.

startDrawing

public void startDrawing(Object obj)
                  throws 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:
InterruptedException

setRenderingHints

public void setRenderingHints(RenderingHints hints)

setStroke

public void setStroke(Stroke stroke)

cleanCanvas

public void cleanCanvas(MapControl mapCtrl)


Copyright © 2004-2013 gvSIG. All Rights Reserved.