org.gvsig.fmap.mapcontrol
Interface MapControlDrawer

All Superinterfaces:
PrimitivesDrawer
All Known Implementing Classes:
MapControlDrawer2D

public interface MapControlDrawer
extends PrimitivesDrawer

Represents a class that can write objects in a map like a raster image, a Geometry or other graphical objects. This class doesn't depend of the dimension of the map (2D or 3D).

The Map Control has to have an instance of this class that can be accessed using the MapControl.getMapControlDrawer() method. When a Map Control is created some tools are added to this component using the MapControl.addBehavior(String, org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior) method. Some of these tools need to draw some objects in the map and they use the MapControlDrawer class to do that.

Author:
Jorge Piera

Method Summary
 void cleanCanvas(MapControl mapCtrl)
          Cleans the graphics using the image of the MapControl
 void draw(org.gvsig.fmap.geom.Geometry geometry)
          It draws a Geometry on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.
 void draw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
          It draws a Geometry on the map using a concrete symbol.
 void drawHandler(org.gvsig.fmap.geom.handler.Handler handler, java.awt.geom.AffineTransform at)
          It draws a Handler on the map.
 void drawHandlers(org.gvsig.fmap.geom.handler.Handler[] handlers, java.awt.geom.AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
          It draws the Handler's that compose a geometry on the map.
 void drawImage(java.awt.Image img, java.awt.geom.AffineTransform xform)
          It draws image, applying a transform from image space into user space before drawing.
 void drawImage(java.awt.Image img, int x, int y)
          It draws an image on a map in a concrete position.
 void drawLine(java.awt.geom.Point2D firstPoint, java.awt.geom.Point2D endPoint, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
          It draws a line using a concrete symbol.
 void setComposite(java.awt.Composite instance)
           
 void setRenderingHints(java.awt.RenderingHints hints)
          Replaces the values of all preferences for the rendering algorithms with the specified hints.
 void setStroke(java.awt.Stroke stroke)
          Sets the Stroke for the Graphics2D context.
 void setViewPort(org.gvsig.fmap.mapcontext.ViewPort viewPort)
          The ViewPort is used to transform the map coordinates in the screen coordinates.
 void transform(java.awt.geom.AffineTransform at)
           
 
Methods inherited from interface org.gvsig.fmap.mapcontrol.PrimitivesDrawer
drawLine, drawOval, drawRect, fillRect, setColor, setGraphics, startDrawing, stopDrawing
 

Method Detail

cleanCanvas

void cleanCanvas(MapControl mapCtrl)
Cleans the graphics using the image of the MapControl

Parameters:
mapCtrl -

draw

void draw(org.gvsig.fmap.geom.Geometry geometry)
It draws a Geometry on the map using the color specified using the PrimitivesDrawer.setColor(Color) method.

Parameters:
geometry - The Geometry to draw.

draw

void draw(org.gvsig.fmap.geom.Geometry geometry,
          org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
It draws a Geometry on the map using a concrete symbol.

Parameters:
geometry - The Geometry to draw.
symbol - The symbol used to draw the geometry.

drawHandler

void drawHandler(org.gvsig.fmap.geom.handler.Handler handler,
                 java.awt.geom.AffineTransform at)
It draws a Handler on the map.

Parameters:
handler - The Handler to draw.
at - A transformation that has to be applied to the Handler.

drawHandlers

void drawHandlers(org.gvsig.fmap.geom.handler.Handler[] handlers,
                  java.awt.geom.AffineTransform at,
                  org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
It draws the Handler's that compose a geometry on the map.

Parameters:
handlers - An array of Handler's.
at - A transformation that has to be applied to the Handler's.
symbol - The symbol used to draw the handlers.

drawImage

void drawImage(java.awt.Image img,
               java.awt.geom.AffineTransform xform)
It draws image, applying a transform from image space into user space before drawing.

Parameters:
img - The image to draw.
xform - The transform to apply.

drawImage

void drawImage(java.awt.Image img,
               int x,
               int y)
It draws an image on a map in a concrete position.

Parameters:
img - The image to draw.
x - The X coordinate,
y - The Y coordinate.

drawLine

void drawLine(java.awt.geom.Point2D firstPoint,
              java.awt.geom.Point2D endPoint,
              org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
It draws a line using a concrete symbol.

Parameters:
firstPoint - The first point of the line.
endPoint - The end point of the line.
symbol - The symbol used to draw the line.

setComposite

void setComposite(java.awt.Composite instance)
Parameters:
instance -

setRenderingHints

void setRenderingHints(java.awt.RenderingHints hints)
Replaces the values of all preferences for the rendering algorithms with the specified hints. The existing values for all rendering hints are discarded and the new set of known hints and values are initialized from the specified Map object. Hint categories include controls for rendering quality and overall time/ quality trade-off in the rendering process. Refer to the RenderingHints class for definitions of some common keys and values.

Parameters:
hints - the rendering hints to be set

setStroke

void setStroke(java.awt.Stroke stroke)
Sets the Stroke for the Graphics2D context.

Parameters:
stroke - the Stroke object to be used to stroke a Shape during the rendering

setViewPort

void setViewPort(org.gvsig.fmap.mapcontext.ViewPort viewPort)
The ViewPort is used to transform the map coordinates in the screen coordinates.

Parameters:
viewPort - The ViewPort

transform

void transform(java.awt.geom.AffineTransform at)
Parameters:
at -


Copyright © 2014 gvSIG Association. All Rights Reserved.