org.geotools.renderer.shape
Class ShapefileRenderer

java.lang.Object
  extended byorg.geotools.renderer.shape.ShapefileRenderer
All Implemented Interfaces:
GTRenderer

public class ShapefileRenderer
extends java.lang.Object
implements GTRenderer

A LiteRenderer Implementations that is optimized for shapefiles.

Since:
2.1.x
Author:
jeichar

Field Summary
static org.geotools.renderer.shape.ShapefileRenderer.DefaultRenderListener DEFAULT_LISTENER
          This listener is added to the list of listeners automatically.
static java.util.logging.Logger LOGGER
           
 
Constructor Summary
ShapefileRenderer()
           
ShapefileRenderer(MapContext context)
           
 
Method Summary
 void addRenderListener(RenderListener listener)
          adds a listener that responds to error events of feature rendered events.
 MapContext getContext()
           
 java.awt.RenderingHints getJava2DHints()
           
 java.util.Map getRendererHints()
           
 boolean isCaching()
          DOCUMENT ME!
 boolean isConcatTransforms()
           
 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 envelope, java.awt.geom.AffineTransform transform)
          Renders features based on the map layers and their styles as specified in the map context using setContext.
 void removeRenderListener(RenderListener listener)
          Removes a render listener.
 void setCaching(boolean caching)
          DOCUMENT ME!
 void setConcatTransforms(boolean concatTransforms)
           
 void setContext(MapContext context)
           
 void setJava2DHints(java.awt.RenderingHints hints)
           
 void setRendererHints(java.util.Map hints)
           
protected  void setScaleDenominator(double scaleDenominator)
          Setter for property scaleDenominator.
 void stopRendering()
          If you call this method from another thread than the one that called paint or render the rendering will be forcefully stopped before termination
 IndexInfo useIndex(ShapefileDataStore ds)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

public static final java.util.logging.Logger LOGGER

DEFAULT_LISTENER

public static final org.geotools.renderer.shape.ShapefileRenderer.DefaultRenderListener DEFAULT_LISTENER
This listener is added to the list of listeners automatically. It should be removed if the default logging is not needed.

Constructor Detail

ShapefileRenderer

public ShapefileRenderer(MapContext context)

ShapefileRenderer

public ShapefileRenderer()
Method Detail

paint

public void paint(java.awt.Graphics2D graphics,
                  java.awt.Rectangle paintArea,
                  com.vividsolutions.jts.geom.Envelope mapArea)
Description copied from interface: GTRenderer
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.

Specified by:
paint in interface GTRenderer
Parameters:
graphics - The graphics object to draw to.
paintArea - The size of the output area in output units (eg: pixels).

addRenderListener

public void addRenderListener(RenderListener listener)
adds a listener that responds to error events of feature rendered events.

Specified by:
addRenderListener in interface GTRenderer
Parameters:
listener - the listener to add.
See Also:
RenderListener

removeRenderListener

public void removeRenderListener(RenderListener listener)
Removes a render listener.

Specified by:
removeRenderListener in interface GTRenderer
Parameters:
listener - the listener to remove.
See Also:
RenderListener

setScaleDenominator

protected void setScaleDenominator(double scaleDenominator)
Setter for property scaleDenominator.

Parameters:
scaleDenominator - New value of property scaleDenominator.

stopRendering

public void stopRendering()
If you call this method from another thread than the one that called paint or render the rendering will be forcefully stopped before termination

Specified by:
stopRendering in interface GTRenderer

isCaching

public boolean isCaching()
DOCUMENT ME!

Returns:
Returns the caching.

setCaching

public void setCaching(boolean caching)
DOCUMENT ME!

Parameters:
caching - The caching to set.

getContext

public MapContext getContext()
Specified by:
getContext in interface GTRenderer

isConcatTransforms

public boolean isConcatTransforms()

setConcatTransforms

public void setConcatTransforms(boolean concatTransforms)

useIndex

public IndexInfo useIndex(ShapefileDataStore ds)
                   throws java.io.IOException,
                          StoreException
Throws:
java.io.IOException
StoreException

setJava2DHints

public void setJava2DHints(java.awt.RenderingHints hints)
Specified by:
setJava2DHints in interface GTRenderer

getJava2DHints

public java.awt.RenderingHints getJava2DHints()
Specified by:
getJava2DHints in interface GTRenderer

setRendererHints

public void setRendererHints(java.util.Map hints)
Specified by:
setRendererHints in interface GTRenderer

getRendererHints

public java.util.Map getRendererHints()
Specified by:
getRendererHints in interface GTRenderer

setContext

public void setContext(MapContext context)
Specified by:
setContext in interface GTRenderer

paint

public void paint(java.awt.Graphics2D graphics,
                  java.awt.Rectangle paintArea,
                  java.awt.geom.AffineTransform worldToScreen)
Description copied from interface: GTRenderer
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.

Specified by:
paint in interface GTRenderer
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

public void paint(java.awt.Graphics2D graphics,
                  java.awt.Rectangle paintArea,
                  com.vividsolutions.jts.geom.Envelope envelope,
                  java.awt.geom.AffineTransform transform)
Description copied from interface: GTRenderer
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!

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


Copyright © GeoTools. All Rights Reserved.