org.geotools.renderer
Interface GTRenderer

All Known Implementing Classes:
ShapefileRenderer, StreamingRenderer

public interface GTRenderer

Typical usage:


          Rectangle paintArea = new Rectangle(width, height);
          Envelope mapArea = map.getAreaOfInterest();

          renderer = new StreamingRenderer();
          renderer.setContext(map);

          RenderingHints hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
          renderer.setJava2DHints(hints);

          Map rendererParams = new HashMap();
          rendererParams.put("optimizedDataLoadingEnabled",new Boolean(true) );

          renderer.paint(graphic, paintArea, mapArea);

Author:
David Blasby, Simone Giannecchini

Method Summary
 void addRenderListener(RenderListener listener)
           
 MapContext getContext()
           
 java.awt.RenderingHints getJava2DHints()
           
 java.util.Map<java.lang.Object,java.lang.Object> getRendererHints()
           
 void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, java.awt.geom.AffineTransform worldToScreen)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, com.vividsolutions.jts.geom.Envelope mapArea)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, com.vividsolutions.jts.geom.Envelope mapArea, java.awt.geom.AffineTransform worldToScreen)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, ReferencedEnvelope mapArea)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, ReferencedEnvelope mapArea, java.awt.geom.AffineTransform worldToScreen)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void removeRenderListener(RenderListener listener)
           
 void setContext(MapContext context)
           
 void setJava2DHints(java.awt.RenderingHints hints)
           
 void setRendererHints(java.util.Map<java.lang.Object,java.lang.Object> hints)
           
 void stopRendering()
           
 

Method Detail

stopRendering

void stopRendering()

addRenderListener

void addRenderListener(RenderListener listener)

removeRenderListener

void removeRenderListener(RenderListener listener)

setJava2DHints

void setJava2DHints(java.awt.RenderingHints hints)

getJava2DHints

java.awt.RenderingHints getJava2DHints()

setRendererHints

void setRendererHints(java.util.Map<java.lang.Object,java.lang.Object> hints)

getRendererHints

java.util.Map<java.lang.Object,java.lang.Object> getRendererHints()

setContext

void setContext(MapContext context)

getContext

MapContext getContext()

paint

void paint(java.awt.Graphics2D graphics,
           java.awt.Rectangle paintArea,
           java.awt.geom.AffineTransform worldToScreen)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the size of the output area and the transformation from coordinates to pixels are known. The latter determines the map scale. The viewport (the visible part of the map) will be calculated internally.

Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).
worldToScreen - A transform which converts World coordinates to Screen coordinates.

paint

void paint(java.awt.Graphics2D graphics,
           java.awt.Rectangle paintArea,
           com.vividsolutions.jts.geom.Envelope mapArea)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the area of the visible part of the map and the size of the output area are known. The transform between the two is calculated internally.

Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).
mapArea - the map's visible area (viewport) in map coordinates.

paint

void paint(java.awt.Graphics2D graphics,
           java.awt.Rectangle paintArea,
           ReferencedEnvelope mapArea)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that the area of the visible part of the map and the size of the output area are known. The transform between the two is calculated internally.

Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).
mapArea - the map's visible area (viewport) in map coordinates.

paint

void paint(java.awt.Graphics2D graphics,
           java.awt.Rectangle paintArea,
           com.vividsolutions.jts.geom.Envelope mapArea,
           java.awt.geom.AffineTransform worldToScreen)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that paint area, enelope and worldToScreen transform are already computed and in sync. Use this method to avoid recomputation. Note however that no check is performed that they are really synchronized!

Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).
mapArea - the map's visible area (viewport) in map coordinates.
worldToScreen - A transform which converts World coordinates to Screen coordinates.

paint

void paint(java.awt.Graphics2D graphics,
           java.awt.Rectangle paintArea,
           ReferencedEnvelope mapArea,
           java.awt.geom.AffineTransform worldToScreen)
Renders features based on the map layers and their styles as specified in the map context using setContext.

This version of the method assumes that paint area, enelope and worldToScreen transform are already computed and in sync. Use this method to avoid recomputation. Note however that no check is performed that they are really synchronized!

Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).
mapArea - the map's visible area (viewport) in map coordinates.
worldToScreen - A transform which converts World coordinates to Screen coordinates.


Copyright © 1996-2010 Geotools. All Rights Reserved.