org.geotools.renderer.j2d
Class SLDRenderedGeometries

java.lang.Object
  extended byorg.geotools.renderer.j2d.RenderedLayer
      extended byorg.geotools.renderer.j2d.RenderedGeometries
          extended byorg.geotools.renderer.j2d.SLDRenderedGeometries

public class SLDRenderedGeometries
extends RenderedGeometries

A RenderedGeometries layer that can process styles (will use device space coordinates for style rendering)

Author:
aaime

Field Summary
protected  double currentScale
          The current map scale.
 
Fields inherited from class org.geotools.renderer.j2d.RenderedLayer
listeners
 
Constructor Summary
SLDRenderedGeometries(GeometryCollection geometry)
          Construct a layer for the specified geometry.
 
Method Summary
protected  void paint(java.awt.Graphics2D graphics, java.awt.Shape shape, Style2D style)
          Invoked automatically when a polyline is about to be draw.
protected  void paint(RenderingContext context)
          Draw the geometry.
 
Methods inherited from class org.geotools.renderer.j2d.RenderedGeometries
dispose, getContour, getForeground, getGeometry, getPreferredArea, getPreferredPixelSize, getRenderUsingMapCS, getToolTipText, getZOrder, setContour, setCoordinateSystem, setForeground, setGeometry, setRenderUsingMapCS
 
Methods inherited from class org.geotools.renderer.j2d.RenderedLayer
addPropertyChangeListener, addPropertyChangeListener, getAction, getCoordinateSystem, getLocale, getName, getRenderer, getTreeLock, isVisible, prefetch, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, setPreferredArea, setPreferredPixelSize, setVisible, setZOrder, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentScale

protected double currentScale
The current map scale.

Constructor Detail

SLDRenderedGeometries

public SLDRenderedGeometries(GeometryCollection geometry)
Construct a layer for the specified geometry.

Parameters:
geometry - The geometry, or null if none.
See Also:
RenderedGeometries.setGeometry(org.geotools.renderer.geom.GeometryCollection)
Method Detail

paint

protected void paint(RenderingContext context)
              throws org.opengis.referencing.operation.TransformException
Draw the geometry.

Overrides:
paint in class RenderedGeometries
Parameters:
context - The set of transformations needed for transforming geographic coordinates (longitude,latitude) into pixels coordinates.
Throws:
org.opengis.referencing.operation.TransformException - If a transformation failed.
Task:
REVISIT: The scale computation done here is inacurate. It uses only the scale along X axis, fails under rotation, ignore the physical device size and do not comply to the usual definition of map scale (for example 1:10000 meaning "10000 meters in the real world = 1 meter on the screen"). A more accurate scale would be Renderer.getScale().

paint

protected void paint(java.awt.Graphics2D graphics,
                     java.awt.Shape shape,
                     Style2D style)
Invoked automatically when a polyline is about to be draw. This implementation paints the polyline according to the rendered style

Overrides:
paint in class RenderedGeometries
Parameters:
graphics - The graphics in which to draw.
style - The style to apply, or null if none.
shape - The polyline to draw.


Copyright © GeoTools. All Rights Reserved.