|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.renderer.shape.ShapefileRenderer
public class ShapefileRenderer
A LiteRenderer Implementations that is optimized for shapefiles.
Field Summary | |
---|---|
static java.lang.String |
DECLARED_SCALE_DENOM_KEY
|
static org.geotools.renderer.shape.ShapefileRenderer.DefaultRenderListener |
DEFAULT_LISTENER
This listener is added to the list of listeners automatically. |
static java.lang.String |
DPI_KEY
|
static java.lang.String |
FORCE_CRS_KEY
|
static java.lang.String |
LABEL_CACHE_KEY
|
static java.util.logging.Logger |
LOGGER
|
static java.lang.String |
MEMORY_PRE_LOADING_KEY
|
static java.lang.String |
OPTIMIZED_DATA_LOADING_KEY
|
static java.lang.String |
SCALE_ACCURATE
Computes the scale as the ratio between map distances and real world distances, assuming 90dpi and taking into consideration projection deformations and actual earth shape. |
static java.lang.String |
SCALE_COMPUTATION_METHOD_KEY
|
static java.lang.String |
SCALE_OGC
Very simple and lenient scale computation method that conforms to the OGC SLD specification 1.0, page 26. |
static java.lang.String |
TEXT_RENDERING_KEY
The text rendering method, either TEXT_RENDERING_OUTLINE or TEXT_RENDERING_STRING |
static java.lang.String |
TEXT_RENDERING_OUTLINE
Text will be rendered using the associated GlyphVector outline, that is, a Shape . |
static java.lang.String |
TEXT_RENDERING_STRING
Text will be rendered using the usual calls gc.drawString/drawGlyphVector. |
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()
True if we are caching styles. |
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)
Deprecated. |
void |
paint(java.awt.Graphics2D graphics,
java.awt.Rectangle paintArea,
com.vividsolutions.jts.geom.Envelope mapArea,
java.awt.geom.AffineTransform worldToScreen)
Deprecated. |
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 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)
Set to true to cache styles. |
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 |
---|
public static final java.util.logging.Logger LOGGER
public static final java.lang.String SCALE_ACCURATE
public static final java.lang.String SCALE_OGC
public static final org.geotools.renderer.shape.ShapefileRenderer.DefaultRenderListener DEFAULT_LISTENER
public static final java.lang.String TEXT_RENDERING_STRING
public static final java.lang.String TEXT_RENDERING_OUTLINE
GlyphVector
outline, that is, a Shape
.
This ensures perfect centering between the text and the halo, but introduces more text aliasing.
public static final java.lang.String TEXT_RENDERING_KEY
public static final java.lang.String LABEL_CACHE_KEY
public static final java.lang.String FORCE_CRS_KEY
public static final java.lang.String DPI_KEY
public static final java.lang.String DECLARED_SCALE_DENOM_KEY
public static final java.lang.String MEMORY_PRE_LOADING_KEY
public static final java.lang.String OPTIMIZED_DATA_LOADING_KEY
public static final java.lang.String SCALE_COMPUTATION_METHOD_KEY
Constructor Detail |
---|
public ShapefileRenderer(MapContext context)
public ShapefileRenderer()
Method Detail |
---|
public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, ReferencedEnvelope mapArea)
GTRenderer
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.
paint
in interface GTRenderer
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.public void addRenderListener(RenderListener listener)
addRenderListener
in interface GTRenderer
listener
- the listener to add.RenderListener
public void removeRenderListener(RenderListener listener)
removeRenderListener
in interface GTRenderer
listener
- the listener to remove.RenderListener
protected void setScaleDenominator(double scaleDenominator)
scaleDenominator
- New value of property scaleDenominator.public void stopRendering()
paint
or
render
the rendering will be forcefully stopped before termination
stopRendering
in interface GTRenderer
public boolean isCaching()
ture
if cachingpublic void setCaching(boolean caching)
caching
- The caching to set.public MapContext getContext()
getContext
in interface GTRenderer
public boolean isConcatTransforms()
public void setConcatTransforms(boolean concatTransforms)
public IndexInfo useIndex(ShapefileDataStore ds) throws java.io.IOException, StoreException
java.io.IOException
StoreException
public void setJava2DHints(java.awt.RenderingHints hints)
setJava2DHints
in interface GTRenderer
public java.awt.RenderingHints getJava2DHints()
getJava2DHints
in interface GTRenderer
public void setRendererHints(java.util.Map hints)
setRendererHints
in interface GTRenderer
public java.util.Map getRendererHints()
getRendererHints
in interface GTRenderer
public void setContext(MapContext context)
setContext
in interface GTRenderer
public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, java.awt.geom.AffineTransform worldToScreen)
GTRenderer
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.
paint
in interface GTRenderer
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.public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, ReferencedEnvelope envelope, java.awt.geom.AffineTransform transform)
GTRenderer
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!
paint
in interface GTRenderer
graphics
- The graphics object to draw to.paintArea
- The size of the output area in output units (eg: pixels).envelope
- the map's visible area (viewport) in map coordinates.transform
- A transform which converts World coordinates to Screen
coordinates.public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, com.vividsolutions.jts.geom.Envelope mapArea)
GTRenderer
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.
paint
in interface GTRenderer
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.public void paint(java.awt.Graphics2D graphics, java.awt.Rectangle paintArea, com.vividsolutions.jts.geom.Envelope mapArea, java.awt.geom.AffineTransform worldToScreen)
GTRenderer
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!
paint
in interface GTRenderer
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |