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

    Modifier and Type
    Method
    Description
    void
    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
    draw(org.gvsig.fmap.geom.Geometry geometry, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol, org.gvsig.fmap.dal.feature.Feature feature)
    It draws a Geometry on the map using a concrete symbol.
    void
    drawHandler(org.gvsig.fmap.geom.handler.Handler handler, AffineTransform at)
    It draws a Handler on the map.
    void
    drawHandlers(org.gvsig.fmap.geom.handler.Handler[] handlers, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
    It draws the Handler's that compose a geometry on the map.
    void
    drawImage(Image img, int x, int y)
    It draws an image on a map in a concrete position.
    void
    It draws image, applying a transform from image space into user space before drawing.
    void
    drawLine(Point2D firstPoint, Point2D endPoint, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol)
    It draws a line using a concrete symbol.
    void
     
    void
    Replaces the values of all preferences for the rendering algorithms with the specified hints.
    void
    setStroke(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
     

    Methods 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)
      The ViewPort is used to transform the map coordinates in the screen coordinates.
      Parameters:
      viewPort - The ViewPort
    • 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.
    • 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 a Geometry on the map using a concrete symbol.
      Parameters:
      geometry - The Geometry to 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 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.
    • 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

      void drawImage(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.
    • drawImage

      void drawImage(Image img, 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.
    • drawHandler

      void drawHandler(org.gvsig.fmap.geom.handler.Handler handler, 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.
    • transform

      void transform(AffineTransform at)
      Parameters:
      at -
    • setComposite

      void setComposite(Composite instance)
      Parameters:
      instance -
    • setRenderingHints

      void setRenderingHints(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(Stroke stroke)
      Sets the Stroke for the Graphics2D context.
      Parameters:
      stroke - the Stroke object to be used to stroke a Shape during the rendering
    • cleanCanvas

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