Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/svgsupport/DefaultSVGRenderer.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/svgsupport/DefaultSVGRenderer.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/svgsupport/DefaultSVGRenderer.java	(revision 43156)
@@ -0,0 +1,176 @@
+package org.gvsig.svgsupport;
+
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import org.apache.batik.bridge.BridgeContext;
+import org.apache.batik.bridge.DocumentLoader;
+import org.apache.batik.bridge.GVTBuilder;
+import org.apache.batik.bridge.UserAgentAdapter;
+import org.apache.batik.bridge.ViewBox;
+import org.apache.batik.dom.svg.SVGOMDocument;
+import org.apache.batik.gvt.GraphicsNode;
+import org.apache.batik.gvt.renderer.StaticRenderer;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DefaultSVGRenderer implements SVGRenderer {
+
+    private final GVTBuilder gvtBuilder = new GVTBuilder();
+    private final UserAgentAdapter userAgent;
+    private final DocumentLoader loader;
+    private final StaticRenderer renderer = new StaticRenderer();
+    private GraphicsNode gvtRoot;
+    private final BridgeContext ctx;
+    private Element elt;
+    private URL source;
+
+    private static RenderingHints defaultRenderingHints = null;
+
+    public DefaultSVGRenderer() {
+        userAgent = new UserAgentAdapter();
+        loader = new DocumentLoader(userAgent);
+        ctx = new BridgeContext(userAgent, loader);
+        renderer.setDoubleBuffered(true);
+    }
+
+    @Override
+    public Rectangle2D getBounds() {
+        Rectangle2D bounds = gvtRoot.getBounds();
+        return bounds;
+    }
+
+    @Override
+    public void drawInsideRectangle(Graphics2D g,
+            Rectangle2D rect,
+            boolean keepAspectRatio) {
+        if (keepAspectRatio) {
+            AffineTransform ataux = null;
+            if (elt.hasAttribute("viewBox")) {
+
+                try {
+                    ataux
+                            = ViewBox.getViewTransform(null,
+                                    elt,
+                                    (float) rect.getWidth(),
+                                    (float) rect.getHeight(),
+                                    ctx);
+                } catch (NullPointerException e) {
+                    
+                }
+            }
+            if( ataux == null ) {
+                Rectangle2D bounds = gvtRoot.getBounds();
+
+                ataux = getNoRotationTransform(
+                    bounds,
+                    new Rectangle2D.Double(
+                        rect.getX(),
+                        rect.getY(),
+                        rect.getWidth(),
+                        rect.getHeight()),
+                    true
+                );
+            }
+            RenderingHints renderingHints = new RenderingHints(null);
+            renderingHints.putAll(getDefaultRenderingHints());
+            g.setRenderingHints(renderingHints);
+            gvtRoot.setTransform(ataux);
+            gvtRoot.paint(g);
+
+        } else {
+
+            Rectangle2D bounds = gvtRoot.getBounds();
+            AffineTransform ataux = getNoRotationTransform(
+                bounds,
+                new Rectangle2D.Double(
+                    rect.getX(),
+                    rect.getY(),
+                    rect.getWidth(),
+                    rect.getHeight()
+                ),
+                false
+            );
+
+            RenderingHints renderingHints = new RenderingHints(null);
+            renderingHints.putAll(getDefaultRenderingHints());
+            g.setRenderingHints(renderingHints);
+            gvtRoot.setTransform(ataux);
+            gvtRoot.paint(g);
+        }
+    }
+    
+    @Override
+    public void setSource(URL url) throws IOException {
+
+        source = url;
+        Document svgDoc;
+        try {
+            svgDoc = loader.loadDocument(url.toURI().toString());
+        } catch (URISyntaxException e) {
+            throw new IOException(e);
+        }
+        gvtRoot = gvtBuilder.build(ctx, svgDoc);
+        renderer.setTree(gvtRoot);
+        elt = ((SVGOMDocument) svgDoc).getRootElement();
+    }
+
+    
+    @Override
+    public URL getSource() {
+        return this.source;
+    }
+
+    private AffineTransform getNoRotationTransform(
+            Rectangle2D from_rect,
+            Rectangle2D to_rect,
+            boolean keep_aspect) {
+
+        double scalex = to_rect.getWidth() / from_rect.getWidth();
+        double scaley = to_rect.getHeight() / from_rect.getHeight();
+
+        if (keep_aspect) {
+            // force min value for both
+            scalex = Math.min(scalex, scaley);
+            scaley = scalex;
+        }
+
+        double from_new_center_x = scalex * from_rect.getCenterX();
+        double from_new_center_y = scaley * from_rect.getCenterY();
+
+        double offx = to_rect.getCenterX() - from_new_center_x;
+        double offy = to_rect.getCenterY() - from_new_center_y;
+
+        AffineTransform resp
+                = AffineTransform.getTranslateInstance(offx, offy);
+
+        // this composition is equivalent to:
+        // first scale, then move
+        resp.concatenate(
+                AffineTransform.getScaleInstance(scalex, scaley));
+        return resp;
+    }
+
+    private RenderingHints getDefaultRenderingHints() {
+        if (defaultRenderingHints == null) {
+            defaultRenderingHints = new RenderingHints(null);
+            defaultRenderingHints.put(RenderingHints.KEY_ANTIALIASING,
+                    RenderingHints.VALUE_ANTIALIAS_ON);
+
+            defaultRenderingHints.put(RenderingHints.KEY_INTERPOLATION,
+                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+        }
+        return defaultRenderingHints;
+    }
+
+    @Override
+    public void setSource(File f) throws IOException {
+        setSource(f.toURI().toURL());
+    }
+}
+
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/impl/DefaultSymbologyManager.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/impl/DefaultSymbologyManager.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/impl/DefaultSymbologyManager.java	(revision 43156)
@@ -49,12 +49,14 @@
 */
 package org.gvsig.symbology.impl;
 
+import java.awt.Shape;
 import java.io.IOException;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 
 import org.gvsig.fmap.mapcontext.rendering.legend.IInterval;
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelClass;
@@ -64,13 +66,15 @@
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.IZoomConstraints;
 import org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle;
 import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
+import org.gvsig.svgsupport.DefaultSVGRenderer;
+import org.gvsig.svgsupport.SVGRenderer;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.symbology.SymbologyLocator;
 import org.gvsig.symbology.SymbologyManager;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.FInterval;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.AttrInTableLabelingStrategy;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.DefaultLabelingMethod;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.IAttrInTableLabelingStrategy;
-import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.LabelClass;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.ZoomConstraintsImpl;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.IMultiShapeSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IMarkerFillSymbol;
@@ -116,6 +120,11 @@
 		return new FInterval(min, max);
 	}
 
+    @Override
+    public SVGRenderer createSVGRenderer() {
+        return new DefaultSVGRenderer();
+    }
+
 	public static class RegisterSymbologyManager implements Callable {
 
 		public Object call() throws Exception {
@@ -256,6 +265,12 @@
             }
             this.defaultLabelClassFactory = factory;
         }
+
+    @Override
+    public PathLength createPathLength(Shape path) {
+        return new DefaultPathLength(path);
+    }
         
+ 
         
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/AttrInTableLabelingStrategy.java	(revision 43156)
@@ -31,7 +31,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.cresques.cts.ICoordTrans;
 import org.cresques.cts.IProjection;
 import org.slf4j.LoggerFactory;
@@ -59,6 +59,7 @@
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.ILabelingMethod;
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.IPlacementConstraints;
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.IZoomConstraints;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.CartographicSupportToolkit;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol;
 import org.gvsig.tools.ToolsLocator;
@@ -77,8 +78,6 @@
  * LabelingStrategy used when the user wants to use label sizes, rotations, etc.
  * from the values included in fields of the datasource's table
  *
- * @author jaume dominguez faus - jaume.dominguez@iver.es
- *
  */
 public class AttrInTableLabelingStrategy implements IAttrInTableLabelingStrategy {
 
@@ -371,7 +370,7 @@
                                 Geometry aux_geom = geom.cloneGeometry();
                                 aux_geom.transform(viewPort.getAffineTransform());
 
-                                PathLength pathLen = new PathLength(aux_geom);
+                                PathLength pathLen = new DefaultPathLength(aux_geom);
                                 float length = pathLen.lengthOfPath();
                                 float distance = (float) (length * 0.4);
                                 rotation = pathLen.angleAtLength(distance);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/TextPath.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/TextPath.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/styling/TextPath.java	(revision 43156)
@@ -21,24 +21,6 @@
  * For any additional information, do not hesitate to contact us
  * at info AT gvsig.com, or visit our website www.gvsig.com.
  */
-/* CVS MESSAGES:
- *
- * $Id: TextPath.java 25636 2008-12-01 08:42:11Z vcaballero $
- * $Log$
- * Revision 1.2  2007-03-09 11:20:57  jaume
- * Advanced symbology (start committing)
- *
- * Revision 1.1.2.3  2007/02/21 07:34:09  jaume
- * labeling starts working
- *
- * Revision 1.1.2.2  2007/02/09 07:47:05  jaume
- * Isymbol moved
- *
- * Revision 1.1.2.1  2007/02/06 17:01:04  jaume
- * first version (only lines)
- *
- *
- */
 package org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling;
 
 import java.awt.Font;
@@ -47,7 +29,7 @@
 import java.awt.font.GlyphVector;
 import java.awt.geom.Point2D;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.Geometry.SUBTYPES;
 import org.gvsig.fmap.geom.GeometryLocator;
@@ -60,6 +42,7 @@
 import org.slf4j.LoggerFactory;
 
 import com.vividsolutions.jts.algorithm.Angle;
+import org.gvsig.symbology.PathLength;
 /**
  * <p>Class that represents baseline of a string and allows the baseline to
  * be composed as contiguous segments with distinct slope each.<br></p>
@@ -68,8 +51,6 @@
  * the character at a determined position in the string is placed and
  * rotated.<br></p>
  *
- * @author jaume dominguez faus - jaume.dominguez@iver.es
- *
  */
 public class TextPath {
 	private static final GeometryManager geomManager = GeometryLocator.getGeometryManager();
@@ -145,7 +126,7 @@
 
 		PathLength pl;
 		try {
-			pl = new PathLength(softenShape(path, gv).getShape());
+			pl = new DefaultPathLength(softenShape(path, gv).getShape());
 			if (alignment==ITextSymbol.SYMBOL_STYLE_ALIGNMENT_RIGHT) {
 				posList = computeAtRight(gv, pl, text);
 			}
@@ -164,7 +145,7 @@
 
 		float interval = (float) gv.getVisualBounds().getWidth()/(gv.getNumGlyphs()*3);
 
-		PathLength pl = new PathLength(shape.getShape());
+		PathLength pl = new DefaultPathLength(shape.getShape());
 		if (pl.lengthOfPath()==0.0f) {
 			return shape; 
 		}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/impl/PictureLineSymbol.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/impl/PictureLineSymbol.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/line/impl/PictureLineSymbol.java	(revision 43156)
@@ -24,7 +24,6 @@
 package org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.impl;
 
 import java.awt.BasicStroke;
-import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
 import java.awt.Shape;
@@ -34,7 +33,7 @@
 import java.io.IOException;
 import java.net.URL;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.gvsig.compat.print.PrintAttributes;
 import org.gvsig.fmap.dal.feature.Feature;
 import org.gvsig.fmap.geom.Geometry;
@@ -45,6 +44,7 @@
 import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException;
 import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
 import org.gvsig.i18n.Messages;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl.CartographicSupportToolkit;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.IPictureLineSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.style.BackgroundFileStyle;
@@ -63,8 +63,6 @@
  * PictureLineSymbol allows to use any symbol defined as an image (by an image file)
  * supported  by gvSIG.This symbol will be used as an initial object.The line will be
  * painted as a succession of puntual symbols through the path defined by it(the line).
- *
- * @author jaume dominguez faus - jaume.dominguez@iver.es
  */
 public class PictureLineSymbol extends AbstractLineSymbol implements IPictureLineSymbol  {
 
@@ -178,7 +176,7 @@
 		if (imageWidth==0 || imageHeight==0) return;
 		int height = (int) csWidth;
 
-		PathLength pl = new PathLength(geom_transf_clip);
+		PathLength pl = new DefaultPathLength(geom_transf_clip);
 		PathIterator iterator = geom_transf_clip.getPathIterator(null, 0.8);
 		double[] theData = new double[6];
 		Point2D firstPoint = null, startPoint = null, endPoint = null;
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/ArrowDecoratorStyle.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/ArrowDecoratorStyle.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/ArrowDecoratorStyle.java	(revision 43156)
@@ -28,7 +28,7 @@
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.gvsig.fmap.dal.feature.Feature;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.Geometry.SUBTYPES;
@@ -37,6 +37,7 @@
 import org.gvsig.fmap.geom.exception.CreateGeometryException;
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IArrowMarkerSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.marker.IMarkerSymbol;
@@ -53,8 +54,6 @@
  * different options to draw an arrow in a line (and draw it too). This
  * information is taken from the panel.
  *
- * @author 2005-2008 jaume dominguez faus - jaume.dominguez@iver.es
- * @author 2009- <a href="cordinyana@gvsig.org">C�sar Ordi�ana</a> - gvSIG team
  */
 public class ArrowDecoratorStyle extends AbstractStyle implements IArrowDecoratorStyle  {
 	public static final String ARROR_DECORATOR_STYLE_PERSISTENCE_DEFINITION_NAME = "ArrowDecoratorStyle";
@@ -169,7 +168,7 @@
 
 		Geometry geomToDraw = geom.cloneGeometry();
 		geomToDraw.transform(affineTransform);
-		PathLength pl = new PathLength(geomToDraw.getShape());
+		PathLength pl = new DefaultPathLength(geomToDraw.getShape());
 		float size = (float) marker.getSize();
 		marker.setRotation(0.0);
 		float myLineLength = pl.lengthOfPath();
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/SVGStyle.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/SVGStyle.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/style/SVGStyle.java	(revision 43156)
@@ -25,26 +25,14 @@
 
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
 import java.io.IOException;
-import java.net.URISyntaxException;
 import java.net.URL;
 
-import org.apache.batik.bridge.BridgeContext;
-import org.apache.batik.bridge.DocumentLoader;
-import org.apache.batik.bridge.GVTBuilder;
-import org.apache.batik.bridge.UserAgentAdapter;
-import org.apache.batik.bridge.ViewBox;
-import org.apache.batik.dom.svg.SVGOMDocument;
-import org.apache.batik.gvt.GraphicsNode;
-import org.apache.batik.gvt.renderer.StaticRenderer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
 
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
 import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolDrawingException;
+import org.gvsig.svgsupport.DefaultSVGRenderer;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.dynobject.DynStruct;
 import org.gvsig.tools.persistence.PersistenceManager;
@@ -59,93 +47,26 @@
  * hyperlinks using outbound simple XLinks.It is an open standard created
  * by the World Wide Web Consortium..
  * 
- * @author jaume dominguez faus - jaume.dominguez@iver.es
- * 
  */
 public class SVGStyle extends BackgroundFileStyle {
 
-    public static final String SVG_STYLE_PERSISTENCE_DEFINITION_NAME =
-        "SVGStyle";
+    public static final String SVG_STYLE_PERSISTENCE_DEFINITION_NAME = "SVGStyle";
     private static final String SOURCE = "source";
-    private final GVTBuilder gvtBuilder = new GVTBuilder();
-    private final UserAgentAdapter userAgent;
-    private final DocumentLoader loader;
-    private final StaticRenderer renderer = new StaticRenderer();
-    private GraphicsNode gvtRoot;
-    private final BridgeContext ctx;
-    private Element elt;
+    private DefaultSVGRenderer renderer;
 
-    protected static final RenderingHints defaultRenderingHints;
-    static {
-        defaultRenderingHints = new RenderingHints(null);
-        defaultRenderingHints.put(RenderingHints.KEY_ANTIALIASING,
-            RenderingHints.VALUE_ANTIALIAS_ON);
-
-        defaultRenderingHints.put(RenderingHints.KEY_INTERPOLATION,
-            RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-    }
-
     /**
      * Constructor method
      * 
      */
     public SVGStyle() {
-        userAgent = new UserAgentAdapter();
-        loader = new DocumentLoader(userAgent);
-        ctx = new BridgeContext(userAgent, loader);
-        renderer.setDoubleBuffered(true);
+        this.renderer = new DefaultSVGRenderer();
     }
 
     @Override
     public void drawInsideRectangle(Graphics2D g,
         Rectangle rect,
         boolean keepAspectRatio) throws SymbolDrawingException {
-        if (keepAspectRatio) {
-            AffineTransform ataux;
-            if (elt.hasAttribute("viewBox")) {
-
-                try {
-                    ataux =
-                        ViewBox.getViewTransform(null,
-                            elt,
-                            (float) rect.getWidth(),
-                            (float) rect.getHeight(),
-                            ctx);
-                } catch (NullPointerException e) {
-                    throw new SymbolDrawingException(SymbolDrawingException.UNSUPPORTED_SET_OF_SETTINGS);
-                }
-            } else {
-                Rectangle2D bounds = gvtRoot.getBounds();
-                
-                ataux = getNoRotationTransform(
-                    bounds,
-                    new Rectangle2D.Double(
-                        rect.x,
-                        rect.y,
-                        rect.width,
-                        rect.height),
-                    true);
-            }
-            RenderingHints renderingHints = new RenderingHints(null);
-            renderingHints.putAll(defaultRenderingHints);
-            g.setRenderingHints(renderingHints);
-            gvtRoot.setTransform(ataux);
-            gvtRoot.paint(g);
-
-        } else {
-
-            Rectangle2D bounds = gvtRoot.getBounds();
-            AffineTransform ataux = getNoRotationTransform(
-                bounds,
-                new Rectangle2D.Double(rect.x, rect.y, rect.width, rect.height),
-                false);
-            
-            RenderingHints renderingHints = new RenderingHints(null);
-            renderingHints.putAll(defaultRenderingHints);
-            g.setRenderingHints(renderingHints);
-            gvtRoot.setTransform(ataux);
-            gvtRoot.paint(g);
-        }
+        this.renderer.drawInsideRectangle(g, rect, keepAspectRatio);
     }
 
     @Override
@@ -157,21 +78,13 @@
     public void setSource(URL url) throws IOException {
 
     	source = url;
-    	Document svgDoc;
-    	try {
-    		svgDoc = loader.loadDocument(url.toURI().toString());
-    	} catch (URISyntaxException e) {
-            throw new IOException(e);
-    	}
-    	gvtRoot = gvtBuilder.build(ctx, svgDoc);
-    	renderer.setTree(gvtRoot);
-    	elt = ((SVGOMDocument) svgDoc).getRootElement();
+        this.renderer.setSource(url);
     }
 
     @Override
     public Rectangle getBounds() {
         try {
-            Rectangle2D r = gvtRoot.getBounds();
+            Rectangle2D r = this.renderer.getBounds();
             return new Rectangle((int) r.getX(),
                 (int) r.getY(),
                 (int) r.getWidth(),
@@ -234,36 +147,5 @@
             return Boolean.TRUE;
         }
 
-    }
-    
-    
-    private AffineTransform getNoRotationTransform(
-        Rectangle2D from_rect,
-        Rectangle2D to_rect,
-        boolean keep_aspect) {
-        
-        double scalex = to_rect.getWidth() / from_rect.getWidth();
-        double scaley = to_rect.getHeight() / from_rect.getHeight();
-        
-        if (keep_aspect) {
-            // force min value for both
-            scalex = Math.min(scalex,  scaley);
-            scaley = scalex;
-        }
-        
-        double from_new_center_x = scalex * from_rect.getCenterX(); 
-        double from_new_center_y = scaley * from_rect.getCenterY(); 
-        
-        double offx = to_rect.getCenterX() - from_new_center_x;
-        double offy = to_rect.getCenterY() - from_new_center_y;
-        
-        AffineTransform resp =
-            AffineTransform.getTranslateInstance(offx, offy);
-        
-        // this composition is equivalent to:
-        // first scale, then move
-        resp.concatenate(
-            AffineTransform.getScaleInstance(scalex, scaley));
-        return resp;
-    }
+    }    
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FGraphicUtilities.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FGraphicUtilities.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FGraphicUtilities.java	(revision 43156)
@@ -21,52 +21,6 @@
  * For any additional information, do not hesitate to contact us
  * at info AT gvsig.com, or visit our website www.gvsig.com.
  */
-/*
- * Created on 28-abr-2004
- *
- * To change the template for this generated file go to
- * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
- */
-/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
- *
- * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
- *
- * For more information, contact:
- *
- *  Generalitat Valenciana
- *   Conselleria d'Infraestructures i Transport
- *   Av. Blasco Ib��ez, 50
- *   46010 VALENCIA
- *   SPAIN
- *
- *      +34 963862235
- *   gvsig@gva.es
- *      www.gvsig.gva.es
- *
- *    or
- *
- *   IVER T.I. S.A
- *   Salamanca 50
- *   46005 Valencia
- *   Spain
- *
- *   +34 963163400
- *   dac@iver.es
- */
 package org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl;
 
 import java.awt.Color;
@@ -77,7 +31,7 @@
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.GeometryLocator;
 import org.gvsig.fmap.geom.GeometryManager;
@@ -88,6 +42,7 @@
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.mapcontext.MapContext;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
 import org.slf4j.Logger;
@@ -104,7 +59,6 @@
  * Recordar: Que sea ISymbol el que renderiza.
  * extensible el s�mbolo a usar. NOTA: Ver tambi�n comentario en ISymbol
  *
- * @author fjp
  * @deprecated
  */
 public class FGraphicUtilities {
@@ -429,7 +383,7 @@
 				//
 				if (theLabel.getOrig() == null) // Calculamos el punto y la orientaci�n solo la primera vez
 				 {
-					PathLength pathLen = new PathLength(geom.getShape());
+					PathLength pathLen = new DefaultPathLength(geom.getShape());
 
 					// if (pathLen.lengthOfPath() < width / mT.getScaleX()) return;
 					float midDistance = pathLen.lengthOfPath() / 2;
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FLabel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FLabel.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/symbol/impl/FLabel.java	(revision 43156)
@@ -21,52 +21,6 @@
  * For any additional information, do not hesitate to contact us
  * at info AT gvsig.com, or visit our website www.gvsig.com.
  */
-/*
- * Created on 13-jul-2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
- *
- * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
- *
- * For more information, contact:
- *
- *  Generalitat Valenciana
- *   Conselleria d'Infraestructures i Transport
- *   Av. Blasco Ib��ez, 50
- *   46010 VALENCIA
- *   SPAIN
- *
- *      +34 963862235
- *   gvsig@gva.es
- *      www.gvsig.gva.es
- *
- *    or
- *
- *   IVER T.I. S.A
- *   Salamanca 50
- *   46005 Valencia
- *   Spain
- *
- *   +34 963163400
- *   dac@iver.es
- */
 package org.gvsig.symbology.fmap.mapcontext.rendering.symbol.impl;
 
 import java.awt.Color;
@@ -77,7 +31,7 @@
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 
-import org.apache.batik.ext.awt.geom.PathLength;
+import org.apache.batik.ext.awt.geom.DefaultPathLength;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -86,13 +40,12 @@
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.mapcontext.ViewPort;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.PathLength;
 import org.gvsig.utils.XMLEntity;
 
 /**
  * Se utiliza para etiquetar. Las capas vectoriales tienen un arrayList
  * (m_labels) de FLabel, un FLabel por cada registro.
- *
- * @author FJP
  * @deprecated
  */
 public class FLabel implements Cloneable {
@@ -334,7 +287,7 @@
 		label.setOrig(pAux);
 		switch (geom.getType()) {
 			case org.gvsig.fmap.geom.Geometry.TYPES.CURVE:
-           		PathLength pathLen = new PathLength(geom.getShape());
+                                PathLength pathLen = new DefaultPathLength(geom.getShape());
 				float midDistance = pathLen.lengthOfPath() / 2;
 				angle = pathLen.angleAtLength(midDistance);
 
@@ -359,7 +312,7 @@
 				return pAux;
 
 			case org.gvsig.fmap.geom.Geometry.TYPES.CURVE:
-            	PathLength pathLen = new PathLength(geom.getShape());
+            	DefaultPathLength pathLen = new DefaultPathLength(geom.getShape());
 
 				// if (pathLen.lengthOfPath() < width / mT.getScaleX()) return;
 				float midDistance = pathLen.lengthOfPath() / 2;
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/apache/batik/ext/awt/geom/DefaultPathLength.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/apache/batik/ext/awt/geom/DefaultPathLength.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/apache/batik/ext/awt/geom/DefaultPathLength.java	(revision 43156)
@@ -0,0 +1,619 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+package org.apache.batik.ext.awt.geom;
+/*
+ * Based on portions of code from org.apache.batik.ext.awt.geom of the
+ * batik-awt-util project, The Apache XML Graphics Project.
+ * https://xmlgraphics.apache.org/
+ */
+
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.FlatteningPathIterator;
+import java.awt.geom.PathIterator;
+import java.awt.geom.Point2D;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.gvsig.symbology.PathLength;
+/**
+ * Utilitiy class for length calculations of paths.
+ * <p>
+ *   PathLength is a utility class for calculating the length
+ *   of a path, the location of a point at a particular length
+ *   along the path, and the angle of the tangent to the path
+ *   at a given length.
+ * </p>
+ * <p>
+ *   It uses a FlatteningPathIterator to create a flattened version
+ *   of the Path. This means the values returned are not always
+ *   exact (in fact, they rarely are), but in most cases they
+ *   are reasonably accurate.
+ * </p>
+ *
+ * @author <a href="mailto:dean.jackson@cmis.csiro.au">Dean Jackson</a>
+ * @version $Id$
+ */
+public class DefaultPathLength implements PathLength {
+
+    /**
+     * The path to use for calculations.
+     */
+    protected Shape path;
+
+    /**
+     * The list of flattened path segments.
+     */
+    protected List segments;
+
+    /**
+     * Array where the index is the index of the original path segment
+     * and the value is the index of the first of the flattened segments
+     * in {@link #segments} that corresponds to that original path segment.
+     */
+    protected int[] segmentIndexes;
+
+    /**
+     * Cached copy of the path length.
+     */
+    protected float pathLength;
+
+    /**
+     * Whether this path been flattened yet.
+     */
+    protected boolean initialised;
+
+    /**
+     * Creates a new PathLength object for the specified {@link Shape}.
+     * @param path The Path (or Shape) to use.
+     */
+    public DefaultPathLength(Shape path) {
+        setPath(path);
+    }
+
+    /**
+     * Returns the path to use for calculations.
+     * @return Path used in calculations.
+     */
+    public Shape getPath() {
+        return path;
+    }
+
+    /**
+     * Sets the path to use for calculations.
+     * @param v Path to be used in calculations.
+     */
+    public void setPath(Shape v) {
+        this.path = v;
+        initialised = false;
+    }
+
+    /**
+     * Returns the length of the path used by this PathLength object.
+     * @return The length of the path.
+     */
+    @Override
+    public float lengthOfPath() {
+        if (!initialised) {
+            initialise();
+        }
+        return pathLength;
+    }
+
+    /**
+     * Flattens the path and determines the path length.
+     */
+    protected void initialise() {
+        pathLength = 0f;
+
+        PathIterator pi = path.getPathIterator(new AffineTransform());
+        SingleSegmentPathIterator sspi = new SingleSegmentPathIterator();
+        segments = new ArrayList(20);
+        List indexes = new ArrayList(20);
+        int index = 0;
+        int origIndex = -1;
+        float lastMoveX = 0f;
+        float lastMoveY = 0f;
+        float currentX = 0f;
+        float currentY = 0f;
+        float[] seg = new float[6];
+        int segType;
+
+        segments.add(new PathSegment(PathIterator.SEG_MOVETO, 0f, 0f, 0f,
+                                     origIndex));
+
+        while (!pi.isDone()) {
+            origIndex++;
+            indexes.add(new Integer(index));
+            segType = pi.currentSegment(seg);
+            switch (segType) {
+                case PathIterator.SEG_MOVETO:
+                    segments.add(new PathSegment(segType, seg[0], seg[1],
+                                                 pathLength, origIndex));
+                    currentX = seg[0];
+                    currentY = seg[1];
+                    lastMoveX = currentX;
+                    lastMoveY = currentY;
+                    index++;
+                    pi.next();
+                    break;
+                case PathIterator.SEG_LINETO:
+                    pathLength += Point2D.distance(currentX, currentY, seg[0],
+                                                   seg[1]);
+                    segments.add(new PathSegment(segType, seg[0], seg[1],
+                                                 pathLength, origIndex));
+                    currentX = seg[0];
+                    currentY = seg[1];
+                    index++;
+                    pi.next();
+                    break;
+                case PathIterator.SEG_CLOSE:
+                    pathLength += Point2D.distance(currentX, currentY,
+                                                   lastMoveX, lastMoveY);
+                    segments.add(new PathSegment(PathIterator.SEG_LINETO,
+                                                 lastMoveX, lastMoveY,
+                                                 pathLength, origIndex));
+                    currentX = lastMoveX;
+                    currentY = lastMoveY;
+                    index++;
+                    pi.next();
+                    break;
+                default:
+                    sspi.setPathIterator(pi, currentX, currentY);
+                    FlatteningPathIterator fpi =
+                        new FlatteningPathIterator(sspi, 0.01f);
+                    while (!fpi.isDone()) {
+                        segType = fpi.currentSegment(seg);
+                        if (segType == PathIterator.SEG_LINETO) {
+                            pathLength += Point2D.distance(currentX, currentY,
+                                                           seg[0], seg[1]);
+                            segments.add(new PathSegment(segType, seg[0],
+                                                         seg[1], pathLength,
+                                                         origIndex));
+                            currentX = seg[0];
+                            currentY = seg[1];
+                            index++;
+                        }
+                        fpi.next();
+                    }
+            }
+        }
+        segmentIndexes = new int[indexes.size()];
+        for (int i = 0; i < segmentIndexes.length; i++) {
+            segmentIndexes[i] = ((Integer) indexes.get(i)).intValue();
+        }
+        initialised = true;
+    }
+
+    /**
+     * Returns the number of segments in the path.
+     */
+    public int getNumberOfSegments() {
+        if (!initialised) {
+            initialise();
+        }
+        return segmentIndexes.length;
+    }
+
+    /**
+     * Returns the length at the start of the segment given by the specified
+     * index.
+     */
+    public float getLengthAtSegment(int index) {
+        if (!initialised) {
+            initialise();
+        }
+        if (index <= 0) {
+            return 0;
+        }
+        if (index >= segmentIndexes.length) {
+            return pathLength;
+        }
+        PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]);
+        return seg.getLength();
+    }
+
+    /**
+     * Returns the index of the segment at the given distance along the path.
+     */
+    public int segmentAtLength(float length) {
+        int upperIndex = findUpperIndex(length);
+        if (upperIndex == -1) {
+            // Length is off the end of the path.
+            return -1;
+        }
+
+        if (upperIndex == 0) {
+            // Length was probably zero, so return the upper segment.
+            PathSegment upper = (PathSegment) segments.get(upperIndex);
+            return upper.getIndex();
+        }
+
+        PathSegment lower = (PathSegment) segments.get(upperIndex - 1);
+        return lower.getIndex();
+    }
+
+    /**
+     * Returns the point that is the given proportion along the path segment
+     * given by the specified index.
+     */
+    public Point2D pointAtLength(int index, float proportion) {
+        if (!initialised) {
+            initialise();
+        }
+        if (index < 0 || index >= segmentIndexes.length) {
+            return null;
+        }
+        PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]);
+        float start = seg.getLength();
+        float end;
+        if (index == segmentIndexes.length - 1) {
+            end = pathLength;
+        } else {
+            seg = (PathSegment) segments.get(segmentIndexes[index + 1]);
+            end = seg.getLength();
+        }
+        return pointAtLength(start + (end - start) * proportion);
+    }
+
+    /**
+     * Returns the point that is at the given length along the path.
+     * @param length The length along the path
+     * @return The point at the given length
+     */
+    @Override
+    public Point2D pointAtLength(float length) {
+        int upperIndex = findUpperIndex(length);
+        if (upperIndex == -1) {
+            // Length is off the end of the path.
+            return null;
+        }
+
+        PathSegment upper = (PathSegment) segments.get(upperIndex);
+
+        if (upperIndex == 0) {
+            // Length was probably zero, so return the upper point.
+            return new Point2D.Float(upper.getX(), upper.getY());
+        }
+
+        PathSegment lower = (PathSegment) segments.get(upperIndex - 1);
+
+        // Now work out where along the line would be the length.
+        float offset = length - lower.getLength();
+
+        // Compute the slope.
+        double theta = Math.atan2(upper.getY() - lower.getY(),
+                                  upper.getX() - lower.getX());
+
+        float xPoint = (float) (lower.getX() + offset * Math.cos(theta));
+        float yPoint = (float) (lower.getY() + offset * Math.sin(theta));
+
+        return new Point2D.Float(xPoint, yPoint);
+    }
+
+    /**
+     * Returns the slope of the path at the specified length.
+     * @param index The segment number
+     * @param proportion The proportion along the given segment
+     * @return the angle in radians, in the range [-{@link Math#PI},
+     *         {@link Math#PI}].
+     */
+    public float angleAtLength(int index, float proportion) {
+        if (!initialised) {
+            initialise();
+        }
+        if (index < 0 || index >= segmentIndexes.length) {
+            return 0f;
+        }
+        PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]);
+        float start = seg.getLength();
+        float end;
+        if (index == segmentIndexes.length - 1) {
+            end = pathLength;
+        } else {
+            seg = (PathSegment) segments.get(segmentIndexes[index + 1]);
+            end = seg.getLength();
+        }
+        return angleAtLength(start + (end - start) * proportion);
+    }
+
+    /**
+     * Returns the slope of the path at the specified length.
+     * @param length The length along the path
+     * @return the angle in radians, in the range [-{@link Math#PI},
+     *         {@link Math#PI}].
+     */
+    @Override
+    public float angleAtLength(float length) {
+        int upperIndex = findUpperIndex(length);
+        if (upperIndex == -1) {
+            // Length is off the end of the path.
+            return 0f;
+        }
+
+        PathSegment upper = (PathSegment) segments.get(upperIndex);
+
+        if (upperIndex == 0) {
+            // Length was probably zero, so return the angle between the first
+            // and second segments.
+            upperIndex = 1;
+        }
+
+        PathSegment lower = (PathSegment) segments.get(upperIndex - 1);
+
+        // Compute the slope.
+        return (float) Math.atan2(upper.getY() - lower.getY(),
+                                  upper.getX() - lower.getX());
+    }
+
+    /**
+     * Returns the index of the path segment that bounds the specified
+     * length along the path.
+     * @param length The length along the path
+     * @return The path segment index, or -1 if there is not such segment
+     */
+    public int findUpperIndex(float length) {
+        if (!initialised) {
+            initialise();
+        }
+
+        if (length < 0 || length > pathLength) {
+            // Length is outside the path, so return -1.
+            return -1;
+        }
+
+        // Find the two segments that are each side of the length.
+        int lb = 0;
+        int ub = segments.size() - 1;
+        while (lb != ub) {
+            int curr = (lb + ub) >> 1;
+            PathSegment ps = (PathSegment) segments.get(curr);
+            if (ps.getLength() >= length) {
+                ub = curr;
+            } else {
+                lb = curr + 1;
+            }
+        }
+        for (;;) {
+            PathSegment ps = (PathSegment) segments.get(ub);
+            if (ps.getSegType() != PathIterator.SEG_MOVETO
+                    || ub == segments.size() - 1) {
+                break;
+            }
+            ub++;
+        }
+
+        int upperIndex = -1;
+        int currentIndex = 0;
+        int numSegments = segments.size();
+        while (upperIndex <= 0 && currentIndex < numSegments) {
+            PathSegment ps = (PathSegment) segments.get(currentIndex);
+            if (ps.getLength() >= length
+                    && ps.getSegType() != PathIterator.SEG_MOVETO) {
+                upperIndex = currentIndex;
+            }
+            currentIndex++;
+        }
+        return upperIndex;
+    }
+
+    /**
+     * A {@link PathIterator} that returns only the next path segment from
+     * another {@link PathIterator}.
+     */
+    protected static class SingleSegmentPathIterator implements PathIterator {
+
+        /**
+         * The path iterator being wrapped.
+         */
+        protected PathIterator it;
+
+        /**
+         * Whether the single segment has been passed.
+         */
+        protected boolean done;
+
+        /**
+         * Whether the generated move command has been returned.
+         */
+        protected boolean moveDone;
+
+        /**
+         * The x coordinate of the next move command.
+         */
+        protected double x;
+
+        /**
+         * The y coordinate of the next move command.
+         */
+        protected double y;
+
+        /**
+         * Sets the path iterator to use and the initial SEG_MOVETO command
+         * to return before it.
+         */
+        public void setPathIterator(PathIterator it, double x, double y) {
+            this.it = it;
+            this.x = x;
+            this.y = y;
+            done = false;
+            moveDone = false;
+        }
+
+        public int currentSegment(double[] coords) {
+            int type = it.currentSegment(coords);
+            if (!moveDone) {
+                coords[0] = x;
+                coords[1] = y;
+                return SEG_MOVETO;
+            }
+            return type;
+        }
+
+        public int currentSegment(float[] coords) {
+            int type = it.currentSegment(coords);
+            if (!moveDone) {
+                coords[0] = (float) x;
+                coords[1] = (float) y;
+                return SEG_MOVETO;
+            }
+            return type;
+        }
+
+        public int getWindingRule() {
+            return it.getWindingRule();
+        }
+
+        public boolean isDone() {
+            return done || it.isDone();
+        }
+
+        public void next() {
+            if (!done) {
+                if (!moveDone) {
+                    moveDone = true;
+                } else {
+                    it.next();
+                    done = true;
+                }
+            }
+        }
+    }
+
+    /**
+     * A single path segment in the flattened version of the path.
+     * This is a local helper class. PathSegment-objects are stored in
+     * the {@link PathLength#segments} - list.
+     * This is used as an immutable value-object.
+     */
+    protected static class PathSegment {
+
+        /**
+         * The path segment type.
+         */
+        protected final int segType;
+
+        /**
+         * The x coordinate of the path segment.
+         */
+        protected float x;
+
+        /**
+         * The y coordinate of the path segment.
+         */
+        protected float y;
+
+        /**
+         * The length of the path segment, accumulated from the start.
+         */
+        protected float length;
+
+        /**
+         * The index of the original path segment this flattened segment is a
+         * part of.
+         */
+        protected int index;
+
+        /**
+         * Creates a new PathSegment with the specified parameters.
+         * @param segType The segment type
+         * @param x The x coordinate
+         * @param y The y coordinate
+         * @param len The segment length
+         * @param idx The index of the original path segment this flattened
+         *            segment is a part of
+         */
+        PathSegment(int segType, float x, float y, float len, int idx) {
+            this.segType = segType;
+            this.x = x;
+            this.y = y;
+            this.length = len;
+            this.index = idx;
+        }
+
+        /**
+         * Returns the segment type.
+         */
+        public int getSegType() {
+            return segType;
+        }
+
+        /**
+         * Returns the x coordinate of the path segment.
+         */
+        public float getX() {
+            return x;
+        }
+
+        /**
+         * Sets the x coordinate of the path segment.
+         */
+        public void setX(float v) {
+            x = v;
+        }
+
+        /**
+         * Returns the y coordinate of the path segment.
+         */
+        public float getY() {
+            return y;
+        }
+
+        /**
+         * Sets the y coordinate of the path segment.
+         */
+        public void setY(float v) {
+            y = v;
+        }
+
+        /**
+         * Returns the length of the path segment.
+         */
+        public float getLength() {
+            return length;
+        }
+
+        /**
+         * Sets the length of the path segment.
+         */
+        public void setLength(float v) {
+            length = v;
+        }
+
+        /**
+         * Returns the segment index.
+         */
+        public int getIndex() {
+            return index;
+        }
+
+        /**
+         * Sets the segment index.
+         */
+        public void setIndex(int v) {
+            index = v;
+        }
+    }
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/pom.xml
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/pom.xml	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/pom.xml	(revision 43156)
@@ -128,15 +128,7 @@
     
     <!-- Test dependencies -->
 
-<!--
-    <dependency>
-      <groupId>org.gvsig</groupId>
-      <artifactId>org.gvsig.symbology.lib.api</artifactId>
-      <version>2.0.1-SNAPSHOT</version>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
--->
+
   </dependencies>
 
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/PathLength.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/PathLength.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/PathLength.java	(revision 43156)
@@ -0,0 +1,52 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.symbology;
+
+import java.awt.geom.Point2D;
+
+
+public interface PathLength {
+
+    /**
+     * Returns the slope of the path at the specified length.
+     * @param length The length along the path
+     * @return the angle in radians, in the range [-{@link Math#PI},
+     *         {@link Math#PI}].
+     */
+    float angleAtLength(float length);
+
+    /**
+     * Returns the length of the path used by this PathLength object.
+     * @return The length of the path.
+     */
+    float lengthOfPath();
+
+    /**
+     * Returns the point that is at the given length along the path.
+     * @param length The length along the path
+     * @return The point at the given length
+     */
+    Point2D pointAtLength(float length);
+    
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/SymbologyManager.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/SymbologyManager.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/symbology/SymbologyManager.java	(revision 43156)
@@ -42,12 +42,10 @@
  * 
  */
 
-/*
- * AUTHORS (In addition to CIT):
- * 2009 {}  {{Task}}
- */
+
 package org.gvsig.symbology;
 
+import java.awt.Shape;
 import java.io.IOException;
 import java.net.URL;
 import java.util.Collection;
@@ -60,6 +58,7 @@
 import org.gvsig.fmap.mapcontext.rendering.legend.styling.IZoomConstraints;
 import org.gvsig.fmap.mapcontext.rendering.symbols.styles.IBackgroundFileStyle;
 import org.gvsig.fmap.mapcontext.rendering.symbols.styles.ILabelStyle;
+import org.gvsig.svgsupport.SVGRenderer;
 import org.gvsig.symbology.fmap.mapcontext.rendering.legend.styling.IAttrInTableLabelingStrategy;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.IMultiShapeSymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IMarkerFillSymbol;
@@ -140,6 +139,7 @@
      * Creates an instance of a class (provided by this manager) which
      * implements ILabelClass.
      *
+     * @return 
      */
     ILabelClass createDefaultLabel();
     
@@ -149,4 +149,7 @@
 
     public void setDefaultLabelFactory(ILabelClassFactory factory);
 
+    public SVGRenderer createSVGRenderer();
+    
+    public PathLength createPathLength(Shape path);
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/svgsupport/SVGRenderer.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/svgsupport/SVGRenderer.java	(revision 0)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.api/src/main/java/org/gvsig/svgsupport/SVGRenderer.java	(revision 43156)
@@ -0,0 +1,48 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * For any additional information, do not hesitate to contact us at info AT
+ * gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.svgsupport;
+
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+public interface SVGRenderer {
+
+    public Rectangle2D getBounds();
+
+    public void drawInsideRectangle(
+        Graphics2D g,
+        Rectangle2D rect,
+        boolean keepAspectRatio
+    );
+
+    public void setSource(URL url) throws IOException;
+    public void setSource(File f) throws IOException;
+
+
+    public URL getSource();
+
+}
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/pom.xml
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/pom.xml	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.impl/pom.xml	(revision 43156)
@@ -37,26 +37,12 @@
       <scope>compile</scope>
     </dependency>
 
-<!--
     <dependency>
       <groupId>org.gvsig</groupId>
-      <artifactId>org.gvsig.symbology.swing.api</artifactId>
-      <type>test-jar</type>
-      <scope>test</scope>
-    </dependency>
--->
-    <dependency>
-      <groupId>org.gvsig</groupId>
       <artifactId>org.gvsig.symbology.lib.impl</artifactId>
       <scope>test</scope>
     </dependency>
-<!--
-    <dependency>
-      <groupId>org.gvsig</groupId>
-      <artifactId>org.gvsig.compat.se</artifactId>
-      <scope>test</scope>
-    </dependency>
--->
+
   </dependencies>
 </project>
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SLDListBoxCellRenderer.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SLDListBoxCellRenderer.java	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/src/main/java/org/gvsig/app/gui/styling/SLDListBoxCellRenderer.java	(revision 43156)
@@ -3,23 +3,22 @@
  *
  * Copyright (C) 2007-2013 gvSIG Association.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3 of the License, or (at your option) any later
+ * version.
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
- * For any additional information, do not hesitate to contact us
- * at info AT gvsig.com, or visit our website www.gvsig.com.
+ * For any additional information, do not hesitate to contact us at info AT
+ * gvsig.com, or visit our website www.gvsig.com.
  */
 package org.gvsig.app.gui.styling;
 
@@ -28,7 +27,7 @@
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
-import java.awt.RenderingHints;
+import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
 import java.io.File;
 
@@ -37,155 +36,77 @@
 import javax.swing.JPanel;
 import javax.swing.ListCellRenderer;
 
-import org.apache.batik.bridge.BridgeContext;
-import org.apache.batik.bridge.DocumentLoader;
-import org.apache.batik.bridge.GVTBuilder;
-import org.apache.batik.bridge.UserAgentAdapter;
-import org.apache.batik.bridge.ViewBox;
-import org.apache.batik.gvt.GraphicsNode;
-import org.apache.batik.gvt.renderer.StaticRenderer;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.svg.SVGDocument;
+import org.gvsig.svgsupport.SVGRenderer;
+import org.gvsig.symbology.SymbologyLocator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-/**
-*
-* @author jaume dominguez faus - jaume.dominguez@iver.es
-*
-*/
 public class SLDListBoxCellRenderer extends JPanel implements ListCellRenderer {
 
+    private static final Logger LOG = LoggerFactory.getLogger(SLDListBoxCellRenderer.class);
     /**
-	 * 
-	 */
-	private static final long serialVersionUID = 1458566622433802796L;
-	private String str;
-    private GVTBuilder gvtBuilder = new GVTBuilder();
-    private StaticRenderer renderer = new StaticRenderer();
-    private Element elt;
-    private GraphicsNode gvtRoot;
+     *
+     */
+    private static final long serialVersionUID = 1458566622433802796L;
+    private String str;
+    private final SVGRenderer renderer;
 
-    DocumentLoader loader;
-    private UserAgentAdapter userAgent;
-    BridgeContext  ctx;
     BufferedImage image;
-    protected static RenderingHints defaultRenderingHints;
-    static {
-        defaultRenderingHints = new RenderingHints(null);
-        defaultRenderingHints.put(RenderingHints.KEY_ANTIALIASING,
-                                  RenderingHints.VALUE_ANTIALIAS_ON);
 
-        defaultRenderingHints.put(RenderingHints.KEY_INTERPOLATION,
-                                  RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-    }
     /**
      * Constructor method
      *
      */
-
     public SLDListBoxCellRenderer() {
         setOpaque(true);
-        setLayout(new BorderLayout(3,3));
-
-        userAgent = new UserAgentAdapter();
-        loader    = new DocumentLoader(userAgent);
-        ctx       = new BridgeContext(userAgent, loader);
-
-        renderer.setDoubleBuffered(true);
-        /* canvas = new JSVGCanvas();
-        // canvas.setMySize(getWidth()-3, getHeight()-3);
-        canvas.setMySize(new Dimension(getWidth()-3, getHeight()-3));
-        // add(canvas,BorderLayout.CENTER);
-        canvas.setVisible(true); */
-
-        /* setHorizontalAlignment(CENTER);
-        setVerticalAlignment(CENTER); */
+        setLayout(new BorderLayout(3, 3));
+        renderer = SymbologyLocator.getSymbologyManager().createSVGRenderer();
     }
+
+    @Override
     public Component getListCellRendererComponent(JList list, Object value,
             int index, boolean isSelected, boolean cellHasFocus) {
-//      Get the selected index. (The index param isn't
-//      always valid, so just use the value.)
-      String selectedSymbol = ((String)value).toString();
-      str = selectedSymbol;
+        String selectedSymbol = value.toString();
+        str = selectedSymbol;
 
-      if (isSelected) {
-          setBackground(list.getSelectionBackground());
-          setForeground(list.getSelectionForeground());
-      } else {
-          setBackground(list.getBackground());
-          setForeground(list.getForeground());
-      }
+        if (isSelected) {
+            setBackground(list.getSelectionBackground());
+            setForeground(list.getSelectionForeground());
+        } else {
+            setBackground(list.getBackground());
+            setForeground(list.getForeground());
+        }
 
-      /* try {
-          canvas.setURI( new File("D:/java/eclipse30/eclipse/workspace/FMap 03/docs/fill1.svg").toURL().toString() );
-      } catch (MalformedURLException e1) {
-          // TODO Auto-generated catch block
-          e1.printStackTrace();
-      } */
-      gvtRoot = null;
-      try
-      {
-          File f = new File(str);
-          Document svgDoc = loader.loadDocument(f.toURI().toString());
-          gvtRoot = gvtBuilder.build(ctx, svgDoc);
-          renderer.setTree(gvtRoot);
-          elt = ((SVGDocument)svgDoc).getRootElement();
+        try {
+            renderer.setSource(new File(str));
+        } catch (Exception ex) {
+            LOG.warn("Can't draw svg from '" + str + "'.", ex);
+        }
 
-      } catch (Exception ex) {
-          ex.printStackTrace();
-      }
+        String pet = selectedSymbol;
+        setFont(list.getFont());
+        repaint();
 
-
-//      Set the icon and text.  If icon was null, say so.
-      // ImageIcon icon = images[selectedIndex];
-      String pet = selectedSymbol; // petStrings[selectedIndex];
-      /* setIcon(icon);
-      if (icon != null) { */
-          // setText(pet);
-          setFont(list.getFont());
-          repaint();
-      /* } else {
-          // setUhOhText(pet + " (no image available)", list.getFont());
-      } */
-
-      return this;
+        return this;
     }
-    /* (non-Javadoc)
-     * @see javax.swing.JComponent#paintComponent(java.awt.Graphics)
-     */
+
+    @Override
     protected void paintComponent(Graphics g) {
         super.paintComponent(g);
-        /* renderer.setTransform
-        (ViewBox.getViewTransform
-         (null, elt, getWidth()-1, getHeight()-1));
-
-        renderer.updateOffScreen(getWidth()-1,
-                                 getHeight()-1);
-
-        Rectangle r = new Rectangle(0, 0,
-                                    getWidth()-1,
-                                    getHeight()-1);
-        renderer.repaint(r);
-
-        image = renderer.getOffScreen();
-
-        g.drawImage(image,0,0, null); */
-        Graphics2D g2 = (Graphics2D) g;
-        RenderingHints renderingHints = defaultRenderingHints;
-        g2.setRenderingHints(renderingHints);
         try {
-        	gvtRoot.setTransform((ViewBox.getViewTransform(null, elt, getWidth()-1, getHeight()-1, ctx)));
-        	gvtRoot.paint(g2);
+            renderer.drawInsideRectangle(
+                    (Graphics2D) g,
+                    new Rectangle2D.Double(0.0, 0.0, getWidth() - 1.0, getHeight() - 1.0),
+                    true
+            );
         } catch (Exception e) {
-        	Rectangle bounds = getBounds();
-        	JLabel errLbl = new JLabel("<html><b>"+"Cannot render north"+/*PluginServices.getText(this, "cannot_render_north")+*/"</b></html>");
-        	errLbl.setPreferredSize(bounds.getSize());
-        	errLbl.setSize(bounds.getSize());
-        	errLbl.setBounds(bounds);
-        	errLbl.paint(g);
+            Rectangle bounds = getBounds();
+            JLabel errLbl = new JLabel("<html><b>" + "Cannot render north" +/*PluginServices.getText(this, "cannot_render_north")+*/ "</b></html>");
+            errLbl.setPreferredSize(bounds.getSize());
+            errLbl.setSize(bounds.getSize());
+            errLbl.setBounds(bounds);
+            errLbl.paint(g);
         }
-        // g2.setTransform(oldTx);
-
     }
 
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/pom.xml
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/pom.xml	(revision 43155)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.swing/org.gvsig.symbology.swing.api/pom.xml	(revision 43156)
@@ -60,27 +60,8 @@
         <artifactId>castor</artifactId>
         <scope>compile</scope>
     </dependency>
+    
     <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-gvt</artifactId>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.xmlgraphics</groupId>
-        <artifactId>batik-bridge</artifactId>
-        <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-script</artifactId>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-ext</artifactId>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
         <groupId>xml-apis</groupId>
         <artifactId>xml-apis-ext</artifactId>
         <scope>compile</scope>
