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:
dblasby

Method Summary
 void addRenderListener(RenderListener listener)
           
 MapContext getContext()
           
 java.awt.RenderingHints getJava2DHints()
           
 java.util.Map 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 removeRenderListener(RenderListener listener)
           
 void setContext(MapContext context)
           
 void setJava2DHints(java.awt.RenderingHints hints)
           
 void setRendererHints(java.util.Map hints)
           
 void stopRendering()
           
 

Method Detail

stopRendering

public void stopRendering()

addRenderListener

public void addRenderListener(RenderListener listener)

removeRenderListener

public void removeRenderListener(RenderListener listener)

setJava2DHints

public void setJava2DHints(java.awt.RenderingHints hints)

getJava2DHints

public java.awt.RenderingHints getJava2DHints()

setRendererHints

public void setRendererHints(java.util.Map hints)

getRendererHints

public java.util.Map getRendererHints()

setContext

public void setContext(MapContext context)

getContext

public MapContext getContext()

paint

public 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.
Task:
Need to check if the Layer CoordinateSystem is different to the BoundingBox rendering CoordinateSystem and if so, then transform the coordinates.

paint

public 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).

paint

public 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).
worldToScreen - A transform which converts World coordinates to Screen coordinates.


Copyright © GeoTools. All Rights Reserved.