Package org.gvsig.fmap.mapcontrol
Interface MapControlDrawer
- All Superinterfaces:
PrimitivesDrawer
- All Known Implementing Classes:
MapControlDrawer2D
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
Modifier and TypeMethodDescriptionvoidcleanCanvas(MapControl mapCtrl) Cleans the graphics using the image of the MapControlvoiddraw(org.gvsig.fmap.geom.Geometry geometry) It draws aGeometryon the map using the color specified using thePrimitivesDrawer.setColor(Color)method.voiddraw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws aGeometryon the map using a concrete symbol.voiddraw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol, org.gvsig.fmap.dal.feature.Feature feature) It draws aGeometryon the map using a concrete symbol.voiddrawHandler(org.gvsig.fmap.geom.handler.Handler handler, AffineTransform at) It draws aHandleron the map.voiddrawHandlers(org.gvsig.fmap.geom.handler.Handler[] handlers, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws theHandler's that compose a geometry on the map.voidIt draws an image on a map in a concrete position.voiddrawImage(Image img, AffineTransform xform) It draws image, applying a transform from image space into user space before drawing.voiddrawLine(Point2D firstPoint, Point2D endPoint, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws a line using a concrete symbol.voidsetComposite(Composite instance) voidsetRenderingHints(RenderingHints hints) Replaces the values of all preferences for the rendering algorithms with the specified hints.voidSets the Stroke for the Graphics2D context.voidsetViewPort(org.gvsig.fmap.mapcontext.ViewPort viewPort) TheViewPortis used to transform the map coordinates in the screen coordinates.voidMethods inherited from interface org.gvsig.fmap.mapcontrol.PrimitivesDrawer
drawLine, drawOval, drawRect, fillRect, setColor, setGraphics, startDrawing, stopDrawing
-
Method Details
-
setViewPort
void setViewPort(org.gvsig.fmap.mapcontext.ViewPort viewPort) TheViewPortis used to transform the map coordinates in the screen coordinates.- Parameters:
viewPort- TheViewPort
-
draw
void draw(org.gvsig.fmap.geom.Geometry geometry) It draws aGeometryon the map using the color specified using thePrimitivesDrawer.setColor(Color)method.- Parameters:
geometry- TheGeometryto draw.
-
draw
void draw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws aGeometryon the map using a concrete symbol.- Parameters:
geometry- TheGeometryto draw.symbol- The symbol used to draw the geometry.
-
draw
void draw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol, org.gvsig.fmap.dal.feature.Feature feature) It draws aGeometryon the map using a concrete symbol.- Parameters:
geometry- TheGeometryto draw.symbol- The symbol used to draw the geometry.feature- The feature used to draw the geometry.
-
drawHandlers
void drawHandlers(org.gvsig.fmap.geom.handler.Handler[] handlers, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws theHandler's that compose a geometry on the map.- Parameters:
handlers- An array ofHandler's.at- A transformation that has to be applied to theHandler's.symbol- The symbol used to draw the handlers.
-
drawLine
void drawLine(Point2D firstPoint, 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.
-
drawImage
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.
-
drawImage
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.
-
drawHandler
It draws aHandleron the map.- Parameters:
handler- TheHandlerto draw.at- A transformation that has to be applied to theHandler.
-
transform
- Parameters:
at-
-
setComposite
- Parameters:
instance-
-
setRenderingHints
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
Sets the Stroke for the Graphics2D context.- Parameters:
stroke- the Stroke object to be used to stroke a Shape during the rendering
-
cleanCanvas
Cleans the graphics using the image of the MapControl- Parameters:
mapCtrl-
-