Index: trunk/src/com/kitfox/svg/A.java
===================================================================
--- trunk/src/com/kitfox/svg/A.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/A.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
@@ -29,5 +38,4 @@
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
 import java.net.URI;
 
@@ -36,5 +44,7 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class A extends Group {
+public class A extends Group
+{
+    public static final String TAG_NAME = "a";
 
     URI href;
@@ -42,18 +52,12 @@
 
     /** Creates a new instance of Stop */
-    public A() {
+    public A()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String offset = attrs.getValue("offset");
-        this.offset = (float)XMLParseUtil.parseRatio(offset);
-
-        buildStop();
+        return TAG_NAME;
     }
-    */
     
     protected void build() throws SVGException
Index: trunk/src/com/kitfox/svg/Circle.java
===================================================================
--- trunk/src/com/kitfox/svg/Circle.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Circle.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
@@ -38,57 +46,46 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Circle extends ShapeElement 
+public class Circle extends ShapeElement
 {
 
+    public static final String TAG_NAME = "circle";
     float cx = 0f;
     float cy = 0f;
     float r = 0f;
-
-
     Ellipse2D.Float circle = new Ellipse2D.Float();
 
-    /** Creates a new instance of Rect */
-    public Circle() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Circle()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        String cx = attrs.getValue("cx");
-        String cy = attrs.getValue("cy");
-        String r = attrs.getValue("r");
-
-        this.cx = XMLParseUtil.parseFloat(cx);
-        this.cy = XMLParseUtil.parseFloat(cy);
-        this.r = XMLParseUtil.parseFloat(r);
-
-        build();
-        
-        //setBounds(this.cx - this.r, this.cy - this.r, this.r * 2.0, this.r * 2.0);
-    }
-*/
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-//        super.loaderEndElement(helper);
-
-//        build();
-    }
-     */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("r"))) r = sty.getFloatValueWithUnits();
-        
+
+        if (getPres(sty.setName("cx")))
+        {
+            cx = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("cy")))
+        {
+            cy = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("r")))
+        {
+            r = sty.getFloatValueWithUnits();
+        }
+
         circle.setFrame(cx - r, cy - r, r * 2f, r * 2f);
     }
@@ -112,6 +109,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -125,5 +123,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("cx")))
         {
@@ -135,5 +133,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("cy")))
         {
@@ -145,5 +143,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("r")))
         {
@@ -155,5 +153,5 @@
             }
         }
-        
+
         if (shapeChange)
         {
@@ -162,10 +160,6 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
-    
 }
-
-
-
Index: trunk/src/com/kitfox/svg/ClipPath.java
===================================================================
--- trunk/src/com/kitfox/svg/ClipPath.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/ClipPath.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
@@ -37,27 +45,24 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class ClipPath extends SVGElement 
+public class ClipPath extends SVGElement
 {
 
+    public static final String TAG_NAME = "clippath";
     public static final int CP_USER_SPACE_ON_USE = 0;
     public static final int CP_OBJECT_BOUNDING_BOX = 1;
-
     int clipPathUnits = CP_USER_SPACE_ON_USE;
 
-    /** Creates a new instance of Stop */
-    public ClipPath() {
+    /**
+     * Creates a new instance of Stop
+     */
+    public ClipPath()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        String clipPathUnits = attrs.getValue("clipPathUnits");
-
-        if (clipPathUnits.equals("objectBoundingBox")) this.clipPathUnits = CP_OBJECT_BOUNDING_BOX;
-
-    }
-*/
     /**
      * Called after the start element but before the end element to indicate
@@ -66,30 +71,19 @@
     public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
     {
-		super.loaderAddChild(helper, child);
-
-//        if (child instanceof ShapeElement) members.add(child);
+        super.loaderAddChild(helper, child);
     }
 
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-//        super.loaderEndElement(helper);
-
-//        build();
-    }
-    */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
         clipPathUnits = (getPres(sty.setName("clipPathUnits"))
-            && sty.getStringValue().equals("objectBoundingBox")) 
-            ? CP_OBJECT_BOUNDING_BOX 
+            && sty.getStringValue().equals("objectBoundingBox"))
+            ? CP_OBJECT_BOUNDING_BOX
             : CP_USER_SPACE_ON_USE;
     }
-    
+
     public int getClipPathUnits()
     {
@@ -99,21 +93,33 @@
     public Shape getClipPathShape()
     {
-        if (children.size() == 0) return null;
-        if (children.size() == 1) return ((ShapeElement)children.get(0)).getShape();
+        if (children.isEmpty())
+        {
+            return null;
+        }
+        if (children.size() == 1)
+        {
+            return ((ShapeElement) children.get(0)).getShape();
+        }
 
         Area clipArea = null;
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            ShapeElement se = (ShapeElement)it.next();
+            ShapeElement se = (ShapeElement) it.next();
 
             if (clipArea == null)
             {
                 Shape shape = se.getShape();
-                if (shape != null) clipArea = new Area(se.getShape());
+                if (shape != null)
+                {
+                    clipArea = new Area(se.getShape());
+                }
                 continue;
             }
 
             Shape shape = se.getShape();
-            if (shape != null) clipArea.intersect(new Area(shape));
+            if (shape != null)
+            {
+                clipArea.intersect(new Area(shape));
+            }
         }
 
@@ -122,6 +128,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -129,18 +136,16 @@
     public boolean updateTime(double curTime) throws SVGException
     {
-//        if (trackManager.getNumTracks() == 0) return false;
-
         //Get current values for parameters
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
 
-        
+
         if (getPres(sty.setName("clipPathUnits")))
         {
             String newUnitsStrn = sty.getStringValue();
             int newUnits = newUnitsStrn.equals("objectBoundingBox")
-                ? CP_OBJECT_BOUNDING_BOX 
+                ? CP_OBJECT_BOUNDING_BOX
                 : CP_USER_SPACE_ON_USE;
-                
+
             if (newUnits != clipPathUnits)
             {
Index: trunk/src/com/kitfox/svg/Defs.java
===================================================================
--- trunk/src/com/kitfox/svg/Defs.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Defs.java	(revision 6002)
@@ -1,37 +1,40 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
-import java.awt.*;
-import java.awt.geom.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.util.Iterator;
 
 /**
@@ -42,6 +45,16 @@
 {
 
-    /** Creates a new instance of Stop */
-    public Defs() {
+    public static final String TAG_NAME = "defs";
+
+    /**
+     * Creates a new instance of Stop
+     */
+    public Defs()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
@@ -52,5 +65,5 @@
     public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
     {
-		super.loaderAddChild(helper, child);
+        super.loaderAddChild(helper, child);
 
 //        members.add(child);
@@ -62,8 +75,8 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             stateChange = stateChange || ele.updateTime(curTime);
         }
-        
+
         return super.updateTime(curTime) || stateChange;
     }
Index: trunk/src/com/kitfox/svg/Desc.java
===================================================================
--- trunk/src/com/kitfox/svg/Desc.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Desc.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 19, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
@@ -34,10 +42,20 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Desc extends SVGElement {
+public class Desc extends SVGElement
+{
 
+    public static final String TAG_NAME = "desc";
     StringBuffer text = new StringBuffer();
 
-    /** Creates a new instance of Stop */
-    public Desc() {
+    /**
+     * Creates a new instance of Stop
+     */
+    public Desc()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
@@ -50,6 +68,9 @@
     }
 
-    public String getText() { return text.toString(); }
-    
+    public String getText()
+    {
+        return text.toString();
+    }
+
     public boolean updateTime(double curTime)
     {
Index: trunk/src/com/kitfox/svg/Ellipse.java
===================================================================
--- trunk/src/com/kitfox/svg/Ellipse.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Ellipse.java	(revision 6002)
@@ -1,37 +1,44 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-import java.awt.*;
-import java.awt.geom.*;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -39,71 +46,52 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Ellipse extends ShapeElement {
+public class Ellipse extends ShapeElement
+{
 
+    public static final String TAG_NAME = "ellipse";
     float cx = 0.0f;
     float cy = 0.0f;
     float rx = 0.0f;
     float ry = 0.0f;
-
     Ellipse2D.Float ellipse = new Ellipse2D.Float();
 
-    /** Creates a new instance of Rect */
-    public Ellipse() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Ellipse()
+    {
     }
-/*
-    protected void init(String idIn, Style parentStyle, String cx, String cy, String rx, String ry) {
-        super.init(idIn, parentStyle);
 
-        this.cx = parseDouble(cx);
-        this.cy = parseDouble(cy);
-        this.rx = parseDouble(rx);
-        this.ry = parseDouble(ry);
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
 
-        setBounds(this.cx - this.rx, this.cy - this.ry, this.rx * 2.0, this.ry * 2.0);
-    }
-*/
-    /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String cx = attrs.getValue("cx");
-        String cy = attrs.getValue("cy");
-        String rx = attrs.getValue("rx");
-        String ry = attrs.getValue("ry");
-
-        this.cx = XMLParseUtil.parseDouble(cx);
-        this.cy = XMLParseUtil.parseDouble(cy);
-        this.rx = XMLParseUtil.parseDouble(rx);
-        this.ry = XMLParseUtil.parseDouble(ry);
-
-        build();
-    }
-    */
-    
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        super.loaderEndElement(helper);
-
-        build();
-    }
-     */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("rx"))) rx = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("ry"))) ry = sty.getFloatValueWithUnits();
-        
+
+        if (getPres(sty.setName("cx")))
+        {
+            cx = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("cy")))
+        {
+            cy = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("rx")))
+        {
+            rx = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("ry")))
+        {
+            ry = sty.getFloatValueWithUnits();
+        }
+
         ellipse.setFrame(cx - rx, cy - ry, rx * 2f, ry * 2f);
     }
@@ -125,8 +113,9 @@
         return boundsToParent(includeStrokeInBounds(ellipse.getBounds2D()));
     }
-    
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -140,5 +129,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("cx")))
         {
@@ -150,5 +139,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("cy")))
         {
@@ -160,5 +149,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("rx")))
         {
@@ -170,5 +159,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("ry")))
         {
@@ -180,5 +169,5 @@
             }
         }
-        
+
         if (shapeChange)
         {
@@ -187,5 +176,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/FeDistantLight.java
===================================================================
--- trunk/src/com/kitfox/svg/FeDistantLight.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FeDistantLight.java	(revision 6002)
@@ -1,39 +1,40 @@
 /*
- * FillElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
 
 /**
@@ -41,30 +42,51 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class FeDistantLight extends FeLight 
+public class FeDistantLight extends FeLight
 {
+
+    public static final String TAG_NAME = "fedistantlight";
     float azimuth = 0f;
     float elevation = 0f;
-    
 
-    /** Creates a new instance of FillElement */
-    public FeDistantLight() {
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FeDistantLight()
+    {
     }
 
-    
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
-        
-        if (getPres(sty.setName("azimuth"))) azimuth = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("elevation"))) elevation = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("azimuth")))
+        {
+            azimuth = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("elevation")))
+        {
+            elevation = sty.getFloatValueWithUnits();
+        }
     }
 
-    public float getAzimuth() { return azimuth; }
-    public float getElevation() { return elevation; }
-    
+    public float getAzimuth()
+    {
+        return azimuth;
+    }
+
+    public float getElevation()
+    {
+        return elevation;
+    }
+
     public boolean updateTime(double curTime) throws SVGException
     {
@@ -74,5 +96,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean stateChange = false;
-        
+
         if (getPres(sty.setName("azimuth")))
         {
@@ -84,5 +106,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("elevation")))
         {
@@ -94,7 +116,6 @@
             }
         }
-        
+
         return stateChange;
     }
 }
-
Index: trunk/src/com/kitfox/svg/FeLight.java
===================================================================
--- trunk/src/com/kitfox/svg/FeLight.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FeLight.java	(revision 6002)
@@ -1,38 +1,38 @@
 /*
- * FillElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
 
 /**
@@ -40,11 +40,19 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-abstract public class FeLight extends FilterEffects 
+abstract public class FeLight extends FilterEffects
 {
 
-    /** Creates a new instance of FillElement */
-    public FeLight() {
+    public static final String TAG_NAME = "feLight";
+
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FeLight()
+    {
     }
 
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
 }
-
Index: trunk/src/com/kitfox/svg/FePointLight.java
===================================================================
--- trunk/src/com/kitfox/svg/FePointLight.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FePointLight.java	(revision 6002)
@@ -1,39 +1,40 @@
 /*
- * FillElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
 
 /**
@@ -41,34 +42,62 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class FePointLight extends FeLight 
+public class FePointLight extends FeLight
 {
+
+    public static final String TAG_NAME = "fepointlight";
     float x = 0f;
     float y = 0f;
     float z = 0f;
-    
 
-    /** Creates a new instance of FillElement */
-    public FePointLight() {
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FePointLight()
+    {
     }
 
-    
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("z"))) z = sty.getFloatValueWithUnits();
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("z")))
+        {
+            z = sty.getFloatValueWithUnits();
+        }
     }
 
-    public float getX() { return x; }
-    public float getY() { return y; }
-    public float getZ() { return z; }
-    
+    public float getX()
+    {
+        return x;
+    }
+
+    public float getY()
+    {
+        return y;
+    }
+
+    public float getZ()
+    {
+        return z;
+    }
+
     public boolean updateTime(double curTime) throws SVGException
     {
@@ -78,5 +107,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean stateChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -88,5 +117,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -98,5 +127,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("z")))
         {
@@ -108,7 +137,6 @@
             }
         }
-        
+
         return stateChange;
     }
 }
-
Index: trunk/src/com/kitfox/svg/FeSpotLight.java
===================================================================
--- trunk/src/com/kitfox/svg/FeSpotLight.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FeSpotLight.java	(revision 6002)
@@ -1,39 +1,40 @@
 /*
- * FillElement.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
 
 /**
@@ -41,6 +42,8 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class FeSpotLight extends FeLight 
+public class FeSpotLight extends FeLight
 {
+
+    public static final String TAG_NAME = "fespotlight";
     float x = 0f;
     float y = 0f;
@@ -51,37 +54,98 @@
     float specularComponent = 0f;
     float limitingConeAngle = 0f;
-    
-
-    /** Creates a new instance of FillElement */
-    public FeSpotLight() {
-    }
-
-    
+
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FeSpotLight()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("z"))) z = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("pointsAtX"))) pointsAtX = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("pointsAtY"))) pointsAtY = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("pointsAtZ"))) pointsAtZ = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("specularComponent"))) specularComponent = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("limitingConeAngle"))) limitingConeAngle = sty.getFloatValueWithUnits();
-    }
-
-    public float getX() { return x; }
-    public float getY() { return y; }
-    public float getZ() { return z; }
-    public float getPointsAtX() { return pointsAtX; }
-    public float getPointsAtY() { return pointsAtY; }
-    public float getPointsAtZ() { return pointsAtZ; }
-    public float getSpecularComponent() { return specularComponent; }
-    public float getLimitingConeAngle() { return limitingConeAngle; }
-    
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("z")))
+        {
+            z = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("pointsAtX")))
+        {
+            pointsAtX = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("pointsAtY")))
+        {
+            pointsAtY = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("pointsAtZ")))
+        {
+            pointsAtZ = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("specularComponent")))
+        {
+            specularComponent = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("limitingConeAngle")))
+        {
+            limitingConeAngle = sty.getFloatValueWithUnits();
+        }
+    }
+
+    public float getX()
+    {
+        return x;
+    }
+
+    public float getY()
+    {
+        return y;
+    }
+
+    public float getZ()
+    {
+        return z;
+    }
+
+    public float getPointsAtX()
+    {
+        return pointsAtX;
+    }
+
+    public float getPointsAtY()
+    {
+        return pointsAtY;
+    }
+
+    public float getPointsAtZ()
+    {
+        return pointsAtZ;
+    }
+
+    public float getSpecularComponent()
+    {
+        return specularComponent;
+    }
+
+    public float getLimitingConeAngle()
+    {
+        return limitingConeAngle;
+    }
+
     public boolean updateTime(double curTime) throws SVGException
     {
@@ -91,5 +155,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean stateChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -101,5 +165,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -111,5 +175,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("z")))
         {
@@ -121,5 +185,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("pointsAtX")))
         {
@@ -131,5 +195,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("pointsAtY")))
         {
@@ -141,5 +205,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("pointsAtZ")))
         {
@@ -151,5 +215,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("specularComponent")))
         {
@@ -161,5 +225,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("limitingConeAngle")))
         {
@@ -171,7 +235,6 @@
             }
         }
-        
+
         return stateChange;
     }
 }
-
Index: trunk/src/com/kitfox/svg/FillElement.java
===================================================================
--- trunk/src/com/kitfox/svg/FillElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FillElement.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * FillElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
@@ -35,16 +43,20 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-abstract public class FillElement extends SVGElement {
-
-    /** Creates a new instance of FillElement */
-    public FillElement() {
+abstract public class FillElement extends SVGElement
+{
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FillElement()
+    {
     }
 
     /**
-     * Requests the paint defined by this element.  Passes in information
-     * to allow paint to be customized
+     * Requests the paint defined by this element. Passes in information to
+     * allow paint to be customized
+     *
      * @param bounds - bounding box of shape being rendered
-     * @param xform - The current transformation that the shape is being rendered
-     * under.
+     * @param xform - The current transformation that the shape is being
+     * rendered under.
      */
     abstract public Paint getPaint(Rectangle2D bounds, AffineTransform xform);
Index: trunk/src/com/kitfox/svg/Filter.java
===================================================================
--- trunk/src/com/kitfox/svg/Filter.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Filter.java	(revision 6002)
@@ -1,36 +1,44 @@
 /*
- * FillElement.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.geom.Point2D;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
 
 /**
@@ -38,29 +46,32 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Filter extends SVGElement 
+public class Filter extends SVGElement
 {
+
+    public static final String TAG_NAME = "filter";
     public static final int FU_OBJECT_BOUNDING_BOX = 0;
     public static final int FU_USER_SPACE_ON_USE = 1;
-
     protected int filterUnits = FU_OBJECT_BOUNDING_BOX;
-    
     public static final int PU_OBJECT_BOUNDING_BOX = 0;
     public static final int PU_USER_SPACE_ON_USE = 1;
-
     protected int primitiveUnits = PU_OBJECT_BOUNDING_BOX;
-    
     float x = 0f;
     float y = 0f;
     float width = 1f;
     float height = 1f;
-    
     Point2D filterRes = new Point2D.Double();
-    
     URL href = null;
-
     final ArrayList filterEffects = new ArrayList();
 
-    /** Creates a new instance of FillElement */
-    public Filter() {
+    /**
+     * Creates a new instance of FillElement
+     */
+    public Filter()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
@@ -78,17 +89,22 @@
         }
     }
-    
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
-        
+
         if (getPres(sty.setName("filterUnits")))
         {
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) filterUnits = FU_USER_SPACE_ON_USE;
-            else filterUnits = FU_OBJECT_BOUNDING_BOX;
+            if (strn.equals("userspaceonuse"))
+            {
+                filterUnits = FU_USER_SPACE_ON_USE;
+            } else
+            {
+                filterUnits = FU_OBJECT_BOUNDING_BOX;
+            }
         }
 
@@ -96,17 +112,35 @@
         {
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) primitiveUnits = PU_USER_SPACE_ON_USE;
-            else primitiveUnits = PU_OBJECT_BOUNDING_BOX;
-        }
-
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
-
-        try {
+            if (strn.equals("userspaceonuse"))
+            {
+                primitiveUnits = PU_USER_SPACE_ON_USE;
+            } else
+            {
+                primitiveUnits = PU_OBJECT_BOUNDING_BOX;
+            }
+        }
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getFloatValueWithUnits();
+        }
+
+        try
+        {
             if (getPres(sty.setName("xlink:href")))
             {
@@ -114,6 +148,5 @@
                 href = src.toURL();
             }
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
             throw new SVGException(e);
@@ -122,9 +155,24 @@
     }
 
-    public float getX() { return x; }
-    public float getY() { return y; }
-    public float getWidth() { return width; }
-    public float getHeight() { return height; }
-    
+    public float getX()
+    {
+        return x;
+    }
+
+    public float getY()
+    {
+        return y;
+    }
+
+    public float getWidth()
+    {
+        return width;
+    }
+
+    public float getHeight()
+    {
+        return height;
+    }
+
     public boolean updateTime(double curTime) throws SVGException
     {
@@ -134,5 +182,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean stateChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -144,5 +192,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -154,5 +202,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("width")))
         {
@@ -164,5 +212,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("height")))
         {
@@ -174,11 +222,12 @@
             }
         }
-        
-        try {
+
+        try
+        {
             if (getPres(sty.setName("xlink:href")))
             {
                 URI src = sty.getURIValue(getXMLBase());
                 URL newVal = src.toURL();
-                
+
                 if (!newVal.equals(href))
                 {
@@ -187,6 +236,5 @@
                 }
             }
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
             throw new SVGException(e);
@@ -197,6 +245,11 @@
             int newVal;
             String strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) newVal = FU_USER_SPACE_ON_USE;
-            else newVal = FU_OBJECT_BOUNDING_BOX;
+            if (strn.equals("userspaceonuse"))
+            {
+                newVal = FU_USER_SPACE_ON_USE;
+            } else
+            {
+                newVal = FU_OBJECT_BOUNDING_BOX;
+            }
             if (newVal != filterUnits)
             {
@@ -210,6 +263,11 @@
             int newVal;
             String strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) newVal = PU_USER_SPACE_ON_USE;
-            else newVal = PU_OBJECT_BOUNDING_BOX;
+            if (strn.equals("userspaceonuse"))
+            {
+                newVal = PU_USER_SPACE_ON_USE;
+            } else
+            {
+                newVal = PU_OBJECT_BOUNDING_BOX;
+            }
             if (newVal != filterUnits)
             {
@@ -219,8 +277,7 @@
         }
 
-        
-        
+
+
         return stateChange;
     }
 }
-
Index: trunk/src/com/kitfox/svg/FilterEffects.java
===================================================================
--- trunk/src/com/kitfox/svg/FilterEffects.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FilterEffects.java	(revision 6002)
@@ -1,39 +1,42 @@
 /*
- * FillElement.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on March 18, 2004, 6:52 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.geom.*;
-import java.net.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.net.URI;
+import java.net.URL;
 
 /**
@@ -41,6 +44,8 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class FilterEffects extends SVGElement 
+public class FilterEffects extends SVGElement
 {
+    public static final String TAG_NAME = "filtereffects";
+    
     public static final int FP_SOURCE_GRAPHIC = 0;
     public static final int FP_SOURCE_ALPHA = 1;
@@ -50,23 +55,23 @@
     public static final int FP_STROKE_PAINT = 5;
     public static final int FP_CUSTOM = 5;
-
     private int filterPrimitiveTypeIn;
     private String filterPrimitiveRefIn;
-    
-    
     float x = 0f;
     float y = 0f;
     float width = 1f;
     float height = 1f;
-    
     String result = "defaultFilterName";
-    
-    
-    
     URL href = null;
 
-
-    /** Creates a new instance of FillElement */
-    public FilterEffects() {
+    /**
+     * Creates a new instance of FillElement
+     */
+    public FilterEffects()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
@@ -84,53 +89,68 @@
         }
     }
-    
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
         /*
-        if (getPres(sty.setName("filterUnits")))
-        {
-            strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) filterUnits = FU_USER_SPACE_ON_USE;
-            else filterUnits = FU_OBJECT_BOUNDING_BOX;
-        }
-
-        if (getPres(sty.setName("primitiveUnits")))
-        {
-            strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) primitiveUnits = PU_USER_SPACE_ON_USE;
-            else primitiveUnits = PU_OBJECT_BOUNDING_BOX;
-        }
-
-        if (getPres(sty.setName("x"))) x = sty.getFloatValue();
-
-        if (getPres(sty.setName("y"))) y = sty.getFloatValue();
-
-        if (getPres(sty.setName("width"))) width = sty.getFloatValue();
-
-        if (getPres(sty.setName("height"))) height = sty.getFloatValue();
-
-        try {
-            if (getPres(sty.setName("xlink:href")))
-            {
-                URI src = sty.getURIValue(getXMLBase());
-                href = src.toURL();
-            }
-        }
-        catch (Exception e)
-        {
-            throw new SVGException(e);
-        }
-*/
-    }
-
-    public float getX() { return x; }
-    public float getY() { return y; }
-    public float getWidth() { return width; }
-    public float getHeight() { return height; }
-    
+         if (getPres(sty.setName("filterUnits")))
+         {
+         strn = sty.getStringValue().toLowerCase();
+         if (strn.equals("userspaceonuse")) filterUnits = FU_USER_SPACE_ON_USE;
+         else filterUnits = FU_OBJECT_BOUNDING_BOX;
+         }
+
+         if (getPres(sty.setName("primitiveUnits")))
+         {
+         strn = sty.getStringValue().toLowerCase();
+         if (strn.equals("userspaceonuse")) primitiveUnits = PU_USER_SPACE_ON_USE;
+         else primitiveUnits = PU_OBJECT_BOUNDING_BOX;
+         }
+
+         if (getPres(sty.setName("x"))) x = sty.getFloatValue();
+
+         if (getPres(sty.setName("y"))) y = sty.getFloatValue();
+
+         if (getPres(sty.setName("width"))) width = sty.getFloatValue();
+
+         if (getPres(sty.setName("height"))) height = sty.getFloatValue();
+
+         try {
+         if (getPres(sty.setName("xlink:href")))
+         {
+         URI src = sty.getURIValue(getXMLBase());
+         href = src.toURL();
+         }
+         }
+         catch (Exception e)
+         {
+         throw new SVGException(e);
+         }
+         */
+    }
+
+    public float getX()
+    {
+        return x;
+    }
+
+    public float getY()
+    {
+        return y;
+    }
+
+    public float getWidth()
+    {
+        return width;
+    }
+
+    public float getHeight()
+    {
+        return height;
+    }
+
     public boolean updateTime(double curTime) throws SVGException
     {
@@ -140,5 +160,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean stateChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -150,5 +170,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -160,5 +180,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("width")))
         {
@@ -170,5 +190,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("height")))
         {
@@ -180,11 +200,12 @@
             }
         }
-        
-        try {
+
+        try
+        {
             if (getPres(sty.setName("xlink:href")))
             {
                 URI src = sty.getURIValue(getXMLBase());
                 URL newVal = src.toURL();
-                
+
                 if (!newVal.equals(href))
                 {
@@ -193,6 +214,5 @@
                 }
             }
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
             throw new SVGException(e);
@@ -200,34 +220,33 @@
 
         /*
-        if (getPres(sty.setName("filterUnits")))
-        {
-            int newVal;
-            String strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) newVal = FU_USER_SPACE_ON_USE;
-            else newVal = FU_OBJECT_BOUNDING_BOX;
-            if (newVal != filterUnits)
-            {
-                filterUnits = newVal;
-                stateChange = true;
-            }
-        }
-
-        if (getPres(sty.setName("primitiveUnits")))
-        {
-            int newVal;
-            String strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) newVal = PU_USER_SPACE_ON_USE;
-            else newVal = PU_OBJECT_BOUNDING_BOX;
-            if (newVal != filterUnits)
-            {
-                primitiveUnits = newVal;
-                stateChange = true;
-            }
-        }
-
-        */
-        
+         if (getPres(sty.setName("filterUnits")))
+         {
+         int newVal;
+         String strn = sty.getStringValue().toLowerCase();
+         if (strn.equals("userspaceonuse")) newVal = FU_USER_SPACE_ON_USE;
+         else newVal = FU_OBJECT_BOUNDING_BOX;
+         if (newVal != filterUnits)
+         {
+         filterUnits = newVal;
+         stateChange = true;
+         }
+         }
+
+         if (getPres(sty.setName("primitiveUnits")))
+         {
+         int newVal;
+         String strn = sty.getStringValue().toLowerCase();
+         if (strn.equals("userspaceonuse")) newVal = PU_USER_SPACE_ON_USE;
+         else newVal = PU_OBJECT_BOUNDING_BOX;
+         if (newVal != filterUnits)
+         {
+         primitiveUnits = newVal;
+         stateChange = true;
+         }
+         }
+
+         */
+
         return stateChange;
     }
 }
-
Index: trunk/src/com/kitfox/svg/Font.java
===================================================================
--- trunk/src/com/kitfox/svg/Font.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Font.java	(revision 6002)
@@ -1,36 +1,41 @@
 /*
- * Font.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-import java.util.*;
+import java.util.HashMap;
 
 /**
@@ -44,4 +49,6 @@
 public class Font extends SVGElement
 {
+
+    public static final String TAG_NAME = "font";
     int horizOriginX = 0;
     int horizOriginY = 0;
@@ -50,35 +57,20 @@
     int vertOriginY = -1;  //Defaults to font's ascent
     int vertAdvY = -1;  //Defaults to one 'em'.  See font-face
-
     FontFace fontFace = null;
     MissingGlyph missingGlyph = null;
     final HashMap glyphs = new HashMap();
 
-    /** Creates a new instance of Font */
+    /**
+     * Creates a new instance of Font
+     */
     public Font()
     {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String horizOriginX = attrs.getValue("horiz-origin-x");
-        String horizOriginY = attrs.getValue("horiz-origin-y");
-        String horizAdvX = attrs.getValue("horiz-adv-x");
-        String vertOriginX = attrs.getValue("vert-origin-x");
-        String vertOriginY = attrs.getValue("vert-origin-y");
-        String vertAdvY = attrs.getValue("vert-adv-y");
-
-        if (horizOriginX != null) this.horizOriginX = XMLParseUtil.parseInt(horizOriginX);
-        if (horizOriginY != null) this.horizOriginY = XMLParseUtil.parseInt(horizOriginY);
-        if (horizAdvX != null) this.horizAdvX = XMLParseUtil.parseInt(horizAdvX);
-        if (vertOriginX != null) this.vertOriginX = XMLParseUtil.parseInt(vertOriginX);
-        if (vertOriginY != null) this.vertOriginY = XMLParseUtil.parseInt(vertOriginY);
-        if (vertAdvY != null) this.vertAdvY = XMLParseUtil.parseInt(vertAdvY);
-
-    }
-*/
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     /**
      * Called after the start element but before the end element to indicate
@@ -87,17 +79,15 @@
     public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
     {
-		super.loaderAddChild(helper, child);
+        super.loaderAddChild(helper, child);
 
         if (child instanceof Glyph)
         {
-            glyphs.put(((Glyph)child).getUnicode(), child);
-        }
-        else if (child instanceof MissingGlyph)
-        {
-            missingGlyph = (MissingGlyph)child;
-        }
-        else if (child instanceof FontFace)
-        {
-            fontFace = (FontFace)child;
+            glyphs.put(((Glyph) child).getUnicode(), child);
+        } else if (child instanceof MissingGlyph)
+        {
+            missingGlyph = (MissingGlyph) child;
+        } else if (child instanceof FontFace)
+        {
+            fontFace = (FontFace) child;
         }
     }
@@ -108,43 +98,81 @@
 
         //build();
-        
+
         helper.universe.registerFont(this);
     }
-    
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("horiz-origin-x"))) horizOriginX = sty.getIntValue();
-        
-        if (getPres(sty.setName("horiz-origin-y"))) horizOriginY = sty.getIntValue();
-        
-        if (getPres(sty.setName("horiz-adv-x"))) horizAdvX = sty.getIntValue();
-        
-        if (getPres(sty.setName("vert-origin-x"))) vertOriginX = sty.getIntValue();
-        
-        if (getPres(sty.setName("vert-origin-y"))) vertOriginY = sty.getIntValue();
-        
-        if (getPres(sty.setName("vert-adv-y"))) vertAdvY = sty.getIntValue();
-    }
-    
-    public FontFace getFontFace() { return fontFace; }
+
+        if (getPres(sty.setName("horiz-origin-x")))
+        {
+            horizOriginX = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("horiz-origin-y")))
+        {
+            horizOriginY = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("horiz-adv-x")))
+        {
+            horizAdvX = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-origin-x")))
+        {
+            vertOriginX = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-origin-y")))
+        {
+            vertOriginY = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-adv-y")))
+        {
+            vertAdvY = sty.getIntValue();
+        }
+    }
+
+    public FontFace getFontFace()
+    {
+        return fontFace;
+    }
 
     public MissingGlyph getGlyph(String unicode)
     {
-        Glyph retVal = (Glyph)glyphs.get(unicode);
-        if (retVal == null) return missingGlyph;
+        Glyph retVal = (Glyph) glyphs.get(unicode);
+        if (retVal == null)
+        {
+            return missingGlyph;
+        }
         return retVal;
     }
 
-    public int getHorizOriginX() { return horizOriginX; }
-    public int getHorizOriginY() { return horizOriginY; }
-    public int getHorizAdvX() { return horizAdvX; }
+    public int getHorizOriginX()
+    {
+        return horizOriginX;
+    }
+
+    public int getHorizOriginY()
+    {
+        return horizOriginY;
+    }
+
+    public int getHorizAdvX()
+    {
+        return horizAdvX;
+    }
 
     public int getVertOriginX()
     {
-        if (vertOriginX != -1) return vertOriginX;
+        if (vertOriginX != -1)
+        {
+            return vertOriginX;
+        }
         vertOriginX = getHorizAdvX() / 2;
         return vertOriginX;
@@ -153,5 +181,8 @@
     public int getVertOriginY()
     {
-        if (vertOriginY != -1) return vertOriginY;
+        if (vertOriginY != -1)
+        {
+            return vertOriginY;
+        }
         vertOriginY = fontFace.getAscent();
         return vertOriginY;
@@ -160,12 +191,16 @@
     public int getVertAdvY()
     {
-        if (vertAdvY != -1) return vertAdvY;
+        if (vertAdvY != -1)
+        {
+            return vertAdvY;
+        }
         vertAdvY = fontFace.getUnitsPerEm();
         return vertAdvY;
     }
-    
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -176,72 +211,72 @@
         return false;
         /*
-        if (trackManager.getNumTracks() == 0) return false;
-        
-        //Get current values for parameters
-        StyleAttribute sty = new StyleAttribute();
-        boolean stateChange = false;
-        
-        if (getPres(sty.setName("horiz-origin-x")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != horizOriginX)
-            {
-                horizOriginX = newVal;
-                stateChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("horiz-origin-y")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != horizOriginY)
-            {
-                horizOriginY = newVal;
-                stateChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("horiz-adv-x")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != horizAdvX)
-            {
-                horizAdvX = newVal;
-                stateChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("vert-origin-x")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != vertOriginX)
-            {
-                vertOriginX = newVal;
-                stateChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("vert-origin-y")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != vertOriginY)
-            {
-                vertOriginY = newVal;
-                stateChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("vert-adv-y")))
-        {
-            int newVal = sty.getIntValue();
-            if (newVal != vertAdvY)
-            {
-                vertAdvY = newVal;
-                stateChange = true;
-            }
-        }
-        
-        return shapeChange;
-        */
+         if (trackManager.getNumTracks() == 0) return false;
+        
+         //Get current values for parameters
+         StyleAttribute sty = new StyleAttribute();
+         boolean stateChange = false;
+        
+         if (getPres(sty.setName("horiz-origin-x")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != horizOriginX)
+         {
+         horizOriginX = newVal;
+         stateChange = true;
+         }
+         }
+        
+         if (getPres(sty.setName("horiz-origin-y")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != horizOriginY)
+         {
+         horizOriginY = newVal;
+         stateChange = true;
+         }
+         }
+        
+         if (getPres(sty.setName("horiz-adv-x")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != horizAdvX)
+         {
+         horizAdvX = newVal;
+         stateChange = true;
+         }
+         }
+        
+         if (getPres(sty.setName("vert-origin-x")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != vertOriginX)
+         {
+         vertOriginX = newVal;
+         stateChange = true;
+         }
+         }
+        
+         if (getPres(sty.setName("vert-origin-y")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != vertOriginY)
+         {
+         vertOriginY = newVal;
+         stateChange = true;
+         }
+         }
+        
+         if (getPres(sty.setName("vert-adv-y")))
+         {
+         int newVal = sty.getIntValue();
+         if (newVal != vertAdvY)
+         {
+         vertAdvY = newVal;
+         stateChange = true;
+         }
+         }
+        
+         return shapeChange;
+         */
     }
 }
Index: trunk/src/com/kitfox/svg/FontFace.java
===================================================================
--- trunk/src/com/kitfox/svg/FontFace.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/FontFace.java	(revision 6002)
@@ -1,38 +1,40 @@
 /*
- * Font.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-import java.awt.geom.*;
-import java.awt.*;
-
 
 /**
@@ -46,13 +48,14 @@
 public class FontFace extends SVGElement
 {
+
+    public static final String TAG_NAME = "fontface";
     String fontFamily;
-
-    /** Em size of coordinate system font is defined in */
+    /**
+     * Em size of coordinate system font is defined in
+     */
     int unitsPerEm = 1000;
-
     int ascent = -1;
     int descent = -1;
     int accentHeight = -1;
-
     int underlinePosition = -1;
     int underlineThickness = -1;
@@ -62,85 +65,86 @@
     int overlineThickness = -1;
 
-    /** Creates a new instance of Font */
+    /**
+     * Creates a new instance of Font
+     */
     public FontFace()
     {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        fontFamily = attrs.getValue("font-family");
-
-        String unitsPerEm = attrs.getValue("units-per-em");
-        String ascent = attrs.getValue("ascent");
-        String descent = attrs.getValue("descent");
-        String accentHeight = attrs.getValue("accent-height");
-
-        String underlinePosition = attrs.getValue("underline-position");
-        String underlineThickness = attrs.getValue("underline-thickness");
-        String strikethroughPosition = attrs.getValue("strikethrough-position");
-        String strikethroughThickness = attrs.getValue("strikethrough-thickness");
-        String overlinePosition = attrs.getValue("overline-position");
-        String overlineThickness = attrs.getValue("overline-thickness");
-
-
-        if (unitsPerEm != null) this.unitsPerEm = XMLParseUtil.parseInt(unitsPerEm);
-        if (ascent != null) this.ascent = XMLParseUtil.parseInt(ascent);
-        if (descent != null) this.descent = XMLParseUtil.parseInt(descent);
-        if (accentHeight != null) this.accentHeight = XMLParseUtil.parseInt(accentHeight);
-
-        if (underlinePosition != null) this.underlinePosition = XMLParseUtil.parseInt(underlinePosition);
-        if (underlineThickness != null) this.underlineThickness = XMLParseUtil.parseInt(underlineThickness);
-        if (strikethroughPosition != null) this.strikethroughPosition = XMLParseUtil.parseInt(strikethroughPosition);
-        if (strikethroughThickness != null) this.strikethroughThickness = XMLParseUtil.parseInt(strikethroughThickness);
-        if (overlinePosition != null) this.overlinePosition = XMLParseUtil.parseInt(overlinePosition);
-        if (overlineThickness != null) this.overlineThickness = XMLParseUtil.parseInt(overlineThickness);
-
-//        unitFontXform.setToScale(1.0 / (double)unitsPerEm, 1.0 / (double)unitsPerEm);
-    }
-  */  
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        super.loaderEndElement(helper);
-
-        build();
-        
-//        unitFontXform.setToScale(1.0 / (double)unitsPerEm, 1.0 / (double)unitsPerEm);
-    }
-     */
-    
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("font-family"))) fontFamily = sty.getStringValue();
-        
-        if (getPres(sty.setName("units-per-em"))) unitsPerEm = sty.getIntValue();
-        if (getPres(sty.setName("ascent"))) ascent = sty.getIntValue();
-        if (getPres(sty.setName("descent"))) descent = sty.getIntValue();
-        if (getPres(sty.setName("accent-height"))) accentHeight = sty.getIntValue();
-
-        if (getPres(sty.setName("underline-position"))) underlinePosition = sty.getIntValue();
-        if (getPres(sty.setName("underline-thickness"))) underlineThickness = sty.getIntValue();
-        if (getPres(sty.setName("strikethrough-position"))) strikethroughPosition = sty.getIntValue();
-        if (getPres(sty.setName("strikethrough-thickenss"))) strikethroughThickness = sty.getIntValue();
-        if (getPres(sty.setName("overline-position"))) overlinePosition = sty.getIntValue();
-        if (getPres(sty.setName("overline-thickness"))) overlineThickness = sty.getIntValue();
-    }
-
-
-    public String getFontFamily() { return fontFamily; }
-
-    public int getUnitsPerEm() { return unitsPerEm; }
+
+        if (getPres(sty.setName("font-family")))
+        {
+            fontFamily = sty.getStringValue();
+        }
+
+        if (getPres(sty.setName("units-per-em")))
+        {
+            unitsPerEm = sty.getIntValue();
+        }
+        if (getPres(sty.setName("ascent")))
+        {
+            ascent = sty.getIntValue();
+        }
+        if (getPres(sty.setName("descent")))
+        {
+            descent = sty.getIntValue();
+        }
+        if (getPres(sty.setName("accent-height")))
+        {
+            accentHeight = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("underline-position")))
+        {
+            underlinePosition = sty.getIntValue();
+        }
+        if (getPres(sty.setName("underline-thickness")))
+        {
+            underlineThickness = sty.getIntValue();
+        }
+        if (getPres(sty.setName("strikethrough-position")))
+        {
+            strikethroughPosition = sty.getIntValue();
+        }
+        if (getPres(sty.setName("strikethrough-thickenss")))
+        {
+            strikethroughThickness = sty.getIntValue();
+        }
+        if (getPres(sty.setName("overline-position")))
+        {
+            overlinePosition = sty.getIntValue();
+        }
+        if (getPres(sty.setName("overline-thickness")))
+        {
+            overlineThickness = sty.getIntValue();
+        }
+    }
+
+    public String getFontFamily()
+    {
+        return fontFamily;
+    }
+
+    public int getUnitsPerEm()
+    {
+        return unitsPerEm;
+    }
 
     public int getAscent()
     {
         if (ascent == -1)
-            ascent = unitsPerEm - ((Font)parent).getVertOriginY();
+        {
+            ascent = unitsPerEm - ((Font) parent).getVertOriginY();
+        }
         return ascent;
     }
@@ -149,5 +153,7 @@
     {
         if (descent == -1)
-            descent = ((Font)parent).getVertOriginY();
+        {
+            descent = ((Font) parent).getVertOriginY();
+        }
         return descent;
     }
@@ -156,5 +162,7 @@
     {
         if (accentHeight == -1)
+        {
             accentHeight = getAscent();
+        }
         return accentHeight;
     }
@@ -163,5 +171,7 @@
     {
         if (underlinePosition == -1)
+        {
             underlinePosition = unitsPerEm * 5 / 6;
+        }
         return underlinePosition;
     }
@@ -170,5 +180,7 @@
     {
         if (underlineThickness == -1)
+        {
             underlineThickness = unitsPerEm / 20;
+        }
         return underlineThickness;
     }
@@ -177,5 +189,7 @@
     {
         if (strikethroughPosition == -1)
+        {
             strikethroughPosition = unitsPerEm * 3 / 6;
+        }
         return strikethroughPosition;
     }
@@ -184,5 +198,7 @@
     {
         if (strikethroughThickness == -1)
+        {
             strikethroughThickness = unitsPerEm / 20;
+        }
         return strikethroughThickness;
     }
@@ -191,5 +207,7 @@
     {
         if (overlinePosition == -1)
+        {
             overlinePosition = unitsPerEm * 5 / 6;
+        }
         return overlinePosition;
     }
@@ -198,11 +216,14 @@
     {
         if (overlineThickness == -1)
+        {
             overlineThickness = unitsPerEm / 20;
+        }
         return overlineThickness;
     }
-    
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/Glyph.java
===================================================================
--- trunk/src/com/kitfox/svg/Glyph.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Glyph.java	(revision 6002)
@@ -1,41 +1,40 @@
 /*
- * Font.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.util.*;
-
-import com.kitfox.svg.pathcmd.*;
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
 
 /**
@@ -49,47 +48,45 @@
 public class Glyph extends MissingGlyph
 {
+
+    public static final String TAG_NAME = "missingglyph";
     /**
-     * One or more characters indicating the unicode sequence that denotes
-     * this glyph.
+     * One or more characters indicating the unicode sequence that denotes this
+     * glyph.
      */
     String unicode;
 
-    /** Creates a new instance of Font */
+    /**
+     * Creates a new instance of Font
+     */
     public Glyph()
     {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        //Get unicode sequence that maps to this glyph
-        unicode = attrs.getValue("unicode");
-    }
-*/
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        super.loaderEndElement(helper);
-
-        build();
-    }
-     */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("unicode"))) unicode = sty.getStringValue();
+
+        if (getPres(sty.setName("unicode")))
+        {
+            unicode = sty.getStringValue();
+        }
     }
-    
-    public String getUnicode() { return unicode; }
-    
+
+    public String getUnicode()
+    {
+        return unicode;
+    }
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/Gradient.java
===================================================================
--- trunk/src/com/kitfox/svg/Gradient.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Gradient.java	(revision 6002)
@@ -1,37 +1,47 @@
 /*
- * Gradient.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 3:25 AM
  */
-
 package com.kitfox.svg;
 
-import java.net.*;
-import java.util.*;
-import java.awt.geom.*;
-import java.awt.*;
-
-import com.kitfox.svg.xml.*;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Color;
+import java.awt.geom.AffineTransform;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -41,32 +51,35 @@
 abstract public class Gradient extends FillElement
 {
-
+    public static final String TAG_NAME = "gradient";
+    
     public static final int SM_PAD = 0;
     public static final int SM_REPEAT = 1;
     public static final int SM_REFLECT = 2;
-
     int spreadMethod = SM_PAD;
-
     public static final int GU_OBJECT_BOUNDING_BOX = 0;
     public static final int GU_USER_SPACE_ON_USE = 1;
-
     protected int gradientUnits = GU_OBJECT_BOUNDING_BOX;
-
     //Either this gradient contains a list of stops, or it will take it's
     // stops from the referenced gradient
     ArrayList stops = new ArrayList();
     URI stopRef = null;
-//    Gradient stopRef = null;
-
     protected AffineTransform gradientTransform = null;
-
+    
     //Cache arrays of stop values here
     float[] stopFractions;
     Color[] stopColors;
 
-    /** Creates a new instance of Gradient */
-    public Gradient() {
-    }
-    
+    /**
+     * Creates a new instance of Gradient
+     */
+    public Gradient()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     /**
      * Called after the start element but before the end element to indicate
@@ -77,6 +90,9 @@
         super.loaderAddChild(helper, child);
 
-        if (!(child instanceof Stop)) return;
-        appendStop((Stop)child);
+        if (!(child instanceof Stop))
+        {
+            return;
+        }
+        appendStop((Stop) child);
     }
 
@@ -84,14 +100,21 @@
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
         String strn;
-        
+
         if (getPres(sty.setName("spreadMethod")))
         {
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("repeat")) spreadMethod = SM_REPEAT;
-            else if (strn.equals("reflect")) spreadMethod = SM_REFLECT;
-            else spreadMethod = SM_PAD;
+            if (strn.equals("repeat"))
+            {
+                spreadMethod = SM_REPEAT;
+            } else if (strn.equals("reflect"))
+            {
+                spreadMethod = SM_REFLECT;
+            } else
+            {
+                spreadMethod = SM_PAD;
+            }
         }
 
@@ -99,23 +122,34 @@
         {
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) gradientUnits = GU_USER_SPACE_ON_USE;
-            else gradientUnits = GU_OBJECT_BOUNDING_BOX;
-        }
-
-        if (getPres(sty.setName("gradientTransform"))) gradientTransform = parseTransform(sty.getStringValue());
+            if (strn.equals("userspaceonuse"))
+            {
+                gradientUnits = GU_USER_SPACE_ON_USE;
+            } else
+            {
+                gradientUnits = GU_OBJECT_BOUNDING_BOX;
+            }
+        }
+
+        if (getPres(sty.setName("gradientTransform")))
+        {
+            gradientTransform = parseTransform(sty.getStringValue());
+        }
         //If we still don't have one, set it to identity
-        if (gradientTransform == null) gradientTransform = new AffineTransform();
-
-        
+        if (gradientTransform == null)
+        {
+            gradientTransform = new AffineTransform();
+        }
+
+
         //Check to see if we're using our own stops or referencing someone else's
         if (getPres(sty.setName("xlink:href")))
         {
-            try {
+            try
+            {
                 stopRef = sty.getURIValue(getXMLBase());
 //System.err.println("Gradient: " + sty.getStringValue() + ", " + getXMLBase() + ", " + src);
 //                URI src = getXMLBase().resolve(href);
 //                stopRef = (Gradient)diagram.getUniverse().getElement(src);
-            }
-            catch (Exception e)
+            } catch (Exception e)
             {
                 throw new SVGException("Could not resolve relative URL in Gradient: " + sty.getStringValue() + ", " + getXMLBase(), e);
@@ -123,14 +157,17 @@
         }
     }
-    
+
     public float[] getStopFractions()
     {
         if (stopRef != null)
         {
-            Gradient grad = (Gradient)diagram.getUniverse().getElement(stopRef);
+            Gradient grad = (Gradient) diagram.getUniverse().getElement(stopRef);
             return grad.getStopFractions();
         }
 
-        if (stopFractions != null) return stopFractions;
+        if (stopFractions != null)
+        {
+            return stopFractions;
+        }
 
         stopFractions = new float[stops.size()];
@@ -138,7 +175,10 @@
         for (Iterator it = stops.iterator(); it.hasNext();)
         {
-            Stop stop = (Stop)it.next();
+            Stop stop = (Stop) it.next();
             float val = stop.offset;
-            if (idx != 0 && val < stopFractions[idx - 1]) val = stopFractions[idx - 1];
+            if (idx != 0 && val < stopFractions[idx - 1])
+            {
+                val = stopFractions[idx - 1];
+            }
             stopFractions[idx++] = val;
         }
@@ -151,9 +191,12 @@
         if (stopRef != null)
         {
-            Gradient grad = (Gradient)diagram.getUniverse().getElement(stopRef);
+            Gradient grad = (Gradient) diagram.getUniverse().getElement(stopRef);
             return grad.getStopColors();
         }
 
-        if (stopColors != null) return stopColors;
+        if (stopColors != null)
+        {
+            return stopColors;
+        }
 
         stopColors = new Color[stops.size()];
@@ -161,7 +204,7 @@
         for (Iterator it = stops.iterator(); it.hasNext();)
         {
-            Stop stop = (Stop)it.next();
+            Stop stop = (Stop) it.next();
             int stopColorVal = stop.color.getRGB();
-            Color stopColor = new Color((stopColorVal >> 16) & 0xff, (stopColorVal >> 8) & 0xff, stopColorVal & 0xff, clamp((int)(stop.opacity * 255), 0, 255));
+            Color stopColor = new Color((stopColorVal >> 16) & 0xff, (stopColorVal >> 8) & 0xff, stopColorVal & 0xff, clamp((int) (stop.opacity * 255), 0, 255));
             stopColors[idx++] = stopColor;
         }
@@ -169,5 +212,5 @@
         return stopColors;
     }
-    
+
     public void setStops(Color[] colors, float[] fractions)
     {
@@ -176,17 +219,23 @@
             throw new IllegalArgumentException();
         }
-        
+
         this.stopColors = colors;
         this.stopFractions = fractions;
         stopRef = null;
     }
-    
+
     private int clamp(int val, int min, int max)
     {
-        if (val < min) return min;
-        if (val > max) return max;
+        if (val < min)
+        {
+            return min;
+        }
+        if (val > max)
+        {
+            return max;
+        }
         return val;
     }
-    
+
     public void setStopRef(URI grad)
     {
@@ -200,6 +249,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -214,5 +264,5 @@
         boolean shapeChange = false;
         String strn;
-        
+
 
         if (getPres(sty.setName("spreadMethod")))
@@ -220,7 +270,14 @@
             int newVal;
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("repeat")) newVal = SM_REPEAT;
-            else if (strn.equals("reflect")) newVal = SM_REFLECT;
-            else newVal = SM_PAD;
+            if (strn.equals("repeat"))
+            {
+                newVal = SM_REPEAT;
+            } else if (strn.equals("reflect"))
+            {
+                newVal = SM_REFLECT;
+            } else
+            {
+                newVal = SM_PAD;
+            }
             if (spreadMethod != newVal)
             {
@@ -229,11 +286,16 @@
             }
         }
-        
+
         if (getPres(sty.setName("gradientUnits")))
         {
             int newVal;
             strn = sty.getStringValue().toLowerCase();
-            if (strn.equals("userspaceonuse")) newVal = GU_USER_SPACE_ON_USE;
-            else newVal = GU_OBJECT_BOUNDING_BOX;
+            if (strn.equals("userspaceonuse"))
+            {
+                newVal = GU_USER_SPACE_ON_USE;
+            } else
+            {
+                newVal = GU_OBJECT_BOUNDING_BOX;
+            }
             if (newVal != gradientUnits)
             {
@@ -253,9 +315,10 @@
         }
 
-        
+
         //Check to see if we're using our own stops or referencing someone else's
         if (getPres(sty.setName("xlink:href")))
         {
-            try {
+            try
+            {
                 URI newVal = sty.getURIValue(getXMLBase());
                 if ((newVal == null && stopRef != null) || !newVal.equals(stopRef))
@@ -264,15 +327,15 @@
                     stateChange = true;
                 }
-            }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-            }
-        }
-        
+            } catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                    "Could not parse xlink:href", e);
+            }
+        }
+
         //Check stops, if any
         for (Iterator it = stops.iterator(); it.hasNext();)
         {
-            Stop stop = (Stop)it.next();
+            Stop stop = (Stop) it.next();
             if (stop.updateTime(curTime))
             {
@@ -282,7 +345,6 @@
             }
         }
-        
+
         return stateChange;
     }
-
 }
Index: trunk/src/com/kitfox/svg/Group.java
===================================================================
--- trunk/src/com/kitfox/svg/Group.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Group.java	(revision 6002)
@@ -1,34 +1,41 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
 import java.awt.Graphics2D;
-import java.awt.Rectangle;
 import java.awt.Shape;
 import java.awt.geom.AffineTransform;
@@ -40,5 +47,4 @@
 import java.util.List;
 
-
 /**
  * @author Mark McKay
@@ -47,25 +53,21 @@
 public class Group extends ShapeElement
 {
-
+    public static final String TAG_NAME = "group";
+    
     //Cache bounding box for faster clip testing
     Rectangle2D boundingBox;
     Shape cachedShape;
 
-    //Cache clip bounds
-    final Rectangle clipBounds = new Rectangle();
-
-    /** Creates a new instance of Stop */
-    public Group() {
-    }
-
-    /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-        //Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        //String transform = attrs.getValue("transform");
-    }
-     */
+    /**
+     * Creates a new instance of Stop
+     */
+    public Group()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
 
     /**
@@ -76,20 +78,17 @@
     {
         super.loaderAddChild(helper, child);
-
-//        members.add(child);
     }
 
     protected boolean outsideClip(Graphics2D g) throws SVGException
     {
-        g.getClipBounds(clipBounds);
+        Shape clip = g.getClip();
+        if (clip == null)
+        {
+            return false;
+        }
+        //g.getClipBounds(clipBounds);
         Rectangle2D rect = getBoundingBox();
 
-//if (rect == null)
-//{
-//    rect = getBoundingBox();
-//}
-
-//        if (rect.intersects(clipBounds))
-        if (rect.intersects(clipBounds))
+        if (clip.intersects(rect))
         {
             return false;
@@ -107,19 +106,18 @@
             {
                 xform.inverseTransform(point, xPoint);
-            } 
-            catch (NoninvertibleTransformException ex)
+            } catch (NoninvertibleTransformException ex)
             {
                 throw new SVGException(ex);
             }
         }
-        
-        
+
+
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
-            if (ele instanceof RenderableElement)
-            {
-                RenderableElement rendEle = (RenderableElement)ele;
-                
+            SVGElement ele = (SVGElement) it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement) ele;
+
                 rendEle.pick(xPoint, boundingBox, retVec);
             }
@@ -134,13 +132,13 @@
             ltw.concatenate(xform);
         }
-        
-        
+
+
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
-            if (ele instanceof RenderableElement)
-            {
-                RenderableElement rendEle = (RenderableElement)ele;
-                
+            SVGElement ele = (SVGElement) it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement) ele;
+
                 rendEle.pick(pickArea, ltw, boundingBox, retVec);
             }
@@ -154,10 +152,16 @@
         if (getStyle(styleAttrib.setName("visibility")))
         {
-            if (!styleAttrib.getStringValue().equals("visible")) return;
-        }
-        
+            if (!styleAttrib.getStringValue().equals("visible"))
+            {
+                return;
+            }
+        }
+
         //Do not process offscreen groups
         boolean ignoreClip = diagram.ignoringClipHeuristic();
-        if (!ignoreClip && outsideClip(g)) return;
+        if (!ignoreClip && outsideClip(g))
+        {
+            return;
+        }
 
         beginLayer(g);
@@ -165,21 +169,22 @@
         Iterator it = children.iterator();
 
-        try
-        {
-            g.getClipBounds(clipBounds);
-        }
-        catch (Exception e)
-        {
-            //For some reason, getClipBounds can throw a null pointer exception for 
-            // some types of Graphics2D
-            ignoreClip = true;
-        }
-
+//        try
+//        {
+//            g.getClipBounds(clipBounds);
+//        }
+//        catch (Exception e)
+//        {
+//            //For some reason, getClipBounds can throw a null pointer exception for
+//            // some types of Graphics2D
+//            ignoreClip = true;
+//        }
+
+        Shape clip = g.getClip();
         while (it.hasNext())
         {
-            SVGElement ele = (SVGElement)it.next();
-            if (ele instanceof RenderableElement)
-            {
-                RenderableElement rendEle = (RenderableElement)ele;
+            SVGElement ele = (SVGElement) it.next();
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement) ele;
 
 //                if (shapeEle == null) continue;
@@ -188,5 +193,6 @@
                 {
                     //Skip if clipping area is outside our bounds
-                    if (!ignoreClip && !rendEle.getBoundingBox().intersects(clipBounds)) 
+                    if (!ignoreClip && clip != null
+                        && !clip.intersects(rendEle.getBoundingBox()))
                     {
                         continue;
@@ -201,5 +207,4 @@
     }
 
-
     /**
      * Retrieves the cached bounding box of this group
@@ -207,5 +212,8 @@
     public Shape getShape()
     {
-        if (cachedShape == null) calcShape();
+        if (cachedShape == null)
+        {
+            calcShape();
+        }
         return cachedShape;
     }
@@ -217,9 +225,9 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
 
             if (ele instanceof ShapeElement)
             {
-                ShapeElement shpEle = (ShapeElement)ele;
+                ShapeElement shpEle = (ShapeElement) ele;
                 Shape shape = shpEle.getShape();
                 if (shape != null)
@@ -238,5 +246,8 @@
     public Rectangle2D getBoundingBox() throws SVGException
     {
-        if (boundingBox == null) calcBoundingBox();
+        if (boundingBox == null)
+        {
+            calcBoundingBox();
+        }
 //        calcBoundingBox();
         return boundingBox;
@@ -245,5 +256,5 @@
     /**
      * Recalculates the bounding box by taking the union of the bounding boxes
-     * of all children.  Caches the result.
+     * of all children. Caches the result.
      */
     public void calcBoundingBox() throws SVGException
@@ -254,14 +265,19 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
-
-            if (ele instanceof RenderableElement)
-            {
-                RenderableElement rendEle = (RenderableElement)ele;
+            SVGElement ele = (SVGElement) it.next();
+
+            if (ele instanceof RenderableElement)
+            {
+                RenderableElement rendEle = (RenderableElement) ele;
                 Rectangle2D bounds = rendEle.getBoundingBox();
                 if (bounds != null)
                 {
-                    if (retRect == null) retRect = bounds;
-                    else retRect = retRect.createUnion(bounds);
+                    if (retRect == null)
+                    {
+                        retRect = bounds;
+                    } else
+                    {
+                        retRect = retRect.createUnion(bounds);
+                    }
                 }
             }
@@ -274,5 +290,8 @@
 
         //If no contents, use degenerate rectangle
-        if (retRect == null) retRect = new Rectangle2D.Float();
+        if (retRect == null)
+        {
+            retRect = new Rectangle2D.Float();
+        }
 
         boundingBox = boundsToParent(retRect);
@@ -287,5 +306,5 @@
         while (it.hasNext())
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             boolean updateVal = ele.updateTime(curTime);
 
@@ -293,6 +312,12 @@
 
             //Update our shape if shape aware children change
-            if (ele instanceof ShapeElement) cachedShape = null;
-            if (ele instanceof RenderableElement) boundingBox = null;
+            if (ele instanceof ShapeElement)
+            {
+                cachedShape = null;
+            }
+            if (ele instanceof RenderableElement)
+            {
+                boundingBox = null;
+            }
         }
 
Index: trunk/src/com/kitfox/svg/Hkern.java
===================================================================
--- trunk/src/com/kitfox/svg/Hkern.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Hkern.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Font.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
@@ -36,8 +44,14 @@
 public class Hkern extends SVGElement
 {
+
+    public static final String TAG_NAME = "hkern";
     String u1;
     String u2;
     int k;
 
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
 
     protected void build() throws SVGException
@@ -49,9 +63,18 @@
 
         //Read glyph spacing info
-        if (getPres(sty.setName("u1"))) u1 = sty.getStringValue();
+        if (getPres(sty.setName("u1")))
+        {
+            u1 = sty.getStringValue();
+        }
 
-        if (getPres(sty.setName("u2"))) u2 = sty.getStringValue();
+        if (getPres(sty.setName("u2")))
+        {
+            u2 = sty.getStringValue();
+        }
 
-        if (getPres(sty.setName("k"))) k = sty.getIntValue();
+        if (getPres(sty.setName("k")))
+        {
+            k = sty.getIntValue();
+        }
     }
 
@@ -61,5 +84,3 @@
         return false;
     }
-    
-    
 }
Index: trunk/src/com/kitfox/svg/ImageSVG.java
===================================================================
--- trunk/src/com/kitfox/svg/ImageSVG.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/ImageSVG.java	(revision 6002)
@@ -1,44 +1,56 @@
 /*
- * Font.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.app.data.Handler;
-import com.kitfox.svg.xml.*;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.image.*;
-import java.net.*;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.AlphaComposite;
+import java.awt.Composite;
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.net.URI;
+import java.net.URL;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
- * Implements an embedded font.
- *
- * SVG specification: http://www.w3.org/TR/SVG/fonts.html
+ * Implements an image.
  *
  * @author Mark McKay
@@ -47,35 +59,55 @@
 public class ImageSVG extends RenderableElement
 {
+    public static final String TAG_NAME = "image";
+    
     float x = 0f;
     float y = 0f;
     float width = 0f;
     float height = 0f;
-
 //    BufferedImage href = null;
     URL imageSrc = null;
-
     AffineTransform xform;
     Rectangle2D bounds;
 
-    /** Creates a new instance of Font */
+    /**
+     * Creates a new instance of Font
+     */
     public ImageSVG()
     {
     }
-    
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
-
-        try {
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getFloatValueWithUnits();
+        }
+
+        try
+        {
             if (getPres(sty.setName("xlink:href")))
             {
@@ -84,19 +116,19 @@
                 {
                     imageSrc = new URL(null, src.toASCIIString(), new Handler());
-                }
-                else
-                {
-                    try {
+                } else
+                {
+                    try
+                    {
                         imageSrc = src.toURL();
-                    }
-                    catch (Exception e)
+                    } catch (Exception e)
                     {
-                        e.printStackTrace();
+                        Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                            "Could not parse xlink:href", e);
+//                        e.printStackTrace();
                         imageSrc = null;
                     }
                 }
             }
-        }
-        catch (Exception e)
+        } catch (Exception e)
         {
             throw new SVGException(e);
@@ -104,5 +136,5 @@
 
         diagram.getUniverse().registerImage(imageSrc);
-        
+
         //Set widths if not set
         BufferedImage img = diagram.getUniverse().getImage(imageSrc);
@@ -113,8 +145,14 @@
             return;
         }
-        
-        if (width == 0) width = img.getWidth();
-        if (height == 0) height = img.getHeight();
-        
+
+        if (width == 0)
+        {
+            width = img.getWidth();
+        }
+        if (height == 0)
+        {
+            height = img.getHeight();
+        }
+
         //Determine image xform
         xform = new AffineTransform();
@@ -123,14 +161,27 @@
         xform.translate(this.x, this.y);
         xform.scale(this.width / img.getWidth(), this.height / img.getHeight());
-        
+
         bounds = new Rectangle2D.Float(this.x, this.y, this.width, this.height);
     }
-    
-    
-    
-    public float getX() { return x; }
-    public float getY() { return y; }
-    public float getWidth() { return width; }
-    public float getHeight() { return height; }
+
+    public float getX()
+    {
+        return x;
+    }
+
+    public float getY()
+    {
+        return y;
+    }
+
+    public float getWidth()
+    {
+        return width;
+    }
+
+    public float getHeight()
+    {
+        return height;
+    }
 
     void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException
@@ -155,9 +206,12 @@
         if (getStyle(styleAttrib.setName("visibility")))
         {
-            if (!styleAttrib.getStringValue().equals("visible")) return;
-        }
-        
+            if (!styleAttrib.getStringValue().equals("visible"))
+            {
+                return;
+            }
+        }
+
         beginLayer(g);
-        
+
         float opacity = 1f;
         if (getStyle(styleAttrib.setName("opacity")))
@@ -165,9 +219,12 @@
             opacity = styleAttrib.getRatioValue();
         }
-        
-        if (opacity <= 0) return;
+
+        if (opacity <= 0)
+        {
+            return;
+        }
 
         Composite oldComp = null;
-        
+
         if (opacity < 1)
         {
@@ -176,19 +233,25 @@
             g.setComposite(comp);
         }
-        
+
         BufferedImage img = diagram.getUniverse().getImage(imageSrc);
-        if (img == null) return;
-        
+        if (img == null)
+        {
+            return;
+        }
+
         AffineTransform curXform = g.getTransform();
         g.transform(xform);
-        
+
         g.drawImage(img, 0, 0, null);
-        
+
         g.setTransform(curXform);
-        if (oldComp != null) g.setComposite(oldComp);
-        
+        if (oldComp != null)
+        {
+            g.setComposite(oldComp);
+        }
+
         finishLayer(g);
     }
-    
+
     public Rectangle2D getBoundingBox()
     {
@@ -197,6 +260,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -210,5 +274,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -220,5 +284,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -230,5 +294,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("width")))
         {
@@ -240,5 +304,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("height")))
         {
@@ -250,11 +314,20 @@
             }
         }
-        
-        try {
+
+        try
+        {
             if (getPres(sty.setName("xlink:href")))
             {
                 URI src = sty.getURIValue(getXMLBase());
-                URL newVal = src.toURL();
-                
+
+                URL newVal;
+                if ("data".equals(src.getScheme()))
+                {
+                    newVal = new URL(null, src.toASCIIString(), new Handler());
+                } else
+                {
+                    newVal = src.toURL();
+                }
+
                 if (!newVal.equals(imageSrc))
                 {
@@ -263,15 +336,16 @@
                 }
             }
-        }
-        catch (IllegalArgumentException ie)
-        {
-            new Exception("Image provided with illegal value for href: \"" + sty.getStringValue() + '"', ie).printStackTrace();
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-
-        
+        } catch (IllegalArgumentException ie)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Image provided with illegal value for href: \""
+                + sty.getStringValue() + '"', ie);
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse xlink:href", e);
+        }
+
+
         if (shapeChange)
         {
@@ -303,5 +377,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/Line.java
===================================================================
--- trunk/src/com/kitfox/svg/Line.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Line.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
@@ -38,54 +46,54 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Line extends ShapeElement {
-
+public class Line extends ShapeElement
+{
+    public static final String TAG_NAME = "line";
+    
     float x1 = 0f;
     float y1 = 0f;
     float x2 = 0f;
     float y2 = 0f;
+    Line2D.Float line;
 
-    Line2D.Float line;
-//    RectangularShape rect;
-
-    /** Creates a new instance of Rect */
-    public Line() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Line()
+    {
     }
 
-    /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        String x1 = attrs.getValue("x1");
-        String y1 = attrs.getValue("y1");
-        String x2 = attrs.getValue("x2");
-        String y2 = attrs.getValue("y2");
-
-        this.x1 = XMLParseUtil.parseFloat(x1);
-        this.y1 = XMLParseUtil.parseFloat(y1);
-        this.x2 = XMLParseUtil.parseFloat(x2);
-        this.y2 = XMLParseUtil.parseFloat(y2);
-
-        build();
-    }
-*/
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x1"))) x1 = sty.getFloatValueWithUnits();
 
-        if (getPres(sty.setName("y1"))) y1 = sty.getFloatValueWithUnits();
+        if (getPres(sty.setName("x1")))
+        {
+            x1 = sty.getFloatValueWithUnits();
+        }
 
-        if (getPres(sty.setName("x2"))) x2 = sty.getFloatValueWithUnits();
+        if (getPres(sty.setName("y1")))
+        {
+            y1 = sty.getFloatValueWithUnits();
+        }
 
-        if (getPres(sty.setName("y2"))) y2 = sty.getFloatValueWithUnits();
+        if (getPres(sty.setName("x2")))
+        {
+            x2 = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y2")))
+        {
+            y2 = sty.getFloatValueWithUnits();
+        }
 
         line = new Line2D.Float(x1, y1, x2, y2);
     }
-    
 
     public void render(Graphics2D g) throws SVGException
@@ -107,6 +115,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -120,5 +129,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("x1")))
         {
@@ -164,8 +173,6 @@
         {
             build();
-//            line = new Line2D.Float(x1, y1, x2, y2);
-//            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/LinearGradient.java
===================================================================
--- trunk/src/com/kitfox/svg/LinearGradient.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/LinearGradient.java	(revision 6002)
@@ -1,41 +1,45 @@
 /*
- * LinearGradient.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:54 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.geom.*;
-import java.awt.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-//import org.apache.batik.ext.awt.*;
-import com.kitfox.svg.batik.*;
-
+import java.awt.Color;
+import java.awt.Paint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -43,6 +47,8 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class LinearGradient extends Gradient {
-
+public class LinearGradient extends Gradient
+{
+    public static final String TAG_NAME = "lineargradient";
+    
     float x1 = 0f;
     float y1 = 0f;
@@ -50,48 +56,43 @@
     float y2 = 0f;
 
-    /** Creates a new instance of LinearGradient */
-    public LinearGradient() {
-    }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String x1 = attrs.getValue("x1");
-        String x2 = attrs.getValue("x2");
-        String y1 = attrs.getValue("y1");
-        String y2 = attrs.getValue("y2");
-
-        if (x1 != null) this.x1 = (float)XMLParseUtil.parseRatio(x1);
-        if (y1 != null) this.y1 = (float)XMLParseUtil.parseRatio(y1);
-        if (x2 != null) this.x2 = (float)XMLParseUtil.parseRatio(x2);
-        if (y2 != null) this.y2 = (float)XMLParseUtil.parseRatio(y2);
-    }
-*/
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        super.loaderEndElement(helper);
-        
-        build();
-    }
-    */
-    
+    /**
+     * Creates a new instance of LinearGradient
+     */
+    public LinearGradient()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x1"))) x1 = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y1"))) y1 = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("x2"))) x2 = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y2"))) y2 = sty.getFloatValueWithUnits();
-    }
-    
+
+        if (getPres(sty.setName("x1")))
+        {
+            x1 = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y1")))
+        {
+            y1 = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("x2")))
+        {
+            x2 = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y2")))
+        {
+            y2 = sty.getFloatValueWithUnits();
+        }
+    }
+
     public Paint getPaint(Rectangle2D bounds, AffineTransform xform)
     {
@@ -111,34 +112,41 @@
         }
 
-        com.kitfox.svg.batik.LinearGradientPaint paint;
-        if (gradientUnits == GU_USER_SPACE_ON_USE)
-        {
-//            paint = new LinearGradientPaint(x1, y1, x2, y2, getStopFractions(), getStopColors(), method);
+        Paint paint;
+        Point2D.Float pt1 = new Point2D.Float(x1, y1);
+        Point2D.Float pt2 = new Point2D.Float(x2, y2);
+        if (pt1.equals(pt2))
+        {
+            Color[] colors = getStopColors();
+            paint = colors.length > 0 ? colors[0] : Color.black;
+        } else if (gradientUnits == GU_USER_SPACE_ON_USE)
+        {
             paint = new com.kitfox.svg.batik.LinearGradientPaint(
-                new Point2D.Float(x1, y1),
-                new Point2D.Float(x2, y2),
+                pt1,
+                pt2,
                 getStopFractions(),
                 getStopColors(),
                 method,
                 com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
-                gradientTransform);
-        }
-        else
+                gradientTransform == null
+                ? new AffineTransform()
+                : gradientTransform);
+        } else
         {
             AffineTransform viewXform = new AffineTransform();
             viewXform.translate(bounds.getX(), bounds.getY());
-            
+
             //This is a hack to get around shapes that have a width or height of 0.  Should be close enough to the true answer.
-            double width = bounds.getWidth();
-            double height = bounds.getHeight();
-            if (width == 0) width = 1;
-            if (height == 0) height = 1;
+            double width = Math.max(1, bounds.getWidth());
+            double height = Math.max(1, bounds.getHeight());
             viewXform.scale(width, height);
 
-            viewXform.concatenate(gradientTransform);
+            if (gradientTransform != null)
+            {
+                viewXform.concatenate(gradientTransform);
+            }
 
             paint = new com.kitfox.svg.batik.LinearGradientPaint(
-                new Point2D.Float(x1, y1),
-                new Point2D.Float(x2, y2),
+                pt1,
+                pt2,
                 getStopFractions(),
                 getStopColors(),
@@ -150,8 +158,9 @@
         return paint;
     }
-    
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -165,5 +174,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("x1")))
         {
Index: trunk/src/com/kitfox/svg/Marker.java
===================================================================
--- trunk/src/com/kitfox/svg/Marker.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Marker.java	(revision 6002)
@@ -1,7 +1,35 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  */
-
 package com.kitfox.svg;
 
@@ -21,8 +49,9 @@
 public class Marker extends Group
 {
+    public static final String TAG_NAME = "marker";
+    
     AffineTransform viewXform;
     AffineTransform markerXform;
     Rectangle2D viewBox;
-
     float refX;
     float refY;
@@ -30,4 +59,10 @@
     float markerHeight = 3;
     float orient = Float.NaN;
+    boolean markerUnitsStrokeWidth = true; //if set to false 'userSpaceOnUse' is assumed
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
 
     protected void build() throws SVGException
@@ -37,8 +72,20 @@
         StyleAttribute sty = new StyleAttribute();
 
-        if (getPres(sty.setName("refX"))) refX = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("refY"))) refY = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("markerWidth"))) markerWidth = sty.getFloatValueWithUnits();
-        if (getPres(sty.setName("markerHeight"))) markerHeight = sty.getFloatValueWithUnits();
+        if (getPres(sty.setName("refX")))
+        {
+            refX = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("refY")))
+        {
+            refY = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("markerWidth")))
+        {
+            markerWidth = sty.getFloatValueWithUnits();
+        }
+        if (getPres(sty.setName("markerHeight")))
+        {
+            markerHeight = sty.getFloatValueWithUnits();
+        }
 
         if (getPres(sty.setName("orient")))
@@ -47,6 +94,5 @@
             {
                 orient = Float.NaN;
-            }
-            else
+            } else
             {
                 orient = sty.getFloatValue();
@@ -63,4 +109,13 @@
         {
             viewBox = new Rectangle(0, 0, 1, 1);
+        }
+
+        if (getPres(sty.setName("markerUnits")))
+        {
+            String markerUnits = sty.getStringValue();
+            if (markerUnits != null && markerUnits.equals("userSpaceOnUse"))
+            {
+                markerUnitsStrokeWidth = false;
+            }
         }
 
@@ -78,7 +133,7 @@
     protected boolean outsideClip(Graphics2D g) throws SVGException
     {
-        g.getClipBounds(clipBounds);
+        Shape clip = g.getClip();
         Rectangle2D rect = super.getBoundingBox();
-        if (rect.intersects(clipBounds))
+        if (clip == null || clip.intersects(rect))
         {
             return false;
@@ -104,5 +159,9 @@
 
         g.translate(pos.x, pos.y);
-        g.scale(strokeWidth, strokeWidth);
+        if (markerUnitsStrokeWidth)
+        {
+            g.scale(strokeWidth, strokeWidth);
+        }
+
         g.rotate(Math.atan2(pos.dy, pos.dx));
 
@@ -127,6 +186,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -139,5 +199,5 @@
         return changeState;
     }
-
+    
     //--------------------------------
     public static final int MARKER_START = 0;
@@ -147,4 +207,5 @@
     public static class MarkerPos
     {
+
         int type;
         double x;
@@ -165,4 +226,5 @@
     public static class MarkerLayout
     {
+
         private ArrayList markerList = new ArrayList();
         boolean started = false;
@@ -174,5 +236,5 @@
             double[] coords = new double[6];
             for (PathIterator it = shape.getPathIterator(null);
-                    !it.isDone(); it.next())
+                !it.isDone(); it.next())
             {
                 switch (it.currentSegment(coords))
@@ -202,4 +264,24 @@
                         double x = coords[2];
                         double y = coords[3];
+
+
+                        //Best in tangent
+                        if (px != k0x || py != k0y)
+                        {
+                            markerIn(px, py, k0x - px, k0y - py);
+                        } else
+                        {
+                            markerIn(px, py, x - px, y - py);
+                        }
+
+                        //Best out tangent
+                        if (x != k0x || y != k0y)
+                        {
+                            markerOut(x, y, x - k0x, y - k0y);
+                        } else
+                        {
+                            markerOut(x, y, x - px, y - py);
+                        }
+
                         markerIn(px, py, k0x - px, k0y - py);
                         markerOut(x, y, x - k0x, y - k0y);
@@ -216,6 +298,28 @@
                         double x = coords[4];
                         double y = coords[5];
-                        markerIn(px, py, k0x - px, k0y - py);
-                        markerOut(x, y, x - k1x, y - k1y);
+
+                        //Best in tangent
+                        if (px != k0x || py != k0y)
+                        {
+                            markerIn(px, py, k0x - px, k0y - py);
+                        } else if (px != k1x || py != k1y)
+                        {
+                            markerIn(px, py, k1x - px, k1y - py);
+                        } else
+                        {
+                            markerIn(px, py, x - px, y - py);
+                        }
+
+                        //Best out tangent
+                        if (x != k1x || y != k1y)
+                        {
+                            markerOut(x, y, x - k1x, y - k1y);
+                        } else if (x != k0x || y != k0y)
+                        {
+                            markerOut(x, y, x - k0x, y - k0y);
+                        } else
+                        {
+                            markerOut(x, y, x - px, y - py);
+                        }
                         px = x;
                         py = y;
@@ -227,6 +331,6 @@
             for (int i = 1; i < markerList.size(); ++i)
             {
-                MarkerPos prev = (MarkerPos)markerList.get(i - 1);
-                MarkerPos cur = (MarkerPos)markerList.get(i);
+                MarkerPos prev = (MarkerPos) markerList.get(i - 1);
+                MarkerPos cur = (MarkerPos) markerList.get(i);
 
                 if (cur.type == MARKER_START)
@@ -235,5 +339,5 @@
                 }
             }
-            MarkerPos last = (MarkerPos)markerList.get(markerList.size() - 1);
+            MarkerPos last = (MarkerPos) markerList.get(markerList.size() - 1);
             last.type = MARKER_END;
         }
Index: trunk/src/com/kitfox/svg/Metadata.java
===================================================================
--- trunk/src/com/kitfox/svg/Metadata.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Metadata.java	(revision 6002)
@@ -1,41 +1,59 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 19, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 /**
- * Does not hold any information.  Included to allow metadata tag to be parsed.
+ * Does not hold any information. Included to allow metadata tag to be parsed.
  *
  * @author Mark McKay
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Metadata extends SVGElement 
+public class Metadata extends SVGElement
 {
-    /** Creates a new instance of Stop */
-    public Metadata() {
+    public static final String TAG_NAME = "metadata";
+
+    /**
+     * Creates a new instance of Stop
+     */
+    public Metadata()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
Index: trunk/src/com/kitfox/svg/MissingGlyph.java
===================================================================
--- trunk/src/com/kitfox/svg/MissingGlyph.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/MissingGlyph.java	(revision 6002)
@@ -1,39 +1,48 @@
 /*
- * Font.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 10:00 PM
  */
-
 package com.kitfox.svg;
 
-import com.kitfox.svg.xml.*;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.util.*;
-
-import com.kitfox.svg.pathcmd.*;
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import com.kitfox.svg.pathcmd.BuildHistory;
+import com.kitfox.svg.pathcmd.PathCommand;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
+import java.util.Iterator;
 
 /**
@@ -47,10 +56,9 @@
 public class MissingGlyph extends ShapeElement
 {
+    public static final String TAG_NAME = "missingglyph";
+    
     //We may define a path
-//    ExtendedGeneralPath path = null;
     Shape path = null;
-
     //Alternately, we may have child graphical elements
-
     int horizAdvX = -1;  //Inherits font's value if not set
     int vertOriginX = -1;  //Inherits font's value if not set
@@ -58,24 +66,45 @@
     int vertAdvY = -1;  //Inherits font's value if not set
 
-    /** Creates a new instance of Font */
+    /**
+     * Creates a new instance of Font
+     */
     public MissingGlyph()
     {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
+    /**
+     * Called after the start element but before the end element to indicate
+     * each child tag that has been processed
+     */
+    public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
+    {
+        super.loaderAddChild(helper, child);
+    }
+
+    protected void build() throws SVGException
+    {
+        super.build();
+
+        StyleAttribute sty = new StyleAttribute();
+
+        String commandList = "";
+        if (getPres(sty.setName("d")))
+        {
+            commandList = sty.getStringValue();
+        }
+
 
         //If glyph path was specified, calculate it
-        String commandList = attrs.getValue("d");
         if (commandList != null)
         {
-            StyleAttribute atyleAttrib = getStyle("fill-rule");
-            String fillRule = (atyleAttrib == null) ? "nonzero" : atyleAttrib.getStringValue();
+            String fillRule = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
 
             PathCommand[] commands = parsePathList(commandList);
 
-//            ExtendedGeneralPath buildPath = new ExtendedGeneralPath(
             GeneralPath buildPath = new GeneralPath(
                 fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO,
@@ -98,72 +127,23 @@
 
         //Read glyph spacing info
-        String horizAdvX = attrs.getValue("horiz-adv-x");
-        String vertOriginX = attrs.getValue("vert-origin-x");
-        String vertOriginY = attrs.getValue("vert-origin-y");
-        String vertAdvY = attrs.getValue("vert-adv-y");
-
-        if (horizAdvX != null) this.horizAdvX = XMLParseUtil.parseInt(horizAdvX);
-        if (vertOriginX != null) this.vertOriginX = XMLParseUtil.parseInt(vertOriginX);
-        if (vertOriginY != null) this.vertOriginY = XMLParseUtil.parseInt(vertOriginY);
-        if (vertAdvY != null) this.vertAdvY = XMLParseUtil.parseInt(vertAdvY);
-
-    }
-*/
-    /**
-     * Called after the start element but before the end element to indicate
-     * each child tag that has been processed
-     */
-    public void loaderAddChild(SVGLoaderHelper helper, SVGElement child) throws SVGElementException
-    {
-        super.loaderAddChild(helper, child);
-    }
-
-    
-    protected void build() throws SVGException
-    {
-        super.build();
-        
-        StyleAttribute sty = new StyleAttribute();
-        
-        String commandList = "";
-        if (getPres(sty.setName("d"))) commandList = sty.getStringValue();
-
-    
-        //If glyph path was specified, calculate it
-        if (commandList != null)
-        {
-//            StyleAttribute atyleAttrib = getStyle("fill-rule");
-            String fillRule = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
-
-            PathCommand[] commands = parsePathList(commandList);
-
-//            ExtendedGeneralPath buildPath = new ExtendedGeneralPath(
-            GeneralPath buildPath = new GeneralPath(
-                fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO,
-                commands.length);
-
-            BuildHistory hist = new BuildHistory();
-
-            for (int i = 0; i < commands.length; i++)
-            {
-                PathCommand cmd = commands[i];
-                cmd.appendPath(buildPath, hist);
-            }
-
-            //Reflect glyph path to put it in user coordinate system
-            AffineTransform at = new AffineTransform();
-            at.scale(1, -1);
-            path = at.createTransformedShape(buildPath);
-        }
-
-
-        //Read glyph spacing info
-        if (getPres(sty.setName("horiz-adv-x"))) horizAdvX = sty.getIntValue();
-
-        if (getPres(sty.setName("vert-origin-x"))) vertOriginX = sty.getIntValue();
-
-        if (getPres(sty.setName("vert-origin-y"))) vertOriginY = sty.getIntValue();
-
-        if (getPres(sty.setName("vert-adv-y"))) vertAdvY = sty.getIntValue();
+        if (getPres(sty.setName("horiz-adv-x")))
+        {
+            horizAdvX = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-origin-x")))
+        {
+            vertOriginX = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-origin-y")))
+        {
+            vertOriginY = sty.getIntValue();
+        }
+
+        if (getPres(sty.setName("vert-adv-y")))
+        {
+            vertAdvY = sty.getIntValue();
+        }
     }
 
@@ -177,13 +157,16 @@
         //Do not push or pop stack
 
-        if (path != null) renderShape(g, path);
-        
+        if (path != null)
+        {
+            renderShape(g, path);
+        }
+
         Iterator it = children.iterator();
         while (it.hasNext())
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             if (ele instanceof RenderableElement)
             {
-                ((RenderableElement)ele).render(g);
+                ((RenderableElement) ele).render(g);
             }
         }
@@ -195,5 +178,7 @@
     {
         if (horizAdvX == -1)
-            horizAdvX = ((Font)parent).getHorizAdvX();
+        {
+            horizAdvX = ((Font) parent).getHorizAdvX();
+        }
         return horizAdvX;
     }
@@ -202,5 +187,7 @@
     {
         if (vertOriginX == -1)
+        {
             vertOriginX = getHorizAdvX() / 2;
+        }
         return vertOriginX;
     }
@@ -209,5 +196,7 @@
     {
         if (vertOriginY == -1)
-            vertOriginY = ((Font)parent).getFontFace().getAscent();
+        {
+            vertOriginY = ((Font) parent).getFontFace().getAscent();
+        }
         return vertOriginY;
     }
@@ -216,5 +205,7 @@
     {
         if (vertAdvY == -1)
-            vertAdvY = ((Font)parent).getFontFace().getUnitsPerEm();
+        {
+            vertAdvY = ((Font) parent).getFontFace().getUnitsPerEm();
+        }
         return vertAdvY;
 
@@ -223,5 +214,8 @@
     public Shape getShape()
     {
-        if (path != null) return shapeToParent(path);
+        if (path != null)
+        {
+            return shapeToParent(path);
+        }
         return null;
     }
@@ -229,11 +223,15 @@
     public Rectangle2D getBoundingBox() throws SVGException
     {
-        if (path != null) return boundsToParent(includeStrokeInBounds(path.getBounds2D()));
+        if (path != null)
+        {
+            return boundsToParent(includeStrokeInBounds(path.getBounds2D()));
+        }
         return null;
     }
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/Path.java
===================================================================
--- trunk/src/com/kitfox/svg/Path.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Path.java	(revision 6002)
@@ -1,49 +1,55 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.geom.*;
-
-import com.kitfox.svg.pathcmd.*;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
 
 //import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
-
 /**
  * @author Mark McKay
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Path extends ShapeElement {
+public class Path extends ShapeElement
+{
 
+    public static final String TAG_NAME = "path";
 //    PathCommand[] commands = null;
-
     int fillRule = GeneralPath.WIND_NON_ZERO;
     String d = "";
@@ -51,42 +57,34 @@
     GeneralPath path;
 
-    /** Creates a new instance of Rect */
-    public Path() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Path()
+    {
     }
 
-    /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        StyleAttribute styleAttrib = getStyle("fill-rule");
-        String fillRule = (styleAttrib == null) ? "nonzero" : styleAttrib.getStringValue();
-        
-        String d = attrs.getValue("d");
-        path = buildPath(d, fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO);
-    }
-    */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-    
-        String fillRuleStrn  = (getStyle(sty.setName("fill-rule"))) ? sty.getStringValue() : "nonzero";
+
+
+        String fillRuleStrn = (getStyle(sty.setName("fill-rule"))) ? sty.getStringValue() : "nonzero";
         fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
-        
-//        String d = "";
-        if (getPres(sty.setName("d"))) d = sty.getStringValue();
 
-//System.err.println(d);
-        
+        if (getPres(sty.setName("d")))
+        {
+            d = sty.getStringValue();
+        }
+
         path = buildPath(d, fillRule);
-        
-//System.err.println(d);
     }
-    
+
     public void render(Graphics2D g) throws SVGException
     {
@@ -107,6 +105,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -120,9 +119,9 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getStyle(sty.setName("fill-rule")))
         {
-            int newVal = sty.getStringValue().equals("evenodd") 
-                ? GeneralPath.WIND_EVEN_ODD 
+            int newVal = sty.getStringValue().equals("evenodd")
+                ? GeneralPath.WIND_EVEN_ODD
                 : GeneralPath.WIND_NON_ZERO;
             if (newVal != fillRule)
@@ -132,5 +131,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("d")))
         {
@@ -142,5 +141,5 @@
             }
         }
-        
+
         if (shapeChange)
         {
@@ -149,5 +148,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/PatternSVG.java
===================================================================
--- trunk/src/com/kitfox/svg/PatternSVG.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/PatternSVG.java	(revision 6002)
@@ -1,41 +1,53 @@
 /*
- * Gradient.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 3:25 AM
  */
-
 package com.kitfox.svg;
 
+import com.kitfox.svg.pattern.PatternPaint;
 import com.kitfox.svg.xml.StyleAttribute;
-import java.net.*;
-import java.util.*;
-import java.awt.geom.*;
-import java.awt.*;
-import java.awt.image.*;
-
-import com.kitfox.svg.pattern.*;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+import java.awt.RenderingHints;
+import java.awt.TexturePaint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -43,89 +55,31 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class PatternSVG extends FillElement {
-
+public class PatternSVG extends FillElement
+{
+    public static final String TAG_NAME = "pattern";
+    
     public static final int GU_OBJECT_BOUNDING_BOX = 0;
     public static final int GU_USER_SPACE_ON_USE = 1;
-
     int gradientUnits = GU_OBJECT_BOUNDING_BOX;
-
     float x;
     float y;
     float width;
     float height;
-
     AffineTransform patternXform = new AffineTransform();
     Rectangle2D.Float viewBox;
-
     Paint texPaint;
 
-    /** Creates a new instance of Gradient */
-    public PatternSVG() {
-    }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String href = attrs.getValue("xlink:href");
-        //If we have a link to another pattern, initialize ourselves with it's values
-        if (href != null)
-        {
-//System.err.println("Gradient.loaderStartElement() href '" + href + "'");
-            try {
-                URI src = getXMLBase().resolve(href);
-//                URL url = srcUrl.toURL();
-//                URL url = new URL(helper.docRoot, href);
-                PatternSVG patSrc = (PatternSVG)helper.universe.getElement(src);
-
-                gradientUnits = patSrc.gradientUnits;
-                x = patSrc.x;
-                y = patSrc.y;
-                width = patSrc.width;
-                height = patSrc.height;
-                viewBox = patSrc.viewBox;
-                patternXform.setTransform(patSrc.patternXform);
-                members.addAll(patSrc.members);
-            }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-            }
-        }
-
-
-        String gradientUnits = attrs.getValue("gradientUnits");
-
-        if (gradientUnits != null)
-        {
-            if (gradientUnits.toLowerCase().equals("userspaceonuse")) this.gradientUnits = GU_USER_SPACE_ON_USE;
-            else this.gradientUnits = GU_OBJECT_BOUNDING_BOX;
-        }
-
-        String patternTransform = attrs.getValue("patternTransform");
-        if (patternTransform != null)
-        {
-            patternXform = parseTransform(patternTransform);
-        }
-
-        String x = attrs.getValue("x");
-        String y = attrs.getValue("y");
-        String width = attrs.getValue("width");
-        String height = attrs.getValue("height");
-
-        if (x != null) this.x = XMLParseUtil.parseFloat(x);
-        if (y != null) this.y = XMLParseUtil.parseFloat(y);
-        if (width != null) this.width = XMLParseUtil.parseFloat(width);
-        if (height != null) this.height = XMLParseUtil.parseFloat(height);
-
-        String viewBoxStrn = attrs.getValue("viewBox");
-        if (viewBoxStrn != null)
-        {
-            float[] dim = XMLParseUtil.parseFloatList(viewBoxStrn);
-            viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
-        }
-    }
-  */  
+    /**
+     * Creates a new instance of Gradient
+     */
+    public PatternSVG()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     /**
      * Called after the start element but before the end element to indicate
@@ -135,17 +89,18 @@
     {
         super.loaderAddChild(helper, child);
-
-//        members.add(child);
-    }
-    
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-		//Load style string
+
+        //Load style string
         String href = null;
-        if (getPres(sty.setName("xlink:href"))) href = sty.getStringValue();
+        if (getPres(sty.setName("xlink:href")))
+        {
+            href = sty.getStringValue();
+        }
         //String href = attrs.getValue("xlink:href");
         //If we have a link to another pattern, initialize ourselves with it's values
@@ -153,7 +108,8 @@
         {
 //System.err.println("Gradient.loaderStartElement() href '" + href + "'");
-            try {
+            try
+            {
                 URI src = getXMLBase().resolve(href);
-                PatternSVG patSrc = (PatternSVG)diagram.getUniverse().getElement(src);
+                PatternSVG patSrc = (PatternSVG) diagram.getUniverse().getElement(src);
 
                 gradientUnits = patSrc.gradientUnits;
@@ -165,29 +121,52 @@
                 patternXform.setTransform(patSrc.patternXform);
                 children.addAll(patSrc.children);
+            } catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                    "Could not parse xlink:href", e);
             }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-            }
         }
 
         String gradientUnits = "";
-        if (getPres(sty.setName("gradientUnits"))) gradientUnits = sty.getStringValue().toLowerCase();
-        if (gradientUnits.equals("userspaceonuse")) this.gradientUnits = GU_USER_SPACE_ON_USE;
-        else this.gradientUnits = GU_OBJECT_BOUNDING_BOX;
+        if (getPres(sty.setName("gradientUnits")))
+        {
+            gradientUnits = sty.getStringValue().toLowerCase();
+        }
+        if (gradientUnits.equals("userspaceonuse"))
+        {
+            this.gradientUnits = GU_USER_SPACE_ON_USE;
+        } else
+        {
+            this.gradientUnits = GU_OBJECT_BOUNDING_BOX;
+        }
 
         String patternTransform = "";
-        if (getPres(sty.setName("patternTransform"))) patternTransform = sty.getStringValue();
+        if (getPres(sty.setName("patternTransform")))
+        {
+            patternTransform = sty.getStringValue();
+        }
         patternXform = parseTransform(patternTransform);
 
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
-        
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getFloatValueWithUnits();
+        }
+
         if (getPres(sty.setName("viewBox")))
         {
@@ -195,21 +174,20 @@
             viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
         }
-            
+
         preparePattern();
     }
-    
-/*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        build();
-    }
-    */
-
+
+    /*
+     public void loaderEndElement(SVGLoaderHelper helper)
+     {
+     build();
+     }
+     */
     protected void preparePattern() throws SVGException
     {
         //For now, treat all fills as UserSpaceOnUse.  Otherwise, we'll need
         // a different paint for every object.
-        int tileWidth = (int)width;
-        int tileHeight = (int)height;
+        int tileWidth = (int) width;
+        int tileHeight = (int) height;
 
         float stretchX = 1f, stretchY = 1f;
@@ -217,6 +195,6 @@
         {
             //Scale our source tile so that we can have nice sampling from it.
-            float xlateX = (float)patternXform.getTranslateX();
-            float xlateY = (float)patternXform.getTranslateY();
+            float xlateX = (float) patternXform.getTranslateX();
+            float xlateY = (float) patternXform.getTranslateY();
 
             Point2D.Float pt = new Point2D.Float(), pt2 = new Point2D.Float();
@@ -226,5 +204,5 @@
             pt2.x -= xlateX;
             pt2.y -= xlateY;
-            stretchX = (float)Math.sqrt(pt2.x * pt2.x + pt2.y * pt2.y) * 1.5f / width;
+            stretchX = (float) Math.sqrt(pt2.x * pt2.x + pt2.y * pt2.y) * 1.5f / width;
 
             pt.setLocation(height, 0);
@@ -232,5 +210,5 @@
             pt2.x -= xlateX;
             pt2.y -= xlateY;
-            stretchY = (float)Math.sqrt(pt2.x * pt2.x + pt2.y * pt2.y) * 1.5f / height;
+            stretchY = (float) Math.sqrt(pt2.x * pt2.x + pt2.y * pt2.y) * 1.5f / height;
 
             tileWidth *= stretchX;
@@ -238,10 +216,10 @@
         }
 
-        if (tileWidth == 0 || tileHeight == 0) 
+        if (tileWidth == 0 || tileHeight == 0)
         {
             //Use defaults if tile has degenerate size
             return;
         }
-        
+
         BufferedImage buf = new BufferedImage(tileWidth, tileHeight, BufferedImage.TYPE_INT_ARGB);
         Graphics2D g = buf.createGraphics();
@@ -251,5 +229,5 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             if (ele instanceof RenderableElement)
             {
@@ -259,6 +237,5 @@
                 {
                     xform.translate(-x, -y);
-                }
-                else
+                } else
                 {
                     xform.scale(tileWidth / viewBox.width, tileHeight / viewBox.height);
@@ -267,5 +244,5 @@
 
                 g.setTransform(xform);
-                ((RenderableElement)ele).render(g);
+                ((RenderableElement) ele).render(g);
             }
         }
@@ -280,6 +257,5 @@
         {
             texPaint = new TexturePaint(buf, new Rectangle2D.Float(x, y, width, height));
-        }
-        else
+        } else
         {
             patternXform.scale(1 / stretchX, 1 / stretchY);
@@ -294,6 +270,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/Polygon.java
===================================================================
--- trunk/src/com/kitfox/svg/Polygon.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Polygon.java	(revision 6002)
@@ -1,38 +1,45 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
 import com.kitfox.svg.xml.XMLParseUtil;
-import java.awt.geom.*;
-import java.awt.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -40,55 +47,35 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Polygon extends ShapeElement {
+public class Polygon extends ShapeElement
+{
+    public static final String TAG_NAME = "polygon";
 
     int fillRule = GeneralPath.WIND_NON_ZERO;
     String pointsStrn = "";
-//    float[] points = null;
     GeneralPath path;
 
-    /** Creates a new instance of Rect */
-    public Polygon() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Polygon()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-
-        points = XMLParseUtil.parseFloatList(attrs.getValue("points"));
-
-        build();
-    }
-*/
-/*
-    public void build()
-    {
-        StyleAttribute styleAttrib = getStyle("fill-rule");
-        String fillRule = (styleAttrib == null) ? "nonzero" : styleAttrib.getStringValue();
-
-        path = new GeneralPath(
-            fillRule.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO,
-            points.length / 2);
-
-        path.moveTo(points[0], points[1]);
-        for (int i = 2; i < points.length; i += 2)
-        {
-            path.lineTo(points[i], points[i + 1]);
-        }
-        path.closePath();
-    }
-*/
-    
-//static int yyyyy = 0;
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("points"))) pointsStrn = sty.getStringValue();
-        
+
+        if (getPres(sty.setName("points")))
+        {
+            pointsStrn = sty.getStringValue();
+        }
+
         String fillRuleStrn = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
         fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
@@ -96,5 +83,5 @@
         buildPath();
     }
-    
+
     protected void buildPath()
     {
@@ -109,5 +96,5 @@
         path.closePath();
     }
-    
+
     public void render(Graphics2D g) throws SVGException
     {
@@ -116,5 +103,4 @@
         finishLayer(g);
     }
-
 
     public Shape getShape()
@@ -128,8 +114,8 @@
     }
 
-
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -143,9 +129,9 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getStyle(sty.setName("fill-rule")))
         {
-            int newVal = sty.getStringValue().equals("evenodd") 
-                ? GeneralPath.WIND_EVEN_ODD 
+            int newVal = sty.getStringValue().equals("evenodd")
+                ? GeneralPath.WIND_EVEN_ODD
                 : GeneralPath.WIND_NON_ZERO;
             if (newVal != fillRule)
@@ -155,5 +141,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("points")))
         {
@@ -165,6 +151,6 @@
             }
         }
-        
-        
+
+
         if (shapeChange)
         {
@@ -173,5 +159,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/Polyline.java
===================================================================
--- trunk/src/com/kitfox/svg/Polyline.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Polyline.java	(revision 6002)
@@ -1,35 +1,45 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
-import java.awt.geom.*;
-import java.awt.*;
-
-import com.kitfox.svg.xml.*;
+import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.XMLParseUtil;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -37,36 +47,35 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Polyline extends ShapeElement {
-
+public class Polyline extends ShapeElement
+{
+    public static final String TAG_NAME = "polyline";
+    
     int fillRule = GeneralPath.WIND_NON_ZERO;
     String pointsStrn = "";
-//    float[] points = null;
     GeneralPath path;
 
-    /** Creates a new instance of Rect */
-    public Polyline() {
+    /**
+     * Creates a new instance of Rect
+     */
+    public Polyline()
+    {
     }
 
-    /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-
-        points = XMLParseUtil.parseFloatList(attrs.getValue("points"));
-
-        build();
+        return TAG_NAME;
     }
-    */
 
     public void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("points"))) pointsStrn = sty.getStringValue();
-        
+
+        if (getPres(sty.setName("points")))
+        {
+            pointsStrn = sty.getStringValue();
+        }
+
         String fillRuleStrn = getStyle(sty.setName("fill-rule")) ? sty.getStringValue() : "nonzero";
         fillRule = fillRuleStrn.equals("evenodd") ? GeneralPath.WIND_EVEN_ODD : GeneralPath.WIND_NON_ZERO;
@@ -74,5 +83,5 @@
         buildPath();
     }
-    
+
     protected void buildPath()
     {
@@ -105,6 +114,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -118,9 +128,9 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getStyle(sty.setName("fill-rule")))
         {
-            int newVal = sty.getStringValue().equals("evenodd") 
-                ? GeneralPath.WIND_EVEN_ODD 
+            int newVal = sty.getStringValue().equals("evenodd")
+                ? GeneralPath.WIND_EVEN_ODD
                 : GeneralPath.WIND_NON_ZERO;
             if (newVal != fillRule)
@@ -130,5 +140,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("points")))
         {
@@ -140,6 +150,6 @@
             }
         }
-        
-        
+
+
         if (shapeChange)
         {
@@ -148,5 +158,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/RadialGradient.java
===================================================================
--- trunk/src/com/kitfox/svg/RadialGradient.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/RadialGradient.java	(revision 6002)
@@ -1,41 +1,45 @@
 /*
- * RadialGradient.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:55 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.geom.*;
-import java.awt.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-//import org.apache.batik.ext.awt.*;
-import com.kitfox.svg.batik.*;
-
+import java.awt.Color;
+import java.awt.Paint;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -43,5 +47,7 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class RadialGradient extends Gradient {
+public class RadialGradient extends Gradient
+{
+    public static final String TAG_NAME = "radialgradient";
 
     float cx = 0.5f;
@@ -51,53 +57,48 @@
     float r = 0.5f;
 
-    /** Creates a new instance of RadialGradient */
-    public RadialGradient() {
-    }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String cx = attrs.getValue("cx");
-        String cy = attrs.getValue("cy");
-        String fx = attrs.getValue("fx");
-        String fy = attrs.getValue("fy");
-        String r = attrs.getValue("r");
-
-        if (cx != null) this.cx = (float)XMLParseUtil.parseRatio(cx);
-        if (cy != null) this.cy = (float)XMLParseUtil.parseRatio(cy);
-        if (fx != null) this.fx = (float)XMLParseUtil.parseRatio(fx);
-        if (fy != null) this.fy = (float)XMLParseUtil.parseRatio(fy);
-        if (r != null) this.r = (float)XMLParseUtil.parseRatio(r);
-    }
-    */
-
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        super.loaderEndElement(helper);
-        
-        build();
-    }
+    /**
+     * Creates a new instance of RadialGradient
      */
-    
+    public RadialGradient()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("cx"))) cx = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("cy"))) cy = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("fx"))) fx = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("fy"))) fy = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("r"))) r = sty.getFloatValueWithUnits();
-    }
-    
+
+        if (getPres(sty.setName("cx")))
+        {
+            cx = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("cy")))
+        {
+            cy = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("fx")))
+        {
+            fx = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("fy")))
+        {
+            fy = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("r")))
+        {
+            r = sty.getFloatValueWithUnits();
+        }
+    }
+
     public Paint getPaint(Rectangle2D bounds, AffineTransform xform)
     {
@@ -117,12 +118,17 @@
         }
 
-        com.kitfox.svg.batik.RadialGradientPaint paint;
-
-        if (gradientUnits == GU_USER_SPACE_ON_USE)
+        Paint paint;
+        Point2D.Float pt1 = new Point2D.Float(cx, cy);
+        Point2D.Float pt2 = new Point2D.Float(fx, fy);
+        if (pt1.equals(pt2))
+        {
+            Color[] colors = getStopColors();
+            paint = colors.length > 0 ? colors[0] : Color.black;
+        } else if (gradientUnits == GU_USER_SPACE_ON_USE)
         {
             paint = new com.kitfox.svg.batik.RadialGradientPaint(
-                new Point2D.Float(cx, cy),
+                pt1,
                 r,
-                new Point2D.Float(fx, fy),
+                pt2,
                 getStopFractions(),
                 getStopColors(),
@@ -130,6 +136,5 @@
                 com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
                 gradientTransform);
-        }
-        else
+        } else
         {
             AffineTransform viewXform = new AffineTransform();
@@ -140,7 +145,7 @@
 
             paint = new com.kitfox.svg.batik.RadialGradientPaint(
-                new Point2D.Float(cx, cy),
+                pt1,
                 r,
-                new Point2D.Float(fx, fy),
+                pt2,
                 getStopFractions(),
                 getStopColors(),
@@ -154,6 +159,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -167,5 +173,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("cx")))
         {
@@ -177,5 +183,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("cy")))
         {
@@ -187,5 +193,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("fx")))
         {
@@ -197,5 +203,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("fy")))
         {
@@ -207,5 +213,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("r")))
         {
@@ -217,5 +223,5 @@
             }
         }
-        
+
         return changeState;
     }
Index: trunk/src/com/kitfox/svg/Rect.java
===================================================================
--- trunk/src/com/kitfox/svg/Rect.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Rect.java	(revision 6002)
@@ -1,35 +1,45 @@
 /*
- * Rect.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:25 PM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-
-import java.awt.*;
-import java.awt.geom.*;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RectangularShape;
+import java.awt.geom.RoundRectangle2D;
 import java.io.IOException;
 import java.io.ObjectInputStream;
@@ -40,5 +50,7 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Rect extends ShapeElement {
+public class Rect extends ShapeElement
+{
+    public static final String TAG_NAME = "rect";
 
     float x = 0f;
@@ -48,12 +60,19 @@
     float rx = 0f;
     float ry = 0f;
-
     RectangularShape rect;
 
-    /** Creates a new instance of Rect */
-    public Rect() {
-    }
-
-    private void writeObject(ObjectOutputStream out) throws IOException    
+    /**
+     * Creates a new instance of Rect
+     */
+    public Rect()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException
     {
         out.writeFloat(x);
@@ -64,5 +83,5 @@
         out.writeFloat(ry);
     }
-    
+
     private void readObject(ObjectInputStream in) throws IOException
     {
@@ -73,52 +92,50 @@
         rx = in.readFloat();
         ry = in.readFloat();
-        
+
         if (rx == 0f && ry == 0f)
         {
             rect = new Rectangle2D.Float(x, y, width, height);
-        }
-        else
+        } else
         {
             rect = new RoundRectangle2D.Float(x, y, width, height, rx * 2, ry * 2);
         }
     }
-    
+
     /*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String x = attrs.getValue("x");
-        String y = attrs.getValue("y");
-        String width = attrs.getValue("width");
-        String height = attrs.getValue("height");
-        String rx = attrs.getValue("rx");
-        String ry = attrs.getValue("ry");
-
-        if (rx == null) rx = ry;
-        if (ry == null) ry = rx;
-
-        this.x = XMLParseUtil.parseFloat(x);
-        this.y = XMLParseUtil.parseFloat(y);
-        this.width = XMLParseUtil.parseFloat(width);
-        this.height = XMLParseUtil.parseFloat(height);
-        if (rx != null)
-        {
-            this.rx = XMLParseUtil.parseFloat(rx);
-            this.ry = XMLParseUtil.parseFloat(ry);
-        }
-
-        build();
-//        setBounds(this.x, this.y, this.width, this.height);
-    }
-*/
-    
+     public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+     {
+     //Load style string
+     super.loaderStartElement(helper, attrs, parent);
+
+     String x = attrs.getValue("x");
+     String y = attrs.getValue("y");
+     String width = attrs.getValue("width");
+     String height = attrs.getValue("height");
+     String rx = attrs.getValue("rx");
+     String ry = attrs.getValue("ry");
+
+     if (rx == null) rx = ry;
+     if (ry == null) ry = rx;
+
+     this.x = XMLParseUtil.parseFloat(x);
+     this.y = XMLParseUtil.parseFloat(y);
+     this.width = XMLParseUtil.parseFloat(width);
+     this.height = XMLParseUtil.parseFloat(height);
+     if (rx != null)
+     {
+     this.rx = XMLParseUtil.parseFloat(rx);
+     this.ry = XMLParseUtil.parseFloat(ry);
+     }
+
+     build();
+     //        setBounds(this.x, this.y, this.width, this.height);
+     }
+     */
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
 //        SVGElement parent = this.getParent();
 //        if (parent instanceof RenderableElement)
@@ -128,29 +145,54 @@
 //            bounds = null;
 //        }
-        
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
+
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getFloatValueWithUnits();
+        }
 
         boolean rxSet = false;
-        if (getPres(sty.setName("rx"))) { rx = sty.getFloatValueWithUnits(); rxSet = true; }
-        
+        if (getPres(sty.setName("rx")))
+        {
+            rx = sty.getFloatValueWithUnits();
+            rxSet = true;
+        }
+
         boolean rySet = false;
-        if (getPres(sty.setName("ry"))) { ry = sty.getFloatValueWithUnits(); rySet = true; }
-        
-        if (!rxSet) rx = ry;
-        if (!rySet) ry = rx;
-
-        
+        if (getPres(sty.setName("ry")))
+        {
+            ry = sty.getFloatValueWithUnits();
+            rySet = true;
+        }
+
+        if (!rxSet)
+        {
+            rx = ry;
+        }
+        if (!rySet)
+        {
+            ry = rx;
+        }
+
+
         if (rx == 0f && ry == 0f)
         {
             rect = new Rectangle2D.Float(x, y, width, height);
-        }
-        else
+        } else
         {
             rect = new RoundRectangle2D.Float(x, y, width, height, rx * 2, ry * 2);
@@ -176,6 +218,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -189,5 +232,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -263,5 +306,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/RenderableElement.java
===================================================================
--- trunk/src/com/kitfox/svg/RenderableElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/RenderableElement.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * BoundedElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 9:00 AM
  */
-
 package com.kitfox.svg;
 
@@ -38,6 +46,4 @@
 import java.util.List;
 
-
-
 /**
  * Maintains bounding box for this element
@@ -46,16 +52,18 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-abstract public class RenderableElement extends TransformableElement 
+abstract public class RenderableElement extends TransformableElement
 {
-
     AffineTransform cachedXform = null;
+    
     Shape cachedClip = null;
-    
     public static final int VECTOR_EFFECT_NONE = 0;
     public static final int VECTOR_EFFECT_NON_SCALING_STROKE = 1;
     int vectorEffect;
 
-    /** Creates a new instance of BoundedElement */
-    public RenderableElement() {
+    /**
+     * Creates a new instance of BoundedElement
+     */
+    public RenderableElement()
+    {
     }
 
@@ -68,7 +76,7 @@
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
         if (getPres(sty.setName("vector-effect")))
         {
@@ -76,29 +84,28 @@
             {
                 vectorEffect = VECTOR_EFFECT_NON_SCALING_STROKE;
-            }
-            else
+            } else
             {
                 vectorEffect = VECTOR_EFFECT_NONE;
             }
-        }
-        else
+        } else
         {
             vectorEffect = VECTOR_EFFECT_NONE;
         }
     }
-    
+
     abstract public void render(Graphics2D g) throws SVGException;
-    
+
     abstract void pick(Point2D point, boolean boundingBox, List retVec) throws SVGException;
-    
+
     abstract void pick(Rectangle2D pickArea, AffineTransform ltw, boolean boundingBox, List retVec) throws SVGException;
-    
+
     abstract public Rectangle2D getBoundingBox() throws SVGException;
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-        super.loaderStartElement(helper, attrs, parent);
-    }
-*/
+    /*
+     public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+     {
+     super.loaderStartElement(helper, attrs, parent);
+     }
+     */
+
     /**
      * Pushes transform stack, transforms to local coordinates and sets up
@@ -114,15 +121,16 @@
 
         StyleAttribute styleAttrib = new StyleAttribute();
-        
+
         //Get clipping path
 //        StyleAttribute styleAttrib = getStyle("clip-path", false);
         Shape clipPath = null;
         int clipPathUnits = ClipPath.CP_USER_SPACE_ON_USE;
-        if (getStyle(styleAttrib.setName("clip-path")))
+        if (getStyle(styleAttrib.setName("clip-path"), false)
+             && !"none".equals(styleAttrib.getStringValue()))
         {
             URI uri = styleAttrib.getURIValue(getXMLBase());
             if (uri != null)
             {
-                ClipPath ele = (ClipPath)diagram.getUniverse().getElement(uri);
+                ClipPath ele = (ClipPath) diagram.getUniverse().getElement(uri);
                 clipPath = ele.getClipPathShape();
                 clipPathUnits = ele.getClipPathUnits();
@@ -135,5 +143,5 @@
             if (clipPathUnits == ClipPath.CP_OBJECT_BOUNDING_BOX && (this instanceof ShapeElement))
             {
-                Rectangle2D rect = ((ShapeElement)this).getBoundingBox();
+                Rectangle2D rect = ((ShapeElement) this).getBoundingBox();
                 AffineTransform at = new AffineTransform();
                 at.scale(rect.getWidth(), rect.getHeight());
@@ -142,13 +150,19 @@
 
             cachedClip = g.getClip();
-            Area newClip = new Area(cachedClip);
-            newClip.intersect(new Area(clipPath));
-            g.setClip(newClip);
+            if (cachedClip == null)
+            {
+                g.setClip(clipPath);
+            } else
+            {
+                Area newClip = new Area(cachedClip);
+                newClip.intersect(new Area(clipPath));
+                g.setClip(newClip);
+            }
         }
     }
 
     /**
-     * Restores transform and clipping values to the way they were before
-     * this layer was drawn.
+     * Restores transform and clipping values to the way they were before this
+     * layer was drawn.
      */
     protected void finishLayer(Graphics2D g)
@@ -164,4 +178,3 @@
         }
     }
-
 }
Index: trunk/src/com/kitfox/svg/SVGCache.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGCache.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGCache.java	(revision 6002)
@@ -1,4 +1,34 @@
 /*
- * SVGUniverseSingleton.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 2, 2005, 1:54 AM
Index: trunk/src/com/kitfox/svg/SVGConst.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGConst.java	(revision 6002)
+++ trunk/src/com/kitfox/svg/SVGConst.java	(revision 6002)
@@ -0,0 +1,14 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.kitfox.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public interface SVGConst
+{
+    public static final String SVG_LOGGER = "svgSalamandeLogger";
+}
Index: trunk/src/com/kitfox/svg/SVGDiagram.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGDiagram.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGDiagram.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * SVGDiagram.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 5:04 PM
@@ -38,4 +47,6 @@
 import java.util.HashMap;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 
@@ -203,4 +214,5 @@
     {
         this.root = root;
+        root.setDiagram(this);
     }
 
@@ -239,5 +251,6 @@
             } catch (SVGException ex)
             {
-                ex.printStackTrace();
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+                    "Could not build document", ex);
             }
         }
Index: trunk/src/com/kitfox/svg/SVGDisplayPanel.form
===================================================================
--- trunk/src/com/kitfox/svg/SVGDisplayPanel.form	(revision 4453)
+++ 	(revision )
@@ -1,16 +1,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
-  <Events>
-    <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentResized"/>
-  </Events>
-  <AuxValues>
-    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
-    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
-    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
-    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
-  </AuxValues>
-
-  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
-</Form>
Index: trunk/src/com/kitfox/svg/SVGDisplayPanel.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGDisplayPanel.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGDisplayPanel.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * SVGDisplayPanel.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 20, 2004, 12:29 PM
@@ -31,4 +40,6 @@
 import java.awt.*;
 import java.awt.geom.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -124,5 +135,6 @@
             catch (SVGException e)
             {
-                e.printStackTrace();
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+                    "Could not render diagram", e);
             }
         }
Index: trunk/src/com/kitfox/svg/SVGElement.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGElement.java	(revision 6002)
@@ -1,40 +1,71 @@
 /*
- * SVGElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:59 AM
  */
-
 package com.kitfox.svg;
 
-import java.util.*;
-import java.util.regex.*;
-import java.net.*;
-import java.awt.geom.*;
-
-import org.xml.sax.*;
-import com.kitfox.svg.pathcmd.*;
-import com.kitfox.svg.xml.*;
+import com.kitfox.svg.pathcmd.Arc;
+import com.kitfox.svg.pathcmd.BuildHistory;
+import com.kitfox.svg.pathcmd.Cubic;
+import com.kitfox.svg.pathcmd.CubicSmooth;
+import com.kitfox.svg.pathcmd.Horizontal;
+import com.kitfox.svg.pathcmd.LineTo;
+import com.kitfox.svg.pathcmd.MoveTo;
+import com.kitfox.svg.pathcmd.PathCommand;
+import com.kitfox.svg.pathcmd.Quadratic;
+import com.kitfox.svg.pathcmd.QuadraticSmooth;
+import com.kitfox.svg.pathcmd.Terminal;
+import com.kitfox.svg.pathcmd.Vertical;
+import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.StyleSheet;
+import com.kitfox.svg.xml.XMLParseUtil;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
 import java.io.Serializable;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
 
 /**
@@ -44,29 +75,23 @@
 abstract public class SVGElement implements Serializable
 {
+
     public static final long serialVersionUID = 0;
-    
     public static final String SVG_NS = "http://www.w3.org/2000/svg";
-    
     protected SVGElement parent = null;
-    
     protected final ArrayList children = new ArrayList();
-    
     protected String id = null;
     /**
-     * CSS class.  Used for applying style sheet information.
+     * CSS class. Used for applying style sheet information.
      */
     protected String cssClass = null;
-    
     /**
      * Styles defined for this elemnt via the <b>style</b> attribute.
      */
     protected final HashMap inlineStyles = new HashMap();
-    
-    /**
-     * Presentation attributes set for this element.  Ie, any attribute other
+    /**
+     * Presentation attributes set for this element. Ie, any attribute other
      * than the <b>style</b> attribute.
      */
     protected final HashMap presAttribs = new HashMap();
-    
     /**
      * A list of presentation attributes to not include in the presentation
@@ -74,4 +99,5 @@
      */
     protected static final Set ignorePresAttrib;
+
     static
     {
@@ -81,40 +107,32 @@
 //        set.add("style");
 //        set.add("xml:base");
-        
+
         ignorePresAttrib = Collections.unmodifiableSet(set);
     }
-    
-    /**
-     * This element may override the URI we resolve against with an
-     * xml:base attribute.  If so, a copy is placed here.  Otherwise, we defer
-     * to our parent for the reolution base
+    /**
+     * This element may override the URI we resolve against with an xml:base
+     * attribute. If so, a copy is placed here. Otherwise, we defer to our
+     * parent for the reolution base
      */
     protected URI xmlBase = null;
-    
     /**
      * The diagram this element belongs to
      */
     protected SVGDiagram diagram;
-    /**
-     * Link to the universe we reside in
-     */
-//    protected SVGUniverse universe;
-    
     boolean dirty = true;
 
-//    public static final Matcher adobeId = Pattern.compile("(.*)_1_").matcher("");
-//    static final String fpNumRe = "[-+]?((\\d+)|(\\d*\\.\\d+))([-+]?[eE]\\d+)?";
-    
-    /** Creates a new instance of SVGElement */
+    /**
+     * Creates a new instance of SVGElement
+     */
     public SVGElement()
     {
         this(null, null, null);
     }
-    
+
     public SVGElement(String id, SVGElement parent)
     {
         this(id, null, parent);
     }
-    
+
     public SVGElement(String id, String cssClass, SVGElement parent)
     {
@@ -123,15 +141,17 @@
         this.parent = parent;
     }
-    
+
+    abstract public String getTagName();
+
     public SVGElement getParent()
     {
         return parent;
     }
-    
+
     void setParent(SVGElement parent)
     {
         this.parent = parent;
     }
-    
+
     /**
      * @return an ordered list of nodes from the root of the tree to this node
@@ -139,6 +159,9 @@
     public List getPath(List retVec)
     {
-        if (retVec == null) retVec = new ArrayList();
-        
+        if (retVec == null)
+        {
+            retVec = new ArrayList();
+        }
+
         if (parent != null)
         {
@@ -146,10 +169,10 @@
         }
         retVec.add(this);
-        
+
         return retVec;
     }
-    
-    /**
-     * @param retVec - A list to add all children to.  If null, a new list is
+
+    /**
+     * @param retVec - A list to add all children to. If null, a new list is
      * created and children of this group are added.
      *
@@ -158,11 +181,14 @@
     public List getChildren(List retVec)
     {
-        if (retVec == null) retVec = new ArrayList();
-        
+        if (retVec == null)
+        {
+            retVec = new ArrayList();
+        }
+
         retVec.addAll(children);
-        
+
         return retVec;
     }
-    
+
     /**
      * @param id - Id of svg element to return
@@ -173,14 +199,17 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             String eleId = ele.getId();
-            if (eleId != null && eleId.equals(id)) return ele;
-        }
-        
+            if (eleId != null && eleId.equals(id))
+            {
+                return ele;
+            }
+        }
+
         return null;
     }
-    
-    /**
-     * Searches children for given element.  If found, returns index of child.
+
+    /**
+     * Searches children for given element. If found, returns index of child.
      * Otherwise returns -1.
      */
@@ -189,7 +218,8 @@
         return children.indexOf(child);
     }
-    
+
     /**
      * Swaps 2 elements in children.
+     *
      * @i index of first
      * @j index of second
@@ -203,5 +233,5 @@
             return;
         }
-        
+
         Object temp = children.get(i);
         children.set(i, children.get(j));
@@ -209,11 +239,12 @@
         build();
     }
-    
-    /**
-     * Called during SAX load process to notify that this tag has begun the process
-     * of being loaded
+
+    /**
+     * Called during SAX load process to notify that this tag has begun the
+     * process of being loaded
+     *
      * @param attrs - Attributes of this tag
-     * @param helper - An object passed to all SVG elements involved in this build
-     * process to aid in sharing information.
+     * @param helper - An object passed to all SVG elements involved in this
+     * build process to aid in sharing information.
      */
     public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent) throws SAXException
@@ -222,5 +253,5 @@
         this.parent = parent;
         this.diagram = helper.diagram;
-        
+
         this.id = attrs.getValue("id");
         if (this.id != null && !this.id.equals(""))
@@ -228,10 +259,10 @@
             diagram.setElement(this.id, this);
         }
-        
+
         String className = attrs.getValue("class");
         this.cssClass = (className == null || className.equals("")) ? null : className;
         //docRoot = helper.docRoot;
         //universe = helper.universe;
-        
+
         //Parse style string, if any
         String style = attrs.getValue("style");
@@ -240,5 +271,5 @@
             HashMap map = XMLParseUtil.parseStyle(style, inlineStyles);
         }
-        
+
         String base = attrs.getValue("xml:base");
         if (base != null && !base.equals(""))
@@ -247,11 +278,10 @@
             {
                 xmlBase = new URI(base);
-            }
-            catch (Exception e)
+            } catch (Exception e)
             {
                 throw new SAXException(e);
             }
         }
-        
+
         //Place all other attributes into the presentation attribute list
         int numAttrs = attrs.getLength();
@@ -259,11 +289,14 @@
         {
             String name = attrs.getQName(i);
-            if (ignorePresAttrib.contains(name)) continue;
+            if (ignorePresAttrib.contains(name))
+            {
+                continue;
+            }
             String value = attrs.getValue(i);
-            
+
             presAttribs.put(name, new StyleAttribute(name, value));
         }
     }
-    
+
     /**
      * @return a set of Strings that corespond to CSS attributes on this element
@@ -273,5 +306,5 @@
         return inlineStyles.keySet();
     }
-    
+
     /**
      * @return a set of Strings that corespond to XML attributes on this element
@@ -281,5 +314,5 @@
         return presAttribs.keySet();
     }
-    
+
     /**
      * Called after the start element but before the end element to indicate
@@ -292,6 +325,6 @@
         child.setDiagram(diagram);
     }
-    
-    private void setDiagram(SVGDiagram diagram)
+
+    protected void setDiagram(SVGDiagram diagram)
     {
         this.diagram = diagram;
@@ -299,9 +332,9 @@
         for (Iterator it = children.iterator(); it.hasNext();)
         {
-            SVGElement ele = (SVGElement)it.next();
+            SVGElement ele = (SVGElement) it.next();
             ele.setDiagram(diagram);
         }
     }
-    
+
     public void removeChild(SVGElement child) throws SVGElementException
     {
@@ -310,8 +343,8 @@
             throw new SVGElementException(this, "Element does not contain child " + child);
         }
-        
+
         children.remove(child);
     }
-    
+
     /**
      * Called during load process to add text scanned within a tag
@@ -320,29 +353,29 @@
     {
     }
-    
-    /**
-     * Called to indicate that this tag and the tags it contains have been completely
-     * processed, and that it should finish any load processes.
+
+    /**
+     * Called to indicate that this tag and the tags it contains have been
+     * completely processed, and that it should finish any load processes.
      */
     public void loaderEndElement(SVGLoaderHelper helper) throws SVGParseException
     {
-        try
-        {
-            build();
-        }
-        catch (SVGException se)
-        {
-            throw new SVGParseException(se);
-        }
-    }
-    
-    /**
-     * Called by internal processes to rebuild the geometry of this node
-     * from it's presentation attributes, style attributes and animated tracks.
+//        try
+//        {
+//            build();
+//        }
+//        catch (SVGException se)
+//        {
+//            throw new SVGParseException(se);
+//        }
+    }
+
+    /**
+     * Called by internal processes to rebuild the geometry of this node from
+     * it's presentation attributes, style attributes and animated tracks.
      */
     protected void build() throws SVGException
     {
         StyleAttribute sty = new StyleAttribute();
-        
+
         if (getPres(sty.setName("id")))
         {
@@ -355,27 +388,38 @@
             }
         }
-        if (getPres(sty.setName("class"))) cssClass = sty.getStringValue();
-        if (getPres(sty.setName("xml:base"))) xmlBase = sty.getURIValue();
-    }
-    
+        if (getPres(sty.setName("class")))
+        {
+            cssClass = sty.getStringValue();
+        }
+        if (getPres(sty.setName("xml:base")))
+        {
+            xmlBase = sty.getURIValue();
+        }
+
+        //Build children
+        for (int i = 0; i < children.size(); ++i)
+        {
+            SVGElement ele = (SVGElement) children.get(i);
+            ele.build();
+        }
+    }
+
     public URI getXMLBase()
     {
-        return xmlBase != null ? xmlBase :
-            (parent != null ? parent.getXMLBase() : diagram.getXMLBase());
-    }
-
-    /**
-     * @return the id assigned to this node.  Null if no id explicitly set.
+        return xmlBase != null ? xmlBase
+            : (parent != null ? parent.getXMLBase() : diagram.getXMLBase());
+    }
+
+    /**
+     * @return the id assigned to this node. Null if no id explicitly set.
      */
     public String getId()
     {
-        return id; 
-    }
-    
-    
+        return id;
+    }
     LinkedList contexts = new LinkedList();
-    
-    /**
-     * Hack to allow nodes to temporarily change their parents.  The Use tag will
+
+    /**
+     * Hack to allow nodes to temporarily change their parents. The Use tag will
      * need this so it can alter the attributes that a particular node uses.
      */
@@ -387,12 +431,17 @@
     protected SVGElement popParentContext()
     {
-        return (SVGElement)contexts.removeLast();
-    }
-    
+        return (SVGElement) contexts.removeLast();
+    }
+
     protected SVGElement getParentContext()
     {
-        return contexts.isEmpty() ? null : (SVGElement)contexts.getLast();
-    }
-    
+        return contexts.isEmpty() ? null : (SVGElement) contexts.getLast();
+    }
+
+    public SVGRoot getRoot()
+    {
+        return parent == null ? null : parent.getRoot();
+    }
+
     /*
      * Returns the named style attribute.  Checks for inline styles first, then
@@ -408,65 +457,86 @@
         return getStyle(attrib, true);
     }
-    
-    /**
-     * Copies the current style into the passed style attribute.  Checks for
-     * inline styles first, then internal and extranal style sheets, and
-     * finally checks for presentation attributes.  Recursively checks parents.
-     * @param attrib - Attribute to write style data to.  Must have it's name
-     * set to the name of the style being queried.
-     * @param recursive - If true and this object does not contain the
-     * named style attribute, checks attributes of parents abck to root until
-     * one found.
+
+    /**
+     * Copies the current style into the passed style attribute. Checks for
+     * inline styles first, then internal and extranal style sheets, and finally
+     * checks for presentation attributes. Recursively checks parents.
+     *
+     * @param attrib - Attribute to write style data to. Must have it's name set
+     * to the name of the style being queried.
+     * @param recursive - If true and this object does not contain the named
+     * style attribute, checks attributes of parents back to root until one
+     * found.
      */
     public boolean getStyle(StyleAttribute attrib, boolean recursive) throws SVGException
     {
         String styName = attrib.getName();
-        
+
         //Check for local inline styles
         StyleAttribute styAttr = (StyleAttribute)inlineStyles.get(styName);
-        
+
         attrib.setStringValue(styAttr == null ? "" : styAttr.getStringValue());
-        
+
         //Return if we've found a non animated style
-        if (styAttr != null) return true;
-        
-        
-        
-        //Implement style sheet lookup later
-        
+        if (styAttr != null)
+        {
+            return true;
+        }
+
+
         //Check for presentation attribute
         StyleAttribute presAttr = (StyleAttribute)presAttribs.get(styName);
-        
+
         attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
-        
+
         //Return if we've found a presentation attribute instead
-        if (presAttr != null) return true;
-        
-        
+        if (presAttr != null)
+        {
+            return true;
+        }
+
+        //Check for style sheet
+        SVGRoot root = getRoot();
+        if (root != null)
+        {
+            StyleSheet ss = root.getStyleSheet();
+            if (ss != null)
+            {
+                return ss.getStyle(attrib, getTagName(), cssClass);
+            }
+        }
+
         //If we're recursive, check parents
         if (recursive)
         {
             SVGElement parentContext = getParentContext();
-            if (parentContext != null) return parentContext.getStyle(attrib, true);
-            if (parent != null) return parent.getStyle(attrib, true);
-        }
-        
+            if (parentContext != null)
+            {
+                return parentContext.getStyle(attrib, true);
+            }
+            if (parent != null)
+            {
+                return parent.getStyle(attrib, true);
+            }
+        }
+
         //Unsuccessful reading style attribute
         return false;
     }
-    
-    /**
-     * @return the raw style value of this attribute.  Does not take the 
-     * presentation value or animation into consideration.  Used by animations 
-     * to determine the base to animate from.
+
+    /**
+     * @return the raw style value of this attribute. Does not take the
+     * presentation value or animation into consideration. Used by animations to
+     * determine the base to animate from.
      */
     public StyleAttribute getStyleAbsolute(String styName)
     {
         //Check for local inline styles
-        return (StyleAttribute)inlineStyles.get(styName);
-    }
-    
+        return (StyleAttribute) inlineStyles.get(styName);
+    }
+
     /**
      * Copies the presentation attribute into the passed one.
+     *
      * @return - True if attribute was read successfully
      */
@@ -474,20 +544,23 @@
     {
         String presName = attrib.getName();
-        
+
         //Make sure we have a coresponding presentation attribute
-        StyleAttribute presAttr = (StyleAttribute)presAttribs.get(presName);
-        
+        StyleAttribute presAttr = (StyleAttribute) presAttribs.get(presName);
+
         //Copy presentation value directly
         attrib.setStringValue(presAttr == null ? "" : presAttr.getStringValue());
-        
+
         //Return if we found presentation attribute
-        if (presAttr != null) return true;
-        
+        if (presAttr != null)
+        {
+            return true;
+        }
+
         return false;
     }
-    
-    /**
-     * @return the raw presentation value of this attribute.  Ignores any 
-     * modifications applied by style attributes or animation.  Used by 
+
+    /**
+     * @return the raw presentation value of this attribute. Ignores any
+     * modifications applied by style attributes or animation. Used by
      * animations to determine the starting point to animate from
      */
@@ -495,13 +568,13 @@
     {
         //Check for local inline styles
-        return (StyleAttribute)presAttribs.get(styName);
-    }
-    
+        return (StyleAttribute) presAttribs.get(styName);
+    }
+
     static protected AffineTransform parseTransform(String val) throws SVGException
     {
         final Matcher matchExpression = Pattern.compile("\\w+\\([^)]*\\)").matcher("");
-        
+
         AffineTransform retXform = new AffineTransform();
-        
+
         matchExpression.reset(val);
         while (matchExpression.find())
@@ -509,14 +582,14 @@
             retXform.concatenate(parseSingleTransform(matchExpression.group()));
         }
-        
+
         return retXform;
     }
-    
+
     static public AffineTransform parseSingleTransform(String val) throws SVGException
     {
         final Matcher matchWord = Pattern.compile("[-.\\w]+").matcher("");
-        
+
         AffineTransform retXform = new AffineTransform();
-        
+
         matchWord.reset(val);
         if (!matchWord.find())
@@ -525,7 +598,7 @@
             return retXform;
         }
-        
+
         String function = matchWord.group().toLowerCase();
-        
+
         LinkedList termList = new LinkedList();
         while (matchWord.find())
@@ -533,6 +606,6 @@
             termList.add(matchWord.group());
         }
-        
-        
+
+
         double[] terms = new double[termList.size()];
         Iterator it = termList.iterator();
@@ -540,56 +613,62 @@
         while (it.hasNext())
         {
-            terms[count++] = XMLParseUtil.parseDouble((String)it.next());
-        }
-        
+            terms[count++] = XMLParseUtil.parseDouble((String) it.next());
+        }
+
         //Calculate transformation
         if (function.equals("matrix"))
         {
             retXform.setTransform(terms[0], terms[1], terms[2], terms[3], terms[4], terms[5]);
-        }
-        else if (function.equals("translate"))
-        {
-            retXform.setToTranslation(terms[0], terms[1]);
-        }
-        else if (function.equals("scale"))
+        } else if (function.equals("translate"))
+        {
+            if (terms.length == 1)
+            {
+                retXform.setToTranslation(terms[0], 0);
+            } else
+            {
+                retXform.setToTranslation(terms[0], terms[1]);
+            }
+        } else if (function.equals("scale"))
         {
             if (terms.length > 1)
+            {
                 retXform.setToScale(terms[0], terms[1]);
-            else
+            } else
+            {
                 retXform.setToScale(terms[0], terms[0]);
-        }
-        else if (function.equals("rotate"))
+            }
+        } else if (function.equals("rotate"))
         {
             if (terms.length > 2)
+            {
                 retXform.setToRotation(Math.toRadians(terms[0]), terms[1], terms[2]);
-            else
+            } else
+            {
                 retXform.setToRotation(Math.toRadians(terms[0]));
-        }
-        else if (function.equals("skewx"))
+            }
+        } else if (function.equals("skewx"))
         {
             retXform.setToShear(Math.toRadians(terms[0]), 0.0);
-        }
-        else if (function.equals("skewy"))
+        } else if (function.equals("skewy"))
         {
             retXform.setToShear(0.0, Math.toRadians(terms[0]));
-        }
-        else
+        } else
         {
             throw new SVGException("Unknown transform type");
         }
-        
+
         return retXform;
     }
-    
+
     static protected float nextFloat(LinkedList l)
     {
-        String s = (String)l.removeFirst();
+        String s = (String) l.removeFirst();
         return Float.parseFloat(s);
     }
-    
+
     static protected PathCommand[] parsePathList(String list)
     {
         final Matcher matchPathCmd = Pattern.compile("([MmLlHhVvAaQqTtCcSsZz])|([-+]?((\\d*\\.\\d+)|(\\d+))([eE][-+]?\\d+)?)").matcher(list);
-        
+
         //Tokenize
         LinkedList tokens = new LinkedList();
@@ -598,6 +677,6 @@
             tokens.addLast(matchPathCmd.group());
         }
-        
-        
+
+
         boolean defaultRelative = false;
         LinkedList cmdList = new LinkedList();
@@ -605,17 +684,16 @@
         while (tokens.size() != 0)
         {
-            String curToken = (String)tokens.removeFirst();
+            String curToken = (String) tokens.removeFirst();
             char initChar = curToken.charAt(0);
-            if ((initChar >= 'A' && initChar <='Z') || (initChar >= 'a' && initChar <='z'))
+            if ((initChar >= 'A' && initChar <= 'Z') || (initChar >= 'a' && initChar <= 'z'))
             {
                 curCmd = initChar;
-            }
-            else
+            } else
             {
                 tokens.addFirst(curToken);
             }
-            
+
             PathCommand cmd = null;
-            
+
             switch (curCmd)
             {
@@ -648,21 +726,21 @@
                 case 'A':
                     cmd = new Arc(false, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens),
-                            nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens),
+                        nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'a':
                     cmd = new Arc(true, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens),
-                            nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens),
+                        nextFloat(tokens) == 1f, nextFloat(tokens) == 1f,
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'Q':
                     cmd = new Quadratic(false, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'q':
                     cmd = new Quadratic(true, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'T':
@@ -674,19 +752,19 @@
                 case 'C':
                     cmd = new Cubic(false, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens),
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'c':
                     cmd = new Cubic(true, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens),
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'S':
                     cmd = new CubicSmooth(false, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 's':
                     cmd = new CubicSmooth(true, nextFloat(tokens), nextFloat(tokens),
-                            nextFloat(tokens), nextFloat(tokens));
+                        nextFloat(tokens), nextFloat(tokens));
                     break;
                 case 'Z':
@@ -697,18 +775,18 @@
                     throw new RuntimeException("Invalid path element");
             }
-            
+
             cmdList.add(cmd);
             defaultRelative = cmd.isRelative;
         }
-        
+
         PathCommand[] retArr = new PathCommand[cmdList.size()];
         cmdList.toArray(retArr);
         return retArr;
     }
-    
+
     static protected GeneralPath buildPath(String text, int windingRule)
     {
         PathCommand[] commands = parsePathList(text);
-        
+
         int numKnots = 2;
         for (int i = 0; i < commands.length; i++)
@@ -716,10 +794,10 @@
             numKnots += commands[i].getNumKnotsAdded();
         }
-        
-        
+
+
         GeneralPath path = new GeneralPath(windingRule, numKnots);
-        
+
         BuildHistory hist = new BuildHistory();
-        
+
         for (int i = 0; i < commands.length; i++)
         {
@@ -727,13 +805,12 @@
             cmd.appendPath(path, hist);
         }
-        
+
         return path;
     }
-    
-    
-    
-    /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+
+    /**
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -748,6 +825,10 @@
     public SVGElement getChild(int i)
     {
-        return (SVGElement)children.get(i);
-    }
-    
+        return (SVGElement) children.get(i);
+    }
+
+    public double lerp(double t0, double t1, double alpha)
+    {
+        return (1 - alpha) * t0 + alpha * t1;
+    }
 }
Index: trunk/src/com/kitfox/svg/SVGElementException.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGElementException.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGElementException.java	(revision 6002)
@@ -1,10 +1,36 @@
 /*
- * SVGException.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on May 12, 2005, 11:32 PM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
  */
 
Index: trunk/src/com/kitfox/svg/SVGException.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGException.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGException.java	(revision 6002)
@@ -1,10 +1,36 @@
 /*
- * SVGException.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on May 12, 2005, 11:32 PM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
  */
 
Index: trunk/src/com/kitfox/svg/SVGLoader.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGLoader.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGLoader.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * SVGLoader.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 5:09 PM
@@ -33,4 +42,7 @@
 import org.xml.sax.*;
 import org.xml.sax.helpers.DefaultHandler;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -186,5 +198,6 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+                "Could not load", e);
             throw new SAXException(e);
         }
@@ -222,14 +235,24 @@
 
             SVGElement parent = null;
-            if (buildStack.size() != 0) parent = (SVGElement)buildStack.getLast();
+            if (buildStack.size() != 0)
+            {
+                parent = (SVGElement)buildStack.getLast();
+            }
             //else loadRoot = (SVGElement)svgEle;
 
-            if (parent != null) parent.loaderAddChild(helper, svgEle);
-            else diagram.setRoot((SVGRoot)svgEle);
+            if (parent != null)
+            {
+                parent.loaderAddChild(helper, svgEle);
+            }
+            else
+            {
+                diagram.setRoot((SVGRoot)svgEle);
+            }
 
         }
         catch (Exception e)
         {
-e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+                "Could not parse", e);
             throw new SAXException(e);
         }
Index: trunk/src/com/kitfox/svg/SVGLoaderHelper.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGLoaderHelper.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGLoaderHelper.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * SVGLoaderHelper.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 5:37 PM
@@ -47,22 +56,9 @@
 
     public final URI xmlBase;
-
+    
     /** Creates a new instance of SVGLoaderHelper */
     public SVGLoaderHelper(URI xmlBase, SVGUniverse universe, SVGDiagram diagram)
     {
-        /*
-        URI docURI = null;
-        try
-        {
-            docURI = new URI(docRoot.toString());
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-         */
-        
         this.xmlBase = xmlBase;
-//        this.docRoot = docURI;
         this.universe = universe;
         this.diagram = diagram;
Index: trunk/src/com/kitfox/svg/SVGParseException.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGParseException.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGParseException.java	(revision 6002)
@@ -1,10 +1,36 @@
 /*
- * SVGException.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on May 12, 2005, 11:32 PM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
  */
 
Index: trunk/src/com/kitfox/svg/SVGRoot.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGRoot.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGRoot.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * SVGRoot.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 5:33 PM
@@ -30,6 +39,10 @@
 import com.kitfox.svg.xml.NumberWithUnits;
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.geom.*;
-import java.awt.*;
+import com.kitfox.svg.xml.StyleSheet;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -41,4 +54,6 @@
 public class SVGRoot extends Group
 {
+    public static final String TAG_NAME = "svg";
+
     NumberWithUnits x;
     NumberWithUnits y;
@@ -46,6 +61,4 @@
     NumberWithUnits height;
 
-    
-//    final Rectangle2D.Float viewBox = new Rectangle2D.Float();
     Rectangle2D.Float viewBox = null;
 
@@ -70,55 +83,15 @@
     final Rectangle2D.Float clipRect = new Rectangle2D.Float();
 
+    private StyleSheet styleSheet;
+    
     /** Creates a new instance of SVGRoot */
     public SVGRoot()
     {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        x = XMLParseUtil.parseNumberWithUnits(attrs.getValue("x"));
-        y = XMLParseUtil.parseNumberWithUnits(attrs.getValue("y"));
-        width = XMLParseUtil.parseNumberWithUnits(attrs.getValue("width"));
-        height = XMLParseUtil.parseNumberWithUnits(attrs.getValue("height"));
-
-        String viewBox = attrs.getValue("viewBox");
-        float[] coords = XMLParseUtil.parseFloatList(viewBox);
-
-        if (coords == null)
-        {
-            //this.viewBox.setRect(0, 0, width.getValue(), height.getValue());
-            this.viewBox = null;
-        }
-        else
-        {
-            this.viewBox = new Rectangle2D.Float(coords[0], coords[1], coords[2], coords[3]);
-        }
-
-        String par = attrs.getValue("preserveAspectRatio");
-        if (par != null)
-        {
-            String[] parList = XMLParseUtil.parseStringList(par);
-
-            if (parList[0].equals("none")) { parAlignX = PA_X_NONE; parAlignY = PA_Y_NONE; }
-            else if (parList[0].equals("xMinYMin")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMidYMin")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMaxYMin")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMinYMid")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMidYMid")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMaxYMid")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMinYMax")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MAX; }
-            else if (parList[0].equals("xMidYMax")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MAX; }
-            else if (parList[0].equals("xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
-
-            if (parList[1].equals("meet")) parSpecifier = PS_MEET;
-            else if (parList[1].equals("slice")) parSpecifier = PS_SLICE;
-        }
-
-        build();
-    }
-*/
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
     
     public void build() throws SVGException
@@ -128,11 +101,23 @@
         StyleAttribute sty = new StyleAttribute();
         
-        if (getPres(sty.setName("x"))) x = sty.getNumberWithUnits();
-        
-        if (getPres(sty.setName("y"))) y = sty.getNumberWithUnits();
-        
-        if (getPres(sty.setName("width"))) width = sty.getNumberWithUnits();
-        
-        if (getPres(sty.setName("height"))) height = sty.getNumberWithUnits();
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getNumberWithUnits();
+        }
+        
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getNumberWithUnits();
+        }
+        
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getNumberWithUnits();
+        }
+        
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getNumberWithUnits();
+        }
         
         if (getPres(sty.setName("viewBox"))) 
@@ -157,24 +142,12 @@
             else if (contains(preserve, "xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
 
-            if (contains(preserve, "meet")) parSpecifier = PS_MEET;
-            else if (contains(preserve, "slice")) parSpecifier = PS_SLICE;
-            
-            /*
-            String[] parList = sty.getStringList();
-
-            if (parList[0].equals("none")) { parAlignX = PA_X_NONE; parAlignY = PA_Y_NONE; }
-            else if (parList[0].equals("xMinYMin")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMidYMin")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMaxYMin")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MIN; }
-            else if (parList[0].equals("xMinYMid")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMidYMid")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMaxYMid")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MID; }
-            else if (parList[0].equals("xMinYMax")) { parAlignX = PA_X_MIN; parAlignY = PA_Y_MAX; }
-            else if (parList[0].equals("xMidYMax")) { parAlignX = PA_X_MID; parAlignY = PA_Y_MAX; }
-            else if (parList[0].equals("xMaxYMax")) { parAlignX = PA_X_MAX; parAlignY = PA_Y_MAX; }
-
-            if (parList[1].equals("meet")) parSpecifier = PS_MEET;
-            else if (parList[1].equals("slice")) parSpecifier = PS_SLICE;
-             */
+            if (contains(preserve, "meet"))
+            {
+                parSpecifier = PS_MEET;
+            }
+            else if (contains(preserve, "slice"))
+            {
+                parSpecifier = PS_SLICE;
+            }
         }
         
@@ -185,4 +158,9 @@
     {
         return (text.indexOf(find) != -1);
+    }
+
+    public SVGRoot getRoot()
+    {
+        return this;
     }
     
@@ -195,5 +173,6 @@
         {
             defaultBounds = getBoundingBox();
-        } catch (SVGException ex)
+        }
+        catch (SVGException ex)
         {
             defaultBounds= new Rectangle2D.Float();
@@ -213,6 +192,4 @@
                 ww = StyleAttribute.convertUnitsToPixels(width.getUnits(), width.getValue());
             }
-//            setAttribute("x", AnimationElement.AT_XML, "" + xx);
-//            setAttribute("width", AnimationElement.AT_XML, "" + ww);
         }
         else if (viewBox != null)
@@ -273,10 +250,4 @@
             viewXform.translate(-viewBox.x, -viewBox.y);
         }
-
-        
-        //For now, treat all preserveAspectRatio as 'none'
-//        viewXform.setToTranslation(viewBox.x, viewBox.y);
-//        viewXform.scale(clipRect.width / viewBox.width, clipRect.height / viewBox.height);
-//        viewXform.translate(-clipRect.x, -clipRect.y);
     }
 
@@ -393,3 +364,31 @@
     }
 
+    /**
+     * @return the styleSheet
+     */
+    public StyleSheet getStyleSheet()
+    {
+        if (styleSheet == null)
+        {
+            for (int i = 0; i < getNumChildren(); ++i)
+            {
+                SVGElement ele = getChild(i);
+                if (ele instanceof Style)
+                {
+                    return ((Style)ele).getStyleSheet();
+                }
+            }
+        }
+        
+        return styleSheet;
+    }
+
+    /**
+     * @param styleSheet the styleSheet to set
+     */
+    public void setStyleSheet(StyleSheet styleSheet)
+    {
+        this.styleSheet = styleSheet;
+    }
+
 }
Index: trunk/src/com/kitfox/svg/SVGUniverse.java
===================================================================
--- trunk/src/com/kitfox/svg/SVGUniverse.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/SVGUniverse.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * SVGUniverse.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 11:43 PM
  */
-
 package com.kitfox.svg;
 
@@ -36,5 +44,4 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -46,4 +53,5 @@
 import java.net.MalformedURLException;
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -51,4 +59,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.zip.GZIPInputStream;
 import javax.imageio.ImageIO;
@@ -61,7 +71,7 @@
 
 /**
- * Many SVG files can be loaded at one time.  These files will quite likely
- * need to reference one another.  The SVG universe provides a container for
- * all these files and the means for them to relate to each other.
+ * Many SVG files can be loaded at one time. These files will quite likely need
+ * to reference one another. The SVG universe provides a container for all these
+ * files and the means for them to relate to each other.
  *
  * @author Mark McKay
@@ -70,48 +80,43 @@
 public class SVGUniverse implements Serializable
 {
+
     public static final long serialVersionUID = 0;
-    
     transient private PropertyChangeSupport changes = new PropertyChangeSupport(this);
-    
-    /**
-     * Maps document URIs to their loaded SVG diagrams.  Note that URIs for
+    /**
+     * Maps document URIs to their loaded SVG diagrams. Note that URIs for
      * documents loaded from URLs will reflect their URLs and URIs for documents
      * initiated from streams will have the scheme <i>svgSalamander</i>.
      */
     final HashMap loadedDocs = new HashMap();
-    
     final HashMap loadedFonts = new HashMap();
-    
     final HashMap loadedImages = new HashMap();
-    
     public static final String INPUTSTREAM_SCHEME = "svgSalamander";
-    
-    /**
-     * Current time in this universe.  Used for resolving attributes that
-     * are influenced by track information.  Time is in milliseconds.  Time
-     * 0 coresponds to the time of 0 in each member diagram.
+    /**
+     * Current time in this universe. Used for resolving attributes that are
+     * influenced by track information. Time is in milliseconds. Time 0
+     * coresponds to the time of 0 in each member diagram.
      */
     protected double curTime = 0.0;
-    
     private boolean verbose = false;
-
     //Cache reader for efficiency
     XMLReader cachedReader;
-    
-    /** Creates a new instance of SVGUniverse */
+
+    /**
+     * Creates a new instance of SVGUniverse
+     */
     public SVGUniverse()
     {
     }
-    
+
     public void addPropertyChangeListener(PropertyChangeListener l)
     {
         changes.addPropertyChangeListener(l);
     }
-    
+
     public void removePropertyChangeListener(PropertyChangeListener l)
     {
         changes.removePropertyChangeListener(l);
     }
-    
+
     /**
      * Release all loaded SVG document from memory
@@ -123,20 +128,20 @@
         loadedImages.clear();
     }
-    
+
     /**
      * Returns the current animation time in milliseconds.
      */
     public double getCurTime()
-    { 
-        return curTime; 
-    }
-    
+    {
+        return curTime;
+    }
+
     public void setCurTime(double curTime)
     {
         double oldTime = this.curTime;
-        this.curTime = curTime; 
+        this.curTime = curTime;
         changes.firePropertyChange("curTime", new Double(oldTime), new Double(curTime));
     }
-    
+
     /**
      * Updates all time influenced style and presentation attributes in all SVG
@@ -147,9 +152,9 @@
         for (Iterator it = loadedDocs.values().iterator(); it.hasNext();)
         {
-            SVGDiagram dia = (SVGDiagram)it.next();
+            SVGDiagram dia = (SVGDiagram) it.next();
             dia.updateTime(curTime);
         }
     }
-    
+
     /**
      * Called by the Font element to let the universe know that a font has been
@@ -160,17 +165,17 @@
         loadedFonts.put(font.getFontFace().getFontFamily(), font);
     }
-    
+
     public Font getDefaultFont()
     {
         for (Iterator it = loadedFonts.values().iterator(); it.hasNext();)
         {
-            return (Font)it.next();
+            return (Font) it.next();
         }
         return null;
     }
-    
+
     public Font getFont(String fontName)
     {
-        return (Font)loadedFonts.get(fontName);
+        return (Font) loadedFonts.get(fontName);
     }
 
@@ -188,5 +193,6 @@
             {
                 content = content.substring(6);
-                try {
+                try
+                {
                     byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(content);
                     ByteArrayInputStream bais = new ByteArrayInputStream(buf);
@@ -209,18 +215,22 @@
 
                     return url;
-                } catch (IOException ex) {
-                    ex.printStackTrace();
+                } catch (IOException ex)
+                {
+                    Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                        "Could not decode inline image", ex);
                 }
             }
             return null;
-        }
-        else
-        {
-            try {
+        } else
+        {
+            try
+            {
                 URL url = imageURI.toURL();
                 registerImage(url);
                 return url;
-            } catch (MalformedURLException ex) {
-                ex.printStackTrace();
+            } catch (MalformedURLException ex)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                    "Bad url", ex);
             }
             return null;
@@ -230,6 +240,9 @@
     void registerImage(URL imageURL)
     {
-        if (loadedImages.containsKey(imageURL)) return;
-        
+        if (loadedImages.containsKey(imageURL))
+        {
+            return;
+        }
+
         SoftReference ref;
         try
@@ -240,5 +253,5 @@
                 SVGIcon icon = new SVGIcon();
                 icon.setSvgURI(imageURL.toURI());
-                
+
                 BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
                 Graphics2D g = img.createGraphics();
@@ -246,6 +259,5 @@
                 g.dispose();
                 ref = new SoftReference(img);
-            }
-            else
+            } else
             {
                 BufferedImage img = ImageIO.read(imageURL);
@@ -253,18 +265,20 @@
             }
             loadedImages.put(imageURL, ref);
-        }
-        catch (Exception e)
-        {
-            System.err.println("Could not load image: " + imageURL);
-            e.printStackTrace();
-        }
-    }
-    
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not load image: " + imageURL, e);
+        }
+    }
+
     BufferedImage getImage(URL imageURL)
     {
-        SoftReference ref = (SoftReference)loadedImages.get(imageURL);
-        if (ref == null) return null;
-        
-        BufferedImage img = (BufferedImage)ref.get();
+        SoftReference ref = (SoftReference) loadedImages.get(imageURL);
+        if (ref == null)
+        {
+            return null;
+        }
+
+        BufferedImage img = (BufferedImage) ref.get();
         //If image was cleared from memory, reload it
         if (img == null)
@@ -273,17 +287,19 @@
             {
                 img = ImageIO.read(imageURL);
-            }
-            catch (Exception e)
-            { e.printStackTrace(); }
+            } catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                    "Could not load image", e);
+            }
             ref = new SoftReference(img);
             loadedImages.put(imageURL, ref);
         }
-        
+
         return img;
     }
-    
-    /**
-     * Returns the element of the document at the given URI.  If the document
-     * is not already loaded, it will be.
+
+    /**
+     * Returns the element of the document at the given URI. If the document is
+     * not already loaded, it will be.
      */
     public SVGElement getElement(URI path)
@@ -291,5 +307,5 @@
         return getElement(path, true);
     }
-    
+
     public SVGElement getElement(URL path)
     {
@@ -298,17 +314,17 @@
             URI uri = new URI(path.toString());
             return getElement(uri, true);
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse url " + path, e);
         }
         return null;
     }
-    
-    /**
-     * Looks up a href within our universe.  If the href refers to a document that
-     * is not loaded, it will be loaded.  The URL #target will then be checked
-     * against the SVG diagram's index and the coresponding element returned.
-     * If there is no coresponding index, null is returned.
+
+    /**
+     * Looks up a href within our universe. If the href refers to a document
+     * that is not loaded, it will be loaded. The URL #target will then be
+     * checked against the SVG diagram's index and the coresponding element
+     * returned. If there is no coresponding index, null is returned.
      */
     public SVGElement getElement(URI path, boolean loadIfAbsent)
@@ -318,6 +334,6 @@
             //Strip fragment from URI
             URI xmlBase = new URI(path.getScheme(), path.getSchemeSpecificPart(), null);
-            
-            SVGDiagram dia = (SVGDiagram)loadedDocs.get(xmlBase);
+
+            SVGDiagram dia = (SVGDiagram) loadedDocs.get(xmlBase);
             if (dia == null && loadIfAbsent)
             {
@@ -325,36 +341,45 @@
 //javax.swing.JOptionPane.showMessageDialog(null, xmlBase.toString());
                 URL url = xmlBase.toURL();
-                
+
                 loadSVG(url, false);
-                dia = (SVGDiagram)loadedDocs.get(xmlBase);
-                if (dia == null) return null;
-            }
-            
+                dia = (SVGDiagram) loadedDocs.get(xmlBase);
+                if (dia == null)
+                {
+                    return null;
+                }
+            }
+
             String fragment = path.getFragment();
             return fragment == null ? dia.getRoot() : dia.getElement(fragment);
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-            return null;
-        }
-    }
-    
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse path " + path, e);
+            return null;
+        }
+    }
+
     public SVGDiagram getDiagram(URI xmlBase)
     {
         return getDiagram(xmlBase, true);
     }
-    
-    /**
-     * Returns the diagram that has been loaded from this root.  If diagram is
+
+    /**
+     * Returns the diagram that has been loaded from this root. If diagram is
      * not already loaded, returns null.
      */
     public SVGDiagram getDiagram(URI xmlBase, boolean loadIfAbsent)
     {
-        if (xmlBase == null) return null;
-
-        SVGDiagram dia = (SVGDiagram)loadedDocs.get(xmlBase);
-        if (dia != null || !loadIfAbsent) return dia;
-        
+        if (xmlBase == null)
+        {
+            return null;
+        }
+
+        SVGDiagram dia = (SVGDiagram) loadedDocs.get(xmlBase);
+        if (dia != null || !loadIfAbsent)
+        {
+            return dia;
+        }
+
         //Load missing diagram
         try
@@ -372,21 +397,21 @@
             }
 
-            
+
             loadSVG(url, false);
-            dia = (SVGDiagram)loadedDocs.get(xmlBase);
+            dia = (SVGDiagram) loadedDocs.get(xmlBase);
             return dia;
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-        
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse", e);
+        }
+
         return null;
     }
-    
-    /**
-     * Wraps input stream in a BufferedInputStream.  If it is detected that this
+
+    /**
+     * Wraps input stream in a BufferedInputStream. If it is detected that this
      * input stream is GZIPped, also wraps in a GZIPInputStream for inflation.
-     * 
+     *
      * @param is Raw input stream
      * @return Uncompressed stream of SVG data
@@ -406,6 +431,5 @@
             GZIPInputStream iis = new GZIPInputStream(bin);
             return iis;
-        }
-        else
+        } else
         {
             //Plain text
@@ -413,14 +437,15 @@
         }
     }
-    
+
     public URI loadSVG(URL docRoot)
     {
         return loadSVG(docRoot, false);
     }
-    
+
     /**
      * Loads an SVG file and all the files it references from the URL provided.
      * If a referenced file already exists in the SVG universe, it is not
      * reloaded.
+     *
      * @param docRoot - URL to the location where this SVG file can be found.
      * @param forceLoad - if true, ignore cached diagram and reload
@@ -432,61 +457,71 @@
         {
             URI uri = new URI(docRoot.toString());
-            if (loadedDocs.containsKey(uri) && !forceLoad) return uri;
-            
+            if (loadedDocs.containsKey(uri) && !forceLoad)
+            {
+                return uri;
+            }
+
             InputStream is = docRoot.openStream();
             return loadSVG(uri, new InputSource(createDocumentInputStream(is)));
-        }
-        catch (Throwable t)
-        {
-            t.printStackTrace();
-        }
-        
+        } catch (URISyntaxException ex)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse", ex);
+        } catch (IOException e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse", e);
+        }
+
         return null;
     }
-    
-    
+
     public URI loadSVG(InputStream is, String name) throws IOException
     {
         return loadSVG(is, name, false);
     }
-    
+
     public URI loadSVG(InputStream is, String name, boolean forceLoad) throws IOException
     {
         URI uri = getStreamBuiltURI(name);
-        if (uri == null) return null;
-        if (loadedDocs.containsKey(uri) && !forceLoad) return uri;
-        
+        if (uri == null)
+        {
+            return null;
+        }
+        if (loadedDocs.containsKey(uri) && !forceLoad)
+        {
+            return uri;
+        }
+
         return loadSVG(uri, new InputSource(createDocumentInputStream(is)));
     }
-    
+
     public URI loadSVG(Reader reader, String name)
     {
         return loadSVG(reader, name, false);
     }
-    
+
     /**
      * This routine allows you to create SVG documents from data streams that
-     * may not necessarily have a URL to load from.  Since every SVG document
-     * must be identified by a unique URL, Salamander provides a method to
-     * fake this for streams by defining it's own protocol - svgSalamander -
-     * for SVG documents without a formal URL.
+     * may not necessarily have a URL to load from. Since every SVG document
+     * must be identified by a unique URL, Salamander provides a method to fake
+     * this for streams by defining it's own protocol - svgSalamander - for SVG
+     * documents without a formal URL.
      *
      * @param reader - A stream containing a valid SVG document
-     * @param name - <p>A unique name for this document.  It will be used to
+     * @param name - <p>A unique name for this document. It will be used to
      * construct a unique URI to refer to this document and perform resolution
-     * with relative URIs within this document.</p>
-     * <p>For example, a name of "/myScene" will produce the URI
-     * svgSalamander:/myScene.  "/maps/canada/toronto" will produce
-     * svgSalamander:/maps/canada/toronto.  If this second document then
-     * contained the href "../uk/london", it would resolve by default to
-     * svgSalamander:/maps/uk/london.  That is, SVG Salamander defines the
-     * URI scheme svgSalamander for it's own internal use and uses it
-     * for uniquely identfying documents loaded by stream.</p>
-     * <p>If you need to link to documents outside of this scheme, you can
-     * either supply full hrefs (eg, href="url(http://www.kitfox.com/index.html)")
-     * or put the xml:base attribute in a tag to change the defaultbase
-     * URIs are resolved against</p>
-     * <p>If a name does not start with the character '/', it will be automatically
-     * prefixed to it.</p>
+     * with relative URIs within this document.</p> <p>For example, a name of
+     * "/myScene" will produce the URI svgSalamander:/myScene.
+     * "/maps/canada/toronto" will produce svgSalamander:/maps/canada/toronto.
+     * If this second document then contained the href "../uk/london", it would
+     * resolve by default to svgSalamander:/maps/uk/london. That is, SVG
+     * Salamander defines the URI scheme svgSalamander for it's own internal use
+     * and uses it for uniquely identfying documents loaded by stream.</p> <p>If
+     * you need to link to documents outside of this scheme, you can either
+     * supply full hrefs (eg, href="url(http://www.kitfox.com/index.html)") or
+     * put the xml:base attribute in a tag to change the defaultbase URIs are
+     * resolved against</p> <p>If a name does not start with the character '/',
+     * it will be automatically prefixed to it.</p>
      * @param forceLoad - if true, ignore cached diagram and reload
      *
@@ -498,32 +533,45 @@
         //Synthesize URI for this stream
         URI uri = getStreamBuiltURI(name);
-        if (uri == null) return null;
-        if (loadedDocs.containsKey(uri) && !forceLoad) return uri;
-        
+        if (uri == null)
+        {
+            return null;
+        }
+        if (loadedDocs.containsKey(uri) && !forceLoad)
+        {
+            return uri;
+        }
+
         return loadSVG(uri, new InputSource(reader));
     }
-    
+
     /**
      * Synthesize a URI for an SVGDiagram constructed from a stream.
+     *
      * @param name - Name given the document constructed from a stream.
      */
     public URI getStreamBuiltURI(String name)
     {
-        if (name == null || name.length() == 0) return null;
-        
-        if (name.charAt(0) != '/') name = '/' + name;
-        
+        if (name == null || name.length() == 0)
+        {
+            return null;
+        }
+
+        if (name.charAt(0) != '/')
+        {
+            name = '/' + name;
+        }
+
         try
         {
             //Dummy URL for SVG documents built from image streams
             return new URI(INPUTSTREAM_SCHEME, name, null);
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-            return null;
-        }
-    }
-    
+        } catch (Exception e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not parse", e);
+            return null;
+        }
+    }
+
     private XMLReader getXMLReaderCached() throws SAXException
     {
@@ -534,22 +582,15 @@
         return cachedReader;
     }
-    
-//    protected URI loadSVG(URI xmlBase, InputStream is)
+
     protected URI loadSVG(URI xmlBase, InputSource is)
     {
         // Use an instance of ourselves as the SAX event handler
         SVGLoader handler = new SVGLoader(xmlBase, this, verbose);
-        
+
         //Place this docment in the universe before it is completely loaded
         // so that the load process can refer to references within it's current
         // document
-//System.err.println("SVGUniverse: loading dia " + xmlBase);
         loadedDocs.put(xmlBase, handler.getLoadedDiagram());
-        
-        // Use the default (non-validating) parser
-//        SAXParserFactory factory = SAXParserFactory.newInstance();
-//        factory.setValidating(false);
-//        factory.setNamespaceAware(true);
-        
+
         try
         {
@@ -564,68 +605,65 @@
                         return new InputSource(new ByteArrayInputStream(new byte[0]));
                     }
-                }
-            );
+                });
             reader.setContentHandler(handler);
             reader.parse(is);
-            
-//            SAXParser saxParser = factory.newSAXParser();
-//            saxParser.parse(new InputSource(new BufferedReader(is)), handler);
+
+            handler.getLoadedDiagram().updateTime(curTime);
             return xmlBase;
-        }
-        catch (SAXParseException sex)
+        } catch (SAXParseException sex)
         {
             System.err.println("Error processing " + xmlBase);
             System.err.println(sex.getMessage());
-            
+
             loadedDocs.remove(xmlBase);
             return null;
-        }
-        catch (Throwable t)
-        {
-            t.printStackTrace();
-        }
-        
+        } catch (Throwable e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                "Could not load SVG " + xmlBase, e);
+        }
+
         return null;
     }
-    
-    public static void main(String argv[])
-    {
-        try
-        {
-            URL url = new URL("svgSalamander", "localhost", -1, "abc.svg",
-                    new URLStreamHandler()
-            {
-                protected URLConnection openConnection(URL u)
-                {
-                    return null;
-                }
-            }
-            );
-//            URL url2 = new URL("svgSalamander", "localhost", -1, "abc.svg");
-            
-            //Investigate URI resolution
-            URI uriA, uriB, uriC, uriD, uriE;
-            
-            uriA = new URI("svgSalamander", "/names/mySpecialName", null);
-//            uriA = new URI("http://www.kitfox.com/salamander");
-//            uriA = new URI("svgSalamander://mySpecialName/grape");
-            System.err.println(uriA.toString());
-            System.err.println(uriA.getScheme());
-            
-            uriB = uriA.resolve("#begin");
-            System.err.println(uriB.toString());
-            
-            uriC = uriA.resolve("tree#boing");
-            System.err.println(uriC.toString());
-            
-            uriC = uriA.resolve("../tree#boing");
-            System.err.println(uriC.toString());
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-    }
-
+
+//    public static void main(String argv[])
+//    {
+//        try
+//        {
+//            URL url = new URL("svgSalamander", "localhost", -1, "abc.svg",
+//                    new URLStreamHandler()
+//            {
+//                protected URLConnection openConnection(URL u)
+//                {
+//                    return null;
+//                }
+//            }
+//            );
+////            URL url2 = new URL("svgSalamander", "localhost", -1, "abc.svg");
+//            
+//            //Investigate URI resolution
+//            URI uriA, uriB, uriC, uriD, uriE;
+//            
+//            uriA = new URI("svgSalamander", "/names/mySpecialName", null);
+////            uriA = new URI("http://www.kitfox.com/salamander");
+////            uriA = new URI("svgSalamander://mySpecialName/grape");
+//            System.err.println(uriA.toString());
+//            System.err.println(uriA.getScheme());
+//            
+//            uriB = uriA.resolve("#begin");
+//            System.err.println(uriB.toString());
+//            
+//            uriC = uriA.resolve("tree#boing");
+//            System.err.println(uriC.toString());
+//            
+//            uriC = uriA.resolve("../tree#boing");
+//            System.err.println(uriC.toString());
+//        }
+//        catch (Exception e)
+//        {
+//            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+//                "Could not parse", e);
+//        }
+//    }
     public boolean isVerbose()
     {
@@ -637,5 +675,5 @@
         this.verbose = verbose;
     }
-    
+
     /**
      * Uses serialization to duplicate this universe.
@@ -650,5 +688,5 @@
         ByteArrayInputStream bin = new ByteArrayInputStream(bs.toByteArray());
         ObjectInputStream is = new ObjectInputStream(bin);
-        SVGUniverse universe = (SVGUniverse)is.readObject();
+        SVGUniverse universe = (SVGUniverse) is.readObject();
         is.close();
 
Index: trunk/src/com/kitfox/svg/ShapeElement.java
===================================================================
--- trunk/src/com/kitfox/svg/ShapeElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/ShapeElement.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * ShapeElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 5:21 PM
@@ -96,4 +105,24 @@
     }
 
+    private Paint handleCurrentColor(StyleAttribute styleAttrib) throws SVGException
+    {
+        if (styleAttrib.getStringValue().equals("currentColor"))
+        {
+            StyleAttribute currentColorAttrib = new StyleAttribute();
+            if (getStyle(currentColorAttrib.setName("color")))
+            {
+                if (!currentColorAttrib.getStringValue().equals("none"))
+                {
+                    return currentColorAttrib.getColorValue();
+                }
+            }
+            return null;
+        }
+        else
+        {
+            return styleAttrib.getColorValue();
+        }
+    }
+
     protected void renderShape(Graphics2D g, Shape shape) throws SVGException
     {
@@ -120,5 +149,5 @@
             else
             {
-                fillPaint = styleAttrib.getColorValue();
+                fillPaint = handleCurrentColor(styleAttrib);
                 if (fillPaint == null)
                 {
@@ -130,5 +159,8 @@
 
                         SVGElement ele = diagram.getUniverse().getElement(uri);
-                        fillPaint = ((FillElement)ele).getPaint(bounds, xform);
+                        if (ele != null)
+                        {
+                            fillPaint = ((FillElement)ele).getPaint(bounds, xform);
+                        }
                     }
                 }
@@ -156,5 +188,5 @@
             else
             {
-                strokePaint = styleAttrib.getColorValue();
+                strokePaint = handleCurrentColor(styleAttrib);
                 if (strokePaint == null)
                 {
@@ -166,5 +198,8 @@
 
                         SVGElement ele = diagram.getUniverse().getElement(uri);
-                        strokePaint = ((FillElement)ele).getPaint(bounds, xform);
+                        if (ele != null)
+                        {
+                            strokePaint = ((FillElement)ele).getPaint(bounds, xform);
+                        }
                     }
                 }
@@ -303,5 +338,15 @@
             }
 
-            Shape strokeShape = stroke.createStrokedShape(shape);
+            Shape strokeShape;
+            AffineTransform cacheXform = g.getTransform();
+            if (vectorEffect == VECTOR_EFFECT_NON_SCALING_STROKE)
+            {
+                strokeShape = cacheXform.createTransformedShape(shape);
+                strokeShape = stroke.createStrokedShape(strokeShape);
+            }
+            else
+            {
+                strokeShape = stroke.createStrokedShape(shape);
+            }
 
             if (strokeOpacity <= 0)
@@ -309,18 +354,32 @@
                 //Do nothing
             }
-            else if (strokeOpacity < 1f)
+            else
             {
                 Composite cachedComposite = g.getComposite();
-                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, strokeOpacity));
+
+                if (strokeOpacity < 1f)
+                {
+                    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, strokeOpacity));
+                }
+
+                if (vectorEffect == VECTOR_EFFECT_NON_SCALING_STROKE)
+                {
+                    //Set to identity
+                    g.setTransform(new AffineTransform());
+                }
 
                 g.setPaint(strokePaint);
                 g.fill(strokeShape);
 
-                g.setComposite(cachedComposite);
-            }
-            else
-            {
-                g.setPaint(strokePaint);
-                g.fill(strokeShape);
+                if (vectorEffect == VECTOR_EFFECT_NON_SCALING_STROKE)
+                {
+                    //Set to identity
+                    g.setTransform(cacheXform);
+                }
+
+                if (strokeOpacity < 1f)
+                {
+                    g.setComposite(cachedComposite);
+                }
             }
         }
Index: trunk/src/com/kitfox/svg/Stop.java
===================================================================
--- trunk/src/com/kitfox/svg/Stop.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Stop.java	(revision 6002)
@@ -1,37 +1,41 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
+import java.awt.Color;
 
 /**
@@ -39,49 +43,63 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Stop extends SVGElement {
+public class Stop extends SVGElement
+{
 
+    public static final String TAG_NAME = "stop";
     float offset = 0f;
     float opacity = 1f;
     Color color = Color.black;
 
-    /** Creates a new instance of Stop */
-    public Stop() {
+    /**
+     * Creates a new instance of Stop
+     */
+    public Stop()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        String offset = attrs.getValue("offset");
-        this.offset = (float)XMLParseUtil.parseRatio(offset);
-
-        buildStop();
-    }
-    */
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
         if (getPres(sty.setName("offset")))
         {
             offset = sty.getFloatValue();
             String units = sty.getUnits();
-            if (units != null && units.equals("%")) offset /= 100f;
-            if (offset > 1) offset = 1;
-            if (offset < 0) offset = 0;
+            if (units != null && units.equals("%"))
+            {
+                offset /= 100f;
+            }
+            if (offset > 1)
+            {
+                offset = 1;
+            }
+            if (offset < 0)
+            {
+                offset = 0;
+            }
         }
-        
-        if (getStyle(sty.setName("stop-color"))) color = sty.getColorValue();
 
-        if (getStyle(sty.setName("stop-opacity"))) opacity = sty.getRatioValue();
+        if (getStyle(sty.setName("stop-color")))
+        {
+            color = sty.getColorValue();
+        }
+
+        if (getStyle(sty.setName("stop-opacity")))
+        {
+            opacity = sty.getRatioValue();
+        }
     }
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -94,5 +112,5 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("offset")))
         {
@@ -104,6 +122,6 @@
             }
         }
-        
-        if (getPres(sty.setName("stop-color")))
+
+        if (getStyle(sty.setName("stop-color")))
         {
             Color newVal = sty.getColorValue();
@@ -114,6 +132,6 @@
             }
         }
-        
-        if (getPres(sty.setName("stop-opacity")))
+
+        if (getStyle(sty.setName("stop-opacity")))
         {
             float newVal = sty.getFloatValue();
@@ -124,5 +142,5 @@
             }
         }
-        
+
         return shapeChange;
     }
Index: trunk/src/com/kitfox/svg/Style.java
===================================================================
--- trunk/src/com/kitfox/svg/Style.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Style.java	(revision 6002)
@@ -1,35 +1,41 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 19, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
+import com.kitfox.svg.xml.StyleSheet;
 
 /**
@@ -39,22 +45,26 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Style extends SVGElement {
+public class Style extends SVGElement
+{
 
+    public static final String TAG_NAME = "style";
     //Should be set to "text/css"
     String type;
     StringBuffer text = new StringBuffer();
 
-    /** Creates a new instance of Stop */
-    public Style() {
+    StyleSheet styleSheet;
+    
+    /**
+     * Creates a new instance of Stop
+     */
+    public Style()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        this.type = attrs.getValue("type");
-    }
-*/
     /**
      * Called during load process to add text scanned within a tag
@@ -63,21 +73,34 @@
     {
         this.text.append(text);
+        
+        //Invalidate style sheet
+        styleSheet = null;
     }
 
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("type"))) type = sty.getStringValue();
+
+        if (getPres(sty.setName("type")))
+        {
+            type = sty.getStringValue();
+        }
     }
-    
+
     public boolean updateTime(double curTime) throws SVGException
     {
         //Style sheet doesn't change
         return false;
-    }    
-    
+    }
+
+    public StyleSheet getStyleSheet()
+    {
+        if (styleSheet == null && text.length() > 0)
+        {
+            styleSheet = StyleSheet.parseSheet(text.toString());
+        }
+        return styleSheet;
+    }
 }
Index: trunk/src/com/kitfox/svg/Symbol.java
===================================================================
--- trunk/src/com/kitfox/svg/Symbol.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Symbol.java	(revision 6002)
@@ -1,35 +1,45 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
-import java.awt.*;
-import java.awt.geom.*;
-
-import com.kitfox.svg.xml.*;
+import com.kitfox.svg.xml.StyleAttribute;
+import java.awt.Graphics2D;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -39,45 +49,27 @@
 public class Symbol extends Group
 {
+
+    public static final String TAG_NAME = "symbol";
     AffineTransform viewXform;
     Rectangle2D viewBox;
 
-    /** Creates a new instance of Stop */
-    public Symbol() {
+    /**
+     * Creates a new instance of Stop
+     */
+    public Symbol()
+    {
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+
+    public String getTagName()
     {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+        return TAG_NAME;
+    }
 
-        String viewBoxStrn = attrs.getValue("viewBox");
-        if (viewBoxStrn != null)
-        {
-            float[] dim = XMLParseUtil.parseFloatList(viewBoxStrn);
-            viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
-        }
-    }
-*/
-    /*
-    public void loaderEndElement(SVGLoaderHelper helper)
-    {
-        if (viewBox == null)
-        {
-            viewBox = super.getBoundingBox();
-        }
-
-        //Transform pattern onto unit square
-        viewXform = new AffineTransform();
-        viewXform.scale(1.0 / viewBox.getWidth(), 1.0 / viewBox.getHeight());
-        viewXform.translate(-viewBox.getX(), -viewBox.getY());
-    }
-*/
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
 //        sty = getPres("unicode");
 //        if (sty != null) unicode = sty.getStringValue();
@@ -89,5 +81,5 @@
             viewBox = new Rectangle2D.Float(dim[0], dim[1], dim[2], dim[3]);
         }
-        
+
         if (viewBox == null)
         {
@@ -104,7 +96,8 @@
     protected boolean outsideClip(Graphics2D g) throws SVGException
     {
-        g.getClipBounds(clipBounds);
+        Shape clip = g.getClip();
+//        g.getClipBounds(clipBounds);
         Rectangle2D rect = super.getBoundingBox();
-        if (rect.intersects(clipBounds))
+        if (clip == null || clip.intersects(rect))
         {
             return false;
@@ -138,6 +131,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -147,9 +141,8 @@
 //        if (trackManager.getNumTracks() == 0) return false;
         boolean changeState = super.updateTime(curTime);
-        
+
         //View box properties do not change
-        
+
         return changeState;
     }
-
 }
Index: trunk/src/com/kitfox/svg/Text.java
===================================================================
--- trunk/src/com/kitfox/svg/Text.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Text.java	(revision 6002)
@@ -1,40 +1,52 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.font.*;
-import java.awt.geom.*;
-import java.util.*;
-import java.util.regex.*;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 //import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
-
 /**
  * @author Mark McKay
@@ -43,27 +55,22 @@
 public class Text extends ShapeElement
 {
+    public static final String TAG_NAME = "text";
     
     float x = 0;
     float y = 0;
     AffineTransform transform = null;
-    
     String fontFamily;
     float fontSize;
-    
     //List of strings and tspans containing the content of this node
     LinkedList content = new LinkedList();
-    
     Shape textShape;
-    
     public static final int TXAN_START = 0;
     public static final int TXAN_MIDDLE = 1;
     public static final int TXAN_END = 2;
     int textAnchor = TXAN_START;
-    
     public static final int TXST_NORMAL = 0;
     public static final int TXST_ITALIC = 1;
     public static final int TXST_OBLIQUE = 2;
     int fontStyle;
-    
     public static final int TXWE_NORMAL = 0;
     public static final int TXWE_BOLD = 1;
@@ -80,22 +87,28 @@
     public static final int TXWE_900 = 12;
     int fontWeight;
-    
-    /** Creates a new instance of Stop */
+
+    /**
+     * Creates a new instance of Stop
+     */
     public Text()
     {
     }
-    
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
     public void appendText(String text)
     {
         content.addLast(text);
     }
-    
+
     public void appendTspan(Tspan tspan) throws SVGElementException
     {
         super.loaderAddChild(null, tspan);
         content.addLast(tspan);
-//        tspan.setParent(this);
-    }
-    
+    }
+
     /**
      * Discard cached information
@@ -105,23 +118,10 @@
         build();
     }
-    
+
     public java.util.List getContent()
     {
         return content;
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-                //Load style string
-        super.loaderStartElement(helper, attrs, parent);
- 
-        String x = attrs.getValue("x");
-        String y = attrs.getValue("y");
-        //String transform = attrs.getValue("transform");
- 
-        this.x = XMLParseUtil.parseFloat(x);
-        this.y = XMLParseUtil.parseFloat(y);
-    }
- */
+
     /**
      * Called after the start element but before the end element to indicate
@@ -131,8 +131,8 @@
     {
         super.loaderAddChild(helper, child);
-        
+
         content.addLast(child);
     }
-    
+
     /**
      * Called during load process to add text scanned within a tag
@@ -141,23 +141,42 @@
     {
         Matcher matchWs = Pattern.compile("\\s*").matcher(text);
-        if (!matchWs.matches()) content.addLast(text);
-    }
-    
+        if (!matchWs.matches())
+        {
+            content.addLast(text);
+        }
+    }
+
     public void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-        
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-        
-        if (getStyle(sty.setName("font-family"))) fontFamily = sty.getStringValue();
-        else fontFamily = "Sans Serif";
-        
-        if (getStyle(sty.setName("font-size"))) fontSize = sty.getFloatValueWithUnits();
-        else fontSize = 12f;
-        
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getStyle(sty.setName("font-family")))
+        {
+            fontFamily = sty.getStringValue();
+        } else
+        {
+            fontFamily = "Sans Serif";
+        }
+
+        if (getStyle(sty.setName("font-size")))
+        {
+            fontSize = sty.getFloatValueWithUnits();
+        } else
+        {
+            fontSize = 12f;
+        }
+
         if (getStyle(sty.setName("font-style")))
         {
@@ -166,16 +185,16 @@
             {
                 fontStyle = TXST_NORMAL;
-            }
-            else if ("italic".equals(s))
+            } else if ("italic".equals(s))
             {
                 fontStyle = TXST_ITALIC;
-            }
-            else if ("oblique".equals(s))
+            } else if ("oblique".equals(s))
             {
                 fontStyle = TXST_OBLIQUE;
             }
-        }
-        else fontStyle = TXST_NORMAL;
-        
+        } else
+        {
+            fontStyle = TXST_NORMAL;
+        }
+
         if (getStyle(sty.setName("font-weight")))
         {
@@ -184,28 +203,38 @@
             {
                 fontWeight = TXWE_NORMAL;
-            }
-            else if ("bold".equals(s))
+            } else if ("bold".equals(s))
             {
                 fontWeight = TXWE_BOLD;
             }
-        }
-        else fontWeight = TXWE_BOLD;
-        
+        } else
+        {
+            fontWeight = TXWE_BOLD;
+        }
+
         if (getStyle(sty.setName("text-anchor")))
         {
             String s = sty.getStringValue();
-            if (s.equals("middle")) textAnchor = TXAN_MIDDLE;
-            else if (s.equals("end")) textAnchor = TXAN_END;
-            else textAnchor = TXAN_START;
-        }
-        else textAnchor = TXAN_START;
-        
+            if (s.equals("middle"))
+            {
+                textAnchor = TXAN_MIDDLE;
+            } else if (s.equals("end"))
+            {
+                textAnchor = TXAN_END;
+            } else
+            {
+                textAnchor = TXAN_START;
+            }
+        } else
+        {
+            textAnchor = TXAN_START;
+        }
+
         //text anchor
         //text-decoration
         //text-rendering
-        
+
         buildFont();
     }
-    
+
     protected void buildFont() throws SVGException
     {
@@ -232,5 +261,5 @@
                 break;
         }
-            
+
         //Get font
         Font font = diagram.getUniverse().getFont(fontFamily);
@@ -238,36 +267,40 @@
         {
 //            System.err.println("Could not load font");
-            
-            java.awt.Font sysFont = new java.awt.Font(fontFamily, style | weight, (int)fontSize);
+
+            java.awt.Font sysFont = new java.awt.Font(fontFamily, style | weight, (int) fontSize);
             buildSysFont(sysFont);
             return;
         }
-        
+
 //        font = new java.awt.Font(font.getFamily(), style | weight, font.getSize());
-        
+
 //        Area textArea = new Area();
         GeneralPath textPath = new GeneralPath();
         textShape = textPath;
-        
+
         float cursorX = x, cursorY = y;
-        
+
         FontFace fontFace = font.getFontFace();
         //int unitsPerEm = fontFace.getUnitsPerEm();
         int ascent = fontFace.getAscent();
-        float fontScale = fontSize / (float)ascent;
-        
+        float fontScale = fontSize / (float) ascent;
+
 //        AffineTransform oldXform = g.getTransform();
         AffineTransform xform = new AffineTransform();
-        
+
         for (Iterator it = content.iterator(); it.hasNext();)
         {
             Object obj = it.next();
-            
+
             if (obj instanceof String)
             {
-                String text = (String)obj;
-                
+                String text = (String) obj;
+                if (text != null)
+                {
+                    text = text.trim();
+                }
+
                 strokeWidthScalar = 1f / fontScale;
-                
+
                 for (int i = 0; i < text.length(); i++)
                 {
@@ -276,8 +309,8 @@
                     xform.scale(fontScale, fontScale);
 //                    g.transform(xform);
-                    
+
                     String unicode = text.substring(i, i + 1);
                     MissingGlyph glyph = font.getGlyph(unicode);
-                    
+
                     Shape path = glyph.getPath();
                     if (path != null)
@@ -287,16 +320,15 @@
                     }
 //                    else glyph.render(g);
-                    
+
                     cursorX += fontScale * glyph.getHorizAdvX();
-                    
+
 //                    g.setTransform(oldXform);
                 }
-                
+
                 strokeWidthScalar = 1f;
-            }
-            else if (obj instanceof Tspan)
-            {
-                Tspan tspan = (Tspan)obj;
-                
+            } else if (obj instanceof Tspan)
+            {
+                Tspan tspan = (Tspan) obj;
+
                 xform.setToIdentity();
                 xform.setToTranslation(cursorX, cursorY);
@@ -304,5 +336,5 @@
 //                tspan.setCursorX(cursorX);
 //                tspan.setCursorY(cursorY);
-                
+
                 Shape tspanShape = tspan.getShape();
                 tspanShape = xform.createTransformedShape(tspanShape);
@@ -312,7 +344,7 @@
 //                cursorY = tspan.getCursorY();
             }
-            
-        }
-        
+
+        }
+
         switch (textAnchor)
         {
@@ -333,56 +365,55 @@
         }
     }
-    
+
     private void buildSysFont(java.awt.Font font) throws SVGException
     {
         GeneralPath textPath = new GeneralPath();
         textShape = textPath;
-        
+
         float cursorX = x, cursorY = y;
-        
+
 //        FontMetrics fm = g.getFontMetrics(font);
         FontRenderContext frc = new FontRenderContext(null, true, true);
-        
+
 //        FontFace fontFace = font.getFontFace();
         //int unitsPerEm = fontFace.getUnitsPerEm();
 //        int ascent = fm.getAscent();
 //        float fontScale = fontSize / (float)ascent;
-        
+
 //        AffineTransform oldXform = g.getTransform();
         AffineTransform xform = new AffineTransform();
-        
+
         for (Iterator it = content.iterator(); it.hasNext();)
         {
             Object obj = it.next();
-            
+
             if (obj instanceof String)
             {
-                String text = (String)obj;
-                
+                String text = (String) obj;
+
                 Shape textShape = font.createGlyphVector(frc, text).getOutline(cursorX, cursorY);
                 textPath.append(textShape, false);
 //                renderShape(g, textShape);
 //                g.drawString(text, cursorX, cursorY);
-                
+
                 Rectangle2D rect = font.getStringBounds(text, frc);
-                cursorX += (float)rect.getWidth();
-            }
-            else if (obj instanceof Tspan)
+                cursorX += (float) rect.getWidth();
+            } else if (obj instanceof Tspan)
             {
                 /*
-                Tspan tspan = (Tspan)obj;
+                 Tspan tspan = (Tspan)obj;
                  
-                xform.setToIdentity();
-                xform.setToTranslation(cursorX, cursorY);
+                 xform.setToIdentity();
+                 xform.setToTranslation(cursorX, cursorY);
                  
-                Shape tspanShape = tspan.getShape();
-                tspanShape = xform.createTransformedShape(tspanShape);
-                textArea.add(new Area(tspanShape));
+                 Shape tspanShape = tspan.getShape();
+                 tspanShape = xform.createTransformedShape(tspanShape);
+                 textArea.add(new Area(tspanShape));
                  
-                cursorX += tspanShape.getBounds2D().getWidth();
+                 cursorX += tspanShape.getBounds2D().getWidth();
                  */
-                
-                
-                Tspan tspan = (Tspan)obj;
+
+
+                Tspan tspan = (Tspan) obj;
                 tspan.setCursorX(cursorX);
                 tspan.setCursorY(cursorY);
@@ -390,8 +421,8 @@
                 cursorX = tspan.getCursorX();
                 cursorY = tspan.getCursorY();
-                
-            }
-        }
-        
+
+            }
+        }
+
         switch (textAnchor)
         {
@@ -412,6 +443,5 @@
         }
     }
-    
-    
+
     public void render(Graphics2D g) throws SVGException
     {
@@ -420,18 +450,19 @@
         finishLayer(g);
     }
-    
+
     public Shape getShape()
     {
         return shapeToParent(textShape);
     }
-    
+
     public Rectangle2D getBoundingBox() throws SVGException
     {
         return boundsToParent(includeStrokeInBounds(textShape.getBounds2D()));
     }
-    
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -441,9 +472,9 @@
 //        if (trackManager.getNumTracks() == 0) return false;
         boolean changeState = super.updateTime(curTime);
-        
+
         //Get current values for parameters
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
-        
+
         if (getPres(sty.setName("x")))
         {
@@ -455,5 +486,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("y")))
         {
@@ -465,5 +496,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("font-family")))
         {
@@ -475,5 +506,5 @@
             }
         }
-        
+
         if (getPres(sty.setName("font-size")))
         {
@@ -485,6 +516,6 @@
             }
         }
-        
-        
+
+
         if (getStyle(sty.setName("font-style")))
         {
@@ -494,10 +525,8 @@
             {
                 newVal = TXST_NORMAL;
-            }
-            else if ("italic".equals(s))
+            } else if ("italic".equals(s))
             {
                 newVal = TXST_ITALIC;
-            }
-            else if ("oblique".equals(s))
+            } else if ("oblique".equals(s))
             {
                 newVal = TXST_OBLIQUE;
@@ -509,5 +538,5 @@
             }
         }
-        
+
         if (getStyle(sty.setName("font-weight")))
         {
@@ -517,6 +546,5 @@
             {
                 newVal = TXWE_NORMAL;
-            }
-            else if ("bold".equals(s))
+            } else if ("bold".equals(s))
             {
                 newVal = TXWE_BOLD;
@@ -528,5 +556,5 @@
             }
         }
-        
+
         if (shapeChange)
         {
@@ -535,5 +563,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/Title.java
===================================================================
--- trunk/src/com/kitfox/svg/Title.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Title.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 19, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
@@ -34,10 +42,20 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Title extends SVGElement {
-
+public class Title extends SVGElement
+{
+    public static final String TAG_NAME = "title";
+    
     StringBuffer text = new StringBuffer();
 
-    /** Creates a new instance of Stop */
-    public Title() {
+    /**
+     * Creates a new instance of Stop
+     */
+    public Title()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
     }
 
@@ -50,9 +68,13 @@
     }
 
-    public String getText() { return text.toString(); }
-    
+    public String getText()
+    {
+        return text.toString();
+    }
+
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/TransformableElement.java
===================================================================
--- trunk/src/com/kitfox/svg/TransformableElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/TransformableElement.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * BoundedElement.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 9:00 AM
  */
-
 package com.kitfox.svg;
 
@@ -33,5 +41,4 @@
 import java.awt.geom.Rectangle2D;
 
-
 /**
  * Maintains bounding box for this element
@@ -40,12 +47,13 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class TransformableElement extends SVGElement 
+abstract public class TransformableElement extends SVGElement
 {
+    AffineTransform xform = null;
 
-    AffineTransform xform = null;
-//    AffineTransform invXform = null;
-
-    /** Creates a new instance of BoundedElement */
-    public TransformableElement() {
+    /**
+     * Creates a new instance of BoundedElement
+     */
+    public TransformableElement()
+    {
     }
 
@@ -55,28 +63,34 @@
     }
 
+    /**
+     * Fetches a copy of the cached AffineTransform. Note that this value will
+     * only be valid after the node has been updated.
+     *
+     * @return
+     */
     public AffineTransform getXForm()
     {
-        return xform;
+        return xform != null ? new AffineTransform(xform) : null;
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
+    /*
+     public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+     {
+     //Load style string
+     super.loaderStartElement(helper, attrs, parent);
 
-        String transform = attrs.getValue("transform");
-        if (transform != null)
-        {
-            xform = parseTransform(transform);
-        }
-    }
-*/
-    
+     String transform = attrs.getValue("transform");
+     if (transform != null)
+     {
+     xform = parseTransform(transform);
+     }
+     }
+     */
+
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
+
         if (getPres(sty.setName("transform")))
         {
@@ -84,8 +98,11 @@
         }
     }
-    
+
     protected Shape shapeToParent(Shape shape)
     {
-        if (xform == null) return shape;
+        if (xform == null)
+        {
+            return shape;
+        }
         return xform.createTransformedShape(shape);
     }
@@ -93,11 +110,15 @@
     protected Rectangle2D boundsToParent(Rectangle2D rect)
     {
-        if (xform == null) return rect;
+        if (xform == null)
+        {
+            return rect;
+        }
         return xform.createTransformedShape(rect).getBounds2D();
     }
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -106,5 +127,5 @@
     {
         StyleAttribute sty = new StyleAttribute();
-        
+
         if (getPres(sty.setName("transform")))
         {
@@ -116,5 +137,5 @@
             }
         }
-        
+
         return false;
     }
Index: trunk/src/com/kitfox/svg/Tspan.java
===================================================================
--- trunk/src/com/kitfox/svg/Tspan.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Tspan.java	(revision 6002)
@@ -1,41 +1,48 @@
 /*
- * Stop.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:56 AM
  */
-
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.*;
-import java.awt.font.*;
-import java.awt.geom.*;
-import java.util.*;
-
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.font.GlyphMetrics;
+import java.awt.font.GlyphVector;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.Rectangle2D;
 
 /**
@@ -43,6 +50,8 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Tspan extends ShapeElement {
-
+public class Tspan extends ShapeElement
+{
+
+    public static final String TAG_NAME = "tspan";
     float[] x = null;
     float[] y = null;
@@ -50,18 +59,30 @@
     float[] dy = null;
     float[] rotate = null;
-
     private String text = "";
-
     float cursorX;
     float cursorY;
 
 //    Shape tspanShape;
-
-    /** Creates a new instance of Stop */
-    public Tspan() {
-    }
-
-    public float getCursorX() { return cursorX; }
-    public float getCursorY() { return cursorY; }
+    /**
+     * Creates a new instance of Stop
+     */
+    public Tspan()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
+    public float getCursorX()
+    {
+        return cursorX;
+    }
+
+    public float getCursorY()
+    {
+        return cursorY;
+    }
 
     public void setCursorX(float cursorX)
@@ -74,28 +95,28 @@
         this.cursorY = cursorY;
     }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String x = attrs.getValue("x");
-        String y = attrs.getValue("y");
-        String dx = attrs.getValue("dx");
-        String dy = attrs.getValue("dy");
-        String rotate = attrs.getValue("rotate");
-
-        if (x != null) this.x = XMLParseUtil.parseFloatList(x);
-        if (y != null) this.y = XMLParseUtil.parseFloatList(y);
-        if (dx != null) this.dx = XMLParseUtil.parseFloatList(dx);
-        if (dy != null) this.dy = XMLParseUtil.parseFloatList(dy);
-        if (rotate != null)
-        {
-            this.rotate = XMLParseUtil.parseFloatList(rotate);
-            for (int i = 0; i < this.rotate.length; i++)
-                this.rotate[i] = (float)Math.toRadians(this.rotate[i]);
-        }
-    }
-    */
+    /*
+     public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+     {
+     //Load style string
+     super.loaderStartElement(helper, attrs, parent);
+
+     String x = attrs.getValue("x");
+     String y = attrs.getValue("y");
+     String dx = attrs.getValue("dx");
+     String dy = attrs.getValue("dy");
+     String rotate = attrs.getValue("rotate");
+
+     if (x != null) this.x = XMLParseUtil.parseFloatList(x);
+     if (y != null) this.y = XMLParseUtil.parseFloatList(y);
+     if (dx != null) this.dx = XMLParseUtil.parseFloatList(dx);
+     if (dy != null) this.dy = XMLParseUtil.parseFloatList(dy);
+     if (rotate != null)
+     {
+     this.rotate = XMLParseUtil.parseFloatList(rotate);
+     for (int i = 0; i < this.rotate.length; i++)
+     this.rotate[i] = (float)Math.toRadians(this.rotate[i]);
+     }
+     }
+     */
 
     /**
@@ -107,18 +128,29 @@
     }
 
-    
     protected void build() throws SVGException
     {
         super.build();
-        
+
         StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatList();
-
-        if (getPres(sty.setName("y"))) y = sty.getFloatList();
-
-        if (getPres(sty.setName("dx"))) dx = sty.getFloatList();
-
-        if (getPres(sty.setName("dy"))) dy = sty.getFloatList();
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatList();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatList();
+        }
+
+        if (getPres(sty.setName("dx")))
+        {
+            dx = sty.getFloatList();
+        }
+
+        if (getPres(sty.setName("dy")))
+        {
+            dy = sty.getFloatList();
+        }
 
         if (getPres(sty.setName("rotate")))
@@ -127,10 +159,10 @@
             for (int i = 0; i < this.rotate.length; i++)
             {
-                rotate[i] = (float)Math.toRadians(this.rotate[i]);
-            }
-                
-        }
-    }
-    
+                rotate[i] = (float) Math.toRadians(this.rotate[i]);
+            }
+
+        }
+    }
+
     public void addShape(GeneralPath addShape) throws SVGException
     {
@@ -138,14 +170,19 @@
         {
             cursorX = x[0];
+        } else if (dx != null)
+        {
+            cursorX += dx[0];
+        }
+
+        if (y != null)
+        {
             cursorY = y[0];
-        }
-        else if (dx != null)
-        {
-            cursorX += dx[0];
+        } else if (dy != null)
+        {
             cursorY += dy[0];
         }
 
         StyleAttribute sty = new StyleAttribute();
-        
+
         String fontFamily = null;
         if (getStyle(sty.setName("font-family")))
@@ -160,4 +197,11 @@
             fontSize = sty.getFloatValueWithUnits();
         }
+
+        float letterSpacing = 0;
+        if (getStyle(sty.setName("letter-spacing")))
+        {
+            letterSpacing = sty.getFloatValueWithUnits();
+        }
+
 
         //Get font
@@ -165,5 +209,5 @@
         if (font == null)
         {
-            addShapeSysFont(addShape, font, fontFamily, fontSize);
+            addShapeSysFont(addShape, font, fontFamily, fontSize, letterSpacing);
             return;
         }
@@ -171,5 +215,5 @@
         FontFace fontFace = font.getFontFace();
         int ascent = fontFace.getAscent();
-        float fontScale = fontSize / (float)ascent;
+        float fontScale = fontSize / (float) ascent;
 
         AffineTransform xform = new AffineTransform();
@@ -184,5 +228,8 @@
             xform.setToTranslation(cursorX, cursorY);
             xform.scale(fontScale, fontScale);
-            if (rotate != null) xform.rotate(rotate[posPtr]);
+            if (rotate != null)
+            {
+                xform.rotate(rotate[posPtr]);
+            }
 
             String unicode = text.substring(i, i + 1);
@@ -200,6 +247,5 @@
                 cursorX = x[posPtr];
                 cursorY = y[posPtr++];
-            }
-            else if (dx != null && posPtr < dx.length)
+            } else if (dx != null && posPtr < dx.length)
             {
                 cursorX += dx[posPtr];
@@ -207,5 +253,5 @@
             }
 
-            cursorX += fontScale * glyph.getHorizAdvX();
+            cursorX += fontScale * glyph.getHorizAdvX() + letterSpacing;
         }
 
@@ -213,7 +259,8 @@
     }
 
-    private void addShapeSysFont(GeneralPath addShape, Font font, String fontFamily, float fontSize)
-    {
-        java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int)fontSize);
+    private void addShapeSysFont(GeneralPath addShape, Font font,
+        String fontFamily, float fontSize, float letterSpacing)
+    {
+        java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int) fontSize);
 
         FontRenderContext frc = new FontRenderContext(null, true, true);
@@ -226,6 +273,9 @@
         {
             xform.setToIdentity();
-            xform.setToTranslation(cursorX, cursorY);
-            if (rotate != null) xform.rotate(rotate[Math.min(i, rotate.length - 1)]);
+            xform.setToTranslation(cursorX + i * letterSpacing, cursorY);
+            if (rotate != null)
+            {
+                xform.rotate(rotate[Math.min(i, rotate.length - 1)]);
+            }
 
             String unicode = text.substring(i, i + 1);
@@ -240,6 +290,5 @@
                 cursorX = x[posPtr];
                 cursorY = y[posPtr++];
-            }
-            else if (dx != null && posPtr < dx.length)
+            } else if (dx != null && posPtr < dx.length)
             {
                 cursorX += dx[posPtr];
@@ -255,6 +304,5 @@
             cursorX = x[0];
             cursorY = y[0];
-        }
-        else if (dx != null)
+        } else if (dx != null)
         {
             cursorX += dx[0];
@@ -263,5 +311,5 @@
 
         StyleAttribute sty = new StyleAttribute();
-        
+
         String fontFamily = null;
         if (getPres(sty.setName("font-family")))
@@ -282,5 +330,5 @@
         {
             System.err.println("Could not load font");
-            java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int)fontSize);
+            java.awt.Font sysFont = new java.awt.Font(fontFamily, java.awt.Font.PLAIN, (int) fontSize);
             renderSysFont(g, sysFont);
             return;
@@ -290,5 +338,5 @@
         FontFace fontFace = font.getFontFace();
         int ascent = fontFace.getAscent();
-        float fontScale = fontSize / (float)ascent;
+        float fontScale = fontSize / (float) ascent;
 
         AffineTransform oldXform = g.getTransform();
@@ -312,6 +360,8 @@
             {
                 renderShape(g, path);
-            }
-            else glyph.render(g);
+            } else
+            {
+                glyph.render(g);
+            }
 
             if (x != null && posPtr < x.length)
@@ -319,6 +369,5 @@
                 cursorX = x[posPtr];
                 cursorY = y[posPtr++];
-            }
-            else if (dx != null && posPtr < dx.length)
+            } else if (dx != null && posPtr < dx.length)
             {
                 cursorX += dx[posPtr];
@@ -342,5 +391,5 @@
         renderShape(g, textShape);
         Rectangle2D rect = font.getStringBounds(text, frc);
-        cursorX += (float)rect.getWidth();
+        cursorX += (float) rect.getWidth();
     }
 
@@ -358,6 +407,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
Index: trunk/src/com/kitfox/svg/Use.java
===================================================================
--- trunk/src/com/kitfox/svg/Use.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/Use.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * LinearGradient.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 1:54 AM
  */
-
 package com.kitfox.svg;
 
@@ -39,46 +47,59 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class Use extends ShapeElement {
-
+public class Use extends ShapeElement
+{
+    public static final String TAG_NAME = "use";
+    
     float x = 0f;
     float y = 0f;
     float width = 1f;
     float height = 1f;
-
-    SVGElement href = null;
-
+//    SVGElement href = null;
+    URI href = null;
     AffineTransform refXform;
 
-    /** Creates a new instance of LinearGradient */
-    public Use() {
-    }
-/*
-    public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
-    {
-		//Load style string
-        super.loaderStartElement(helper, attrs, parent);
-
-        String x = attrs.getValue("x");
-        String y = attrs.getValue("y");
-        String width = attrs.getValue("width");
-        String height = attrs.getValue("height");
-        String href = attrs.getValue("xlink:href");
-
-        if (x != null) this.x = (float)XMLParseUtil.parseRatio(x);
-        if (y != null) this.y = (float)XMLParseUtil.parseRatio(y);
-        if (width != null) this.width = (float)XMLParseUtil.parseRatio(width);
-        if (height != null) this.height = (float)XMLParseUtil.parseRatio(height);
-
-
-        if (href != null)
-        {
-            try {
-                URI src = getXMLBase().resolve(href);
-                this.href = helper.universe.getElement(src);
-            }
-            catch (Exception e)
-            {
-                e.printStackTrace();
-            }
+    /**
+     * Creates a new instance of LinearGradient
+     */
+    public Use()
+    {
+    }
+
+    public String getTagName()
+    {
+        return TAG_NAME;
+    }
+
+    protected void build() throws SVGException
+    {
+        super.build();
+
+        StyleAttribute sty = new StyleAttribute();
+
+        if (getPres(sty.setName("x")))
+        {
+            x = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            y = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            width = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            height = sty.getFloatValueWithUnits();
+        }
+
+        if (getPres(sty.setName("xlink:href")))
+        {
+            URI src = sty.getURIValue(getXMLBase());
+            href = src;
+//            href = diagram.getUniverse().getElement(src);
         }
 
@@ -86,32 +107,6 @@
         refXform = new AffineTransform();
         refXform.translate(this.x, this.y);
-        refXform.scale(this.width, this.height);
-    }
-*/
-    protected void build() throws SVGException
-    {
-        super.build();
-        
-        StyleAttribute sty = new StyleAttribute();
-        
-        if (getPres(sty.setName("x"))) x = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("y"))) y = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("width"))) width = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("height"))) height = sty.getFloatValueWithUnits();
-
-        if (getPres(sty.setName("xlink:href")))
-        {
-            URI src = sty.getURIValue(getXMLBase());
-            href = diagram.getUniverse().getElement(src);
-        }
-        
-        //Determine use offset/scale
-        refXform = new AffineTransform();
-        refXform.translate(this.x, this.y);
-    }
-    
+    }
+
     public void render(Graphics2D g) throws SVGException
     {
@@ -122,7 +117,12 @@
         g.transform(refXform);
 
-        if (href == null || !(href instanceof RenderableElement)) return;
-
-        RenderableElement rendEle = (RenderableElement)href;
+        SVGElement ref = diagram.getUniverse().getElement(href);
+
+        if (ref == null || !(ref instanceof RenderableElement))
+        {
+            return;
+        }
+
+        RenderableElement rendEle = (RenderableElement) ref;
         rendEle.pushParentContext(this);
         rendEle.render(g);
@@ -136,7 +136,8 @@
     public Shape getShape()
     {
-        if (href instanceof ShapeElement)
-        {
-            Shape shape = ((ShapeElement)href).getShape();
+        SVGElement ref = diagram.getUniverse().getElement(href);
+        if (ref instanceof ShapeElement)
+        {
+            Shape shape = ((ShapeElement) ref).getShape();
             shape = refXform.createTransformedShape(shape);
             shape = shapeToParent(shape);
@@ -149,11 +150,12 @@
     public Rectangle2D getBoundingBox() throws SVGException
     {
-        if (href instanceof ShapeElement)
-        {
-            ShapeElement shapeEle = (ShapeElement)href;
+        SVGElement ref = diagram.getUniverse().getElement(href);
+        if (ref instanceof ShapeElement)
+        {
+            ShapeElement shapeEle = (ShapeElement) ref;
             shapeEle.pushParentContext(this);
             Rectangle2D bounds = shapeEle.getBoundingBox();
             shapeEle.popParentContext();
-            
+
             bounds = refXform.createTransformedShape(bounds).getBounds2D();
             bounds = boundsToParent(bounds);
@@ -166,6 +168,7 @@
 
     /**
-     * Updates all attributes in this diagram associated with a time event.
-     * Ie, all attributes with track information.
+     * Updates all attributes in this diagram associated with a time event. Ie,
+     * all attributes with track information.
+     *
      * @return - true if this node has changed state as a result of the time
      * update
@@ -179,67 +182,67 @@
         StyleAttribute sty = new StyleAttribute();
         boolean shapeChange = false;
+
+        if (getPres(sty.setName("x")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != x)
+            {
+                x = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("y")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != y)
+            {
+                y = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("width")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != width)
+            {
+                width = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("height")))
+        {
+            float newVal = sty.getFloatValueWithUnits();
+            if (newVal != height)
+            {
+                height = newVal;
+                shapeChange = true;
+            }
+        }
+
+        if (getPres(sty.setName("xlink:href")))
+        {
+            URI src = sty.getURIValue(getXMLBase());
+//            SVGElement newVal = diagram.getUniverse().getElement(src);
+            if (!src.equals(href))
+            {
+                href = src;
+                shapeChange = true;
+            }
+        }
+        /*
+         if (getPres(sty.setName("xlink:href")))
+         {
+         URI src = sty.getURIValue(getXMLBase());
+         href = diagram.getUniverse().getElement(src);
+         }
         
-        if (getPres(sty.setName("x")))
-        {
-            float newVal = sty.getFloatValueWithUnits();
-            if (newVal != x)
-            {
-                x = newVal;
-                shapeChange = true;
-            }
-        }
-
-        if (getPres(sty.setName("y")))
-        {
-            float newVal = sty.getFloatValueWithUnits();
-            if (newVal != y)
-            {
-                y = newVal;
-                shapeChange = true;
-            }
-        }
-
-        if (getPres(sty.setName("width")))
-        {
-            float newVal = sty.getFloatValueWithUnits();
-            if (newVal != width)
-            {
-                width = newVal;
-                shapeChange = true;
-            }
-        }
-
-        if (getPres(sty.setName("height")))
-        {
-            float newVal = sty.getFloatValueWithUnits();
-            if (newVal != height)
-            {
-                height = newVal;
-                shapeChange = true;
-            }
-        }
-        
-        if (getPres(sty.setName("xlink:href")))
-        {
-            URI src = sty.getURIValue(getXMLBase());
-            SVGElement newVal = diagram.getUniverse().getElement(src);
-            if (newVal != href)
-            {
-                href = newVal;
-                shapeChange = true;
-            }
-        }
-/*
-        if (getPres(sty.setName("xlink:href")))
-        {
-            URI src = sty.getURIValue(getXMLBase());
-            href = diagram.getUniverse().getElement(src);
-        }
-        
-        //Determine use offset/scale
-        refXform = new AffineTransform();
-        refXform.translate(this.x, this.y);
-        refXform.scale(this.width, this.height);
-*/        
+         //Determine use offset/scale
+         refXform = new AffineTransform();
+         refXform.translate(this.x, this.y);
+         refXform.scale(this.width, this.height);
+         */
         if (shapeChange)
         {
@@ -250,5 +253,5 @@
 //            return true;
         }
-        
+
         return changeState || shapeChange;
     }
Index: trunk/src/com/kitfox/svg/app/beans/SVGIcon.java
===================================================================
--- trunk/src/com/kitfox/svg/app/beans/SVGIcon.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/app/beans/SVGIcon.java	(revision 6002)
@@ -1,4 +1,34 @@
 /*
- * SVGIcon.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 21, 2005, 10:45 AM
@@ -7,11 +37,10 @@
 package com.kitfox.svg.app.beans;
 
-import javax.swing.*;
+import com.kitfox.svg.*;
 import java.awt.*;
 import java.awt.geom.*;
+import java.beans.*;
 import java.net.*;
-import java.beans.*;
-
-import com.kitfox.svg.*;
+import javax.swing.*;
 
 /**
@@ -69,5 +98,8 @@
         
         SVGDiagram diagram = svgUniverse.getDiagram(svgURI);
-        if (diagram == null) return 0;
+        if (diagram == null)
+        {
+            return 0;
+        }
         return (int)diagram.getHeight();
     }
@@ -84,5 +116,8 @@
         
         SVGDiagram diagram = svgUniverse.getDiagram(svgURI);
-        if (diagram == null) return 0;
+        if (diagram == null)
+        {
+            return 0;
+        }
         return (int)diagram.getWidth();
     }
@@ -97,6 +132,12 @@
     public void paintIcon(Component comp, Graphics gg, int x, int y)
     {
-        Graphics2D g = (Graphics2D)gg;
-        
+        //Copy graphics object so that 
+        Graphics2D g = (Graphics2D)gg.create();
+        paintIcon(comp, g, x, y);
+        g.dispose();
+    }
+    
+    private void paintIcon(Component comp, Graphics2D g, int x, int y)
+    {
         Object oldAliasHint = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antiAlias ? RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF);
@@ -118,5 +159,8 @@
         
         SVGDiagram diagram = svgUniverse.getDiagram(svgURI);
-        if (diagram == null) return;
+        if (diagram == null)
+        {
+            return;
+        }
         
         g.translate(x, y);
@@ -189,5 +233,8 @@
         
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, oldAliasHint);
-        if (oldInterpolationHint != null) g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, oldInterpolationHint);
+        if (oldInterpolationHint != null)
+        {
+            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, oldInterpolationHint);
+        }
     }
     
Index: trunk/src/com/kitfox/svg/app/data/Handler.java
===================================================================
--- trunk/src/com/kitfox/svg/app/data/Handler.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/app/data/Handler.java	(revision 6002)
@@ -1,9 +1,39 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  */
 
 package com.kitfox.svg.app.data;
 
+import com.kitfox.svg.SVGConst;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -12,4 +42,6 @@
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -36,8 +68,11 @@
             {
                 content = content.substring(7);
-                try {
+                try
+                {
                     buf = new sun.misc.BASE64Decoder().decodeBuffer(content);
-                } catch (IOException ex) {
-                    ex.printStackTrace();
+                }
+                catch (IOException e)
+                {
+                    Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
                 }
             }
Index: trunk/src/com/kitfox/svg/batik/LinearGradientPaint.java
===================================================================
--- trunk/src/com/kitfox/svg/batik/LinearGradientPaint.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/batik/LinearGradientPaint.java	(revision 6002)
@@ -9,4 +9,5 @@
 package com.kitfox.svg.batik;
 
+import com.kitfox.svg.SVGConst;
 import java.awt.Color;
 import java.awt.PaintContext;
@@ -18,4 +19,6 @@
 import java.awt.geom.Rectangle2D;
 import java.awt.image.ColorModel;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -323,7 +326,7 @@
                                                   colorSpace);
         }
-	
-        catch(NoninvertibleTransformException e) {
-            e.printStackTrace();
+        catch(NoninvertibleTransformException e)
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
             throw new IllegalArgumentException("transform should be" + 
                                                "invertible");
Index: trunk/src/com/kitfox/svg/composite/AdobeComposite.java
===================================================================
--- trunk/src/com/kitfox/svg/composite/AdobeComposite.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/composite/AdobeComposite.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * AdobeComposite.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 1, 2004, 6:40 AM
@@ -28,6 +37,9 @@
 package com.kitfox.svg.composite;
 
+import com.kitfox.svg.SVGConst;
 import java.awt.*;
 import java.awt.image.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -52,10 +64,10 @@
         if (compositeType < 0 || compositeType >= CT_LAST)
         {
-            new Exception("Invalid composite type").printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, "Invalid composite type");
         }
 
         if (extraAlpha < 0f || extraAlpha > 1f)
         {
-            new Exception("Invalid alpha").printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, "Invalid alpha");
         }
     }
Index: trunk/src/com/kitfox/svg/composite/AdobeCompositeContext.java
===================================================================
--- trunk/src/com/kitfox/svg/composite/AdobeCompositeContext.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/composite/AdobeCompositeContext.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * AdobeCompositeContext.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 1, 2004, 6:41 AM
Index: trunk/src/com/kitfox/svg/pathcmd/Arc.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Arc.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Arc.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -70,10 +79,14 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
-
-        arcTo(path, rx, ry, xAxisRot, largeArc, sweep, x + offx, y + offy, hist.history[0].x, hist.history[0].y);
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
+
+        arcTo(path, rx, ry, xAxisRot, largeArc, sweep,
+            x + offx, y + offy,
+            hist.lastPoint.x, hist.lastPoint.y);
 //        path.lineTo(x + offx, y + offy);
-        hist.setPoint(x + offx, y + offy);
+//        hist.setPoint(x + offx, y + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(x + offx, y + offy);
     }
 
@@ -243,3 +256,11 @@
         return arc;
     }
+
+    public String toString()
+    {
+        return "A " + rx + " " + ry
+             + " " + xAxisRot + " " + largeArc
+             + " " + sweep
+             + " " + x + " " + y;
+    }
 }
Index: trunk/src/com/kitfox/svg/pathcmd/BuildHistory.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/BuildHistory.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/BuildHistory.java	(revision 6002)
@@ -1,29 +1,37 @@
 /*
- * BuildHistory.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 9:18 PM
  */
-
 package com.kitfox.svg.pathcmd;
 
@@ -32,5 +40,5 @@
 /**
  * When building a path from command segments, most need to cache information
- * (such as the point finished at) for future commands.  This structure allows
+ * (such as the point finished at) for future commands. This structure allows
  * that
  *
@@ -38,31 +46,51 @@
  * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
  */
-public class BuildHistory {
+public class BuildHistory
+{
 
 //    Point2D.Float[] history = new Point2D.Float[2];
-    Point2D.Float[] history = {new Point2D.Float(), new Point2D.Float()};
-    Point2D.Float start = new Point2D.Float();
-    int length = 0;
+//    Point2D.Float[] history = {new Point2D.Float(), new Point2D.Float()};
+//    Point2D.Float start = new Point2D.Float();
+    Point2D.Float startPoint = new Point2D.Float();
+    Point2D.Float lastPoint = new Point2D.Float();
+    Point2D.Float lastKnot = new Point2D.Float();
+    boolean init;
+    //int length = 0;
 
-    /** Creates a new instance of BuildHistory */
-    public BuildHistory() {
+    /**
+     * Creates a new instance of BuildHistory
+     */
+    public BuildHistory()
+    {
     }
-
-    public void setPoint(float x, float y)
+    
+    public void setStartPoint(float x, float y)
     {
-        history[0].setLocation(x, y);
-        length = 1;
+        startPoint.setLocation(x, y);
     }
-
-    public void setStart(float x, float y)
+    
+    public void setLastPoint(float x, float y)
     {
-        start.setLocation(x, y);
+        lastPoint.setLocation(x, y);
     }
-
-    public void setPointAndKnot(float x, float y, float kx, float ky)
+    
+    public void setLastKnot(float x, float y)
     {
-        history[0].setLocation(x, y);
-        history[1].setLocation(kx, ky);
-        length = 2;
+        lastKnot.setLocation(x, y);
     }
+//    public void setPoint(float x, float y)
+//    {
+//        history[0].setLocation(x, y);
+//        length = 1;
+//    }
+//    public void setStart(float x, float y)
+//    {
+//        start.setLocation(x, y);
+//    }
+//    public void setPointAndKnot(float x, float y, float kx, float ky)
+//    {
+//        history[0].setLocation(x, y);
+//        history[1].setLocation(kx, ky);
+//        length = 2;
+//    }
 }
Index: trunk/src/com/kitfox/svg/pathcmd/Cubic.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Cubic.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Cubic.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -48,4 +57,11 @@
     }
 
+    public String toString()
+    {
+        return "C " + k1x + " " + k1y
+             + " " + k2x + " " + k2y
+             + " " + x + " " + y;
+    }
+
     public Cubic(boolean isRelative, float k1x, float k1y, float k2x, float k2y, float x, float y) {
         super(isRelative);
@@ -61,9 +77,13 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
-        path.curveTo(k1x + offx, k1y + offy, k2x + offx, k2y + offy, x + offx, y + offy);
-        hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+        path.curveTo(k1x + offx, k1y + offy,
+            k2x + offx, k2y + offy, 
+            x + offx, y + offy);
+//        hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(k2x + offx, k2y + offy);
     }
 
Index: trunk/src/com/kitfox/svg/pathcmd/CubicSmooth.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/CubicSmooth.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/CubicSmooth.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -57,11 +66,11 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
-        float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x;
-        float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y;
-        float oldX = hist.history[0].x;
-        float oldY = hist.history[0].y;
+        float oldKx = hist.lastKnot.x;
+        float oldKy = hist.lastKnot.y;
+        float oldX = hist.lastPoint.x;
+        float oldY = hist.lastPoint.y;
         //Calc knot as reflection of old knot
         float k1x = oldX * 2f - oldKx;
@@ -69,5 +78,6 @@
 
         path.curveTo(k1x, k1y, k2x + offx, k2y + offy, x + offx, y + offy);
-        hist.setPointAndKnot(x + offx, y + offy, k2x + offx, k2y + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(k2x + offx, k2y + offy);
     }
     
@@ -76,3 +86,9 @@
         return 6;
     }
+
+    public String toString()
+    {
+        return "S " + k2x + " " + k2y
+             + " " + x + " " + y;
+    }
 }
Index: trunk/src/com/kitfox/svg/pathcmd/Horizontal.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Horizontal.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Horizontal.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -43,4 +52,9 @@
     }
 
+    public String toString()
+    {
+        return "H " + x;
+    }
+
     public Horizontal(boolean isRelative, float x) {
         super(isRelative);
@@ -52,9 +66,10 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = hist.history[0].y;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = hist.lastPoint.y;
 
         path.lineTo(x + offx, offy);
-        hist.setPoint(x + offx, offy);
+        hist.setLastPoint(x + offx, offy);
+        hist.setLastKnot(x + offx, offy);
     }
     
Index: trunk/src/com/kitfox/svg/pathcmd/LineTo.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/LineTo.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/LineTo.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -54,9 +63,10 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
         path.lineTo(x + offx, y + offy);
-        hist.setPoint(x + offx, y + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(x + offx, y + offy);
     }
     
@@ -65,3 +75,8 @@
         return 2;
     }
+
+    public String toString()
+    {
+        return "L " + x + " " + y;
+    }
 }
Index: trunk/src/com/kitfox/svg/pathcmd/MoveTo.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/MoveTo.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/MoveTo.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -53,10 +62,11 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
         path.moveTo(x + offx, y + offy);
-        hist.setPoint(x + offx, y + offy);
-        hist.setStart(x + offx, y + offy);
+        hist.setStartPoint(x + offx, y + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(x + offx, y + offy);
     }
 
@@ -65,3 +75,10 @@
         return 2;
     }
+
+    public String toString()
+    {
+        return "M " + x + " " + y;
+    }
+    
+    
 }
Index: trunk/src/com/kitfox/svg/pathcmd/PathCommand.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/PathCommand.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/PathCommand.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * PathCommand.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:39 PM
Index: trunk/src/com/kitfox/svg/pathcmd/PathUtil.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/PathUtil.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/PathUtil.java	(revision 6002)
@@ -1,10 +1,36 @@
 /*
- * PathUtil.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on May 10, 2005, 5:56 AM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
  */
 
Index: trunk/src/com/kitfox/svg/pathcmd/Quadratic.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Quadratic.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Quadratic.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -46,4 +55,10 @@
     }
 
+    public String toString()
+    {
+        return "Q " + kx + " " + ky
+             + " " + x + " " + y;
+    }
+
     public Quadratic(boolean isRelative, float kx, float ky, float x, float y) {
         super(isRelative);
@@ -57,9 +72,10 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
         path.quadTo(kx + offx, ky + offy, x + offx, y + offy);
-        hist.setPointAndKnot(x + offx, y + offy, kx + offx, ky + offy);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(kx + offx, ky + offy);
     }
 
Index: trunk/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/QuadraticSmooth.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -44,4 +53,9 @@
     }
 
+    public String toString()
+    {
+        return "T " + x + " " + y;
+    }
+
     public QuadraticSmooth(boolean isRelative, float x, float y) {
         super(isRelative);
@@ -53,11 +67,11 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = isRelative ? hist.history[0].x : 0f;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = isRelative ? hist.lastPoint.x : 0f;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
-        float oldKx = hist.history.length >= 2 ? hist.history[1].x : hist.history[0].x;
-        float oldKy = hist.history.length >= 2 ? hist.history[1].y : hist.history[0].y;
-        float oldX = hist.history[0].x;
-        float oldY = hist.history[0].y;
+        float oldKx = hist.lastKnot.x;
+        float oldKy = hist.lastKnot.y;
+        float oldX = hist.lastPoint.x;
+        float oldY = hist.lastPoint.y;
         //Calc knot as reflection of old knot
         float kx = oldX * 2f - oldKx;
@@ -65,5 +79,6 @@
 
         path.quadTo(kx, ky, x + offx, y + offy);
-        hist.setPointAndKnot(x + offx, y + offy, kx, ky);
+        hist.setLastPoint(x + offx, y + offy);
+        hist.setLastKnot(kx, ky);
     }
 
Index: trunk/src/com/kitfox/svg/pathcmd/Terminal.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Terminal.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Terminal.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -43,4 +52,9 @@
     }
 
+    public String toString()
+    {
+        return "Z";
+    }
+
 
 //    public void appendPath(ExtendedGeneralPath path, BuildHistory hist)
@@ -48,5 +62,6 @@
     {
         path.closePath();
-        hist.setPoint(hist.start.x, hist.start.y);
+        hist.setLastPoint(hist.startPoint.x, hist.startPoint.y);
+        hist.setLastKnot(hist.startPoint.x, hist.startPoint.y);
     }
     
Index: trunk/src/com/kitfox/svg/pathcmd/Vertical.java
===================================================================
--- trunk/src/com/kitfox/svg/pathcmd/Vertical.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pathcmd/Vertical.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * MoveTo.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 8:40 PM
@@ -43,4 +52,9 @@
     }
 
+    public String toString()
+    {
+        return "V " + y;
+    }
+
     public Vertical(boolean isRelative, float y) {
         super(isRelative);
@@ -51,9 +65,10 @@
     public void appendPath(GeneralPath path, BuildHistory hist)
     {
-        float offx = hist.history[0].x;
-        float offy = isRelative ? hist.history[0].y : 0f;
+        float offx = hist.lastPoint.x;
+        float offy = isRelative ? hist.lastPoint.y : 0f;
 
         path.lineTo(offx, y + offy);
-        hist.setPoint(offx, y + offy);
+        hist.setLastPoint(offx, y + offy);
+        hist.setLastKnot(offx, y + offy);
     }
 
Index: trunk/src/com/kitfox/svg/pattern/PatternPaint.java
===================================================================
--- trunk/src/com/kitfox/svg/pattern/PatternPaint.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pattern/PatternPaint.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * PatternPaint.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 1, 2004, 3:37 AM
Index: trunk/src/com/kitfox/svg/pattern/PatternPaintContext.java
===================================================================
--- trunk/src/com/kitfox/svg/pattern/PatternPaintContext.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/pattern/PatternPaintContext.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * PatternPaintContext.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on April 1, 2004, 3:37 AM
@@ -28,7 +37,10 @@
 package com.kitfox.svg.pattern;
 
+import com.kitfox.svg.SVGConst;
 import java.awt.*;
 import java.awt.geom.*;
 import java.awt.image.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -66,5 +78,8 @@
             xform.concatenate(userXform.createInverse());
         }
-        catch (Exception e) { e.printStackTrace(); }
+        catch (Exception e) 
+        {
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
+        }
 
         sourceWidth = source.getWidth();
Index: trunk/src/com/kitfox/svg/xml/Base64InputStream.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/Base64InputStream.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/Base64InputStream.java	(revision 6002)
@@ -1,5 +1,34 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  */
 
Index: trunk/src/com/kitfox/svg/xml/Base64OutputStream.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/Base64OutputStream.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/Base64OutputStream.java	(revision 6002)
@@ -1,5 +1,34 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  */
 
Index: trunk/src/com/kitfox/svg/xml/Base64Util.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/Base64Util.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/Base64Util.java	(revision 6002)
@@ -1,5 +1,34 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  */
 
Index: trunk/src/com/kitfox/svg/xml/ColorTable.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/ColorTable.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/ColorTable.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * ColorTable.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 26, 2004, 4:34 AM
Index: trunk/src/com/kitfox/svg/xml/NumberWithUnits.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/NumberWithUnits.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/NumberWithUnits.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * NumberWithUnits.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 2:43 PM
Index: trunk/src/com/kitfox/svg/xml/ReadableXMLElement.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/ReadableXMLElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/ReadableXMLElement.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * LoadableObject.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 1, 2003, 1:46 AM
Index: trunk/src/com/kitfox/svg/xml/StyleAttribute.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/StyleAttribute.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/StyleAttribute.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * StyleAttribute.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on January 27, 2004, 2:53 PM
@@ -28,7 +37,10 @@
 package com.kitfox.svg.xml;
 
+import com.kitfox.svg.SVGConst;
 import java.awt.*;
+import java.io.*;
 import java.net.*;
-import java.io.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import java.util.regex.*;
 
@@ -41,5 +53,5 @@
     public static final long serialVersionUID = 0;
 
-    static final Matcher matchUrl = Pattern.compile("\\s*url\\((.*)\\)\\s*").matcher("");
+    static final Pattern patternUrl = Pattern.compile("\\s*url\\((.*)\\)\\s*");
     static final Matcher matchFpNumUnits = Pattern.compile("\\s*([-+]?((\\d*\\.\\d+)|(\\d+))([-+]?[eE]\\d+)?)\\s*(px|cm|mm|in|pc|pt|em|ex)\\s*").matcher("");
     
@@ -68,8 +80,18 @@
     }
 
-    public String getName() { return name; }
-    public StyleAttribute setName(String name) { this.name = name; return this; }
-    
-    public String getStringValue() { return stringValue; }
+    public String getName() {
+        return name;
+    }
+    
+    public StyleAttribute setName(String name)
+    {
+        this.name = name;
+        return this;
+    }
+    
+    public String getStringValue()
+    {
+        return stringValue; 
+    }
 
     public String[] getStringList() 
@@ -177,6 +199,9 @@
     public String parseURLFn()
     {
-        matchUrl.reset(stringValue);
-        if (!matchUrl.matches()) return null;
+        Matcher matchUrl = patternUrl.matcher(stringValue);
+        if (!matchUrl.matches()) 
+        {
+            return null;
+        }
         return matchUrl.group(1);
     }
@@ -191,5 +216,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
             return null;
         }
@@ -206,5 +231,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
             return null;
         }
@@ -264,5 +289,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
             return null;
         }
@@ -285,5 +310,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
         }
     }
Index: trunk/src/com/kitfox/svg/xml/StyleSheet.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/StyleSheet.java	(revision 6002)
+++ trunk/src/com/kitfox/svg/xml/StyleSheet.java	(revision 6002)
@@ -0,0 +1,67 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.kitfox.svg.xml;
+
+import com.kitfox.svg.SVGConst;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ *
+ * @author kitfox
+ */
+public class StyleSheet
+{
+    HashMap ruleMap = new HashMap();
+
+    public static StyleSheet parseSheet(String src)
+    {
+        //Implement CS parser later
+        Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+            "CSS parser not implemented yet");
+        return null;
+    }
+    
+    public void addStyleRule(StyleSheetRule rule, String value)
+    {
+        ruleMap.put(rule, value);
+    }
+    
+    public boolean getStyle(StyleAttribute attrib, String tagName, String cssClass)
+    {
+        StyleSheetRule rule = new StyleSheetRule(attrib.getName(), tagName, cssClass);
+        String value = (String)ruleMap.get(rule);
+        
+        if (value != null)
+        {
+            attrib.setStringValue(value);
+            return true;
+        }
+        
+        //Try again using just class name
+        rule = new StyleSheetRule(attrib.getName(), null, cssClass);
+        value = (String)ruleMap.get(rule);
+        
+        if (value != null)
+        {
+            attrib.setStringValue(value);
+            return true;
+        }
+        
+        //Try again using just tag name
+        rule = new StyleSheetRule(attrib.getName(), tagName, null);
+        value = (String)ruleMap.get(rule);
+        
+        if (value != null)
+        {
+            attrib.setStringValue(value);
+            return true;
+        }
+        
+        return false;
+    }
+    
+}
Index: trunk/src/com/kitfox/svg/xml/StyleSheetRule.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/StyleSheetRule.java	(revision 6002)
+++ trunk/src/com/kitfox/svg/xml/StyleSheetRule.java	(revision 6002)
@@ -0,0 +1,59 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.kitfox.svg.xml;
+
+/**
+ *
+ * @author kitfox
+ */
+public class StyleSheetRule
+{
+    final String styleName;
+    final String tag;
+    final String className;
+
+    public StyleSheetRule(String styleName, String tag, String className)
+    {
+        this.styleName = styleName;
+        this.tag = tag;
+        this.className = className;
+    }
+
+    public int hashCode()
+    {
+        int hash = 7;
+        hash = 13 * hash + (this.styleName != null ? this.styleName.hashCode() : 0);
+        hash = 13 * hash + (this.tag != null ? this.tag.hashCode() : 0);
+        hash = 13 * hash + (this.className != null ? this.className.hashCode() : 0);
+        return hash;
+    }
+
+    public boolean equals(Object obj)
+    {
+        if (obj == null)
+        {
+            return false;
+        }
+        if (getClass() != obj.getClass())
+        {
+            return false;
+        }
+        final StyleSheetRule other = (StyleSheetRule) obj;
+        if ((this.styleName == null) ? (other.styleName != null) : !this.styleName.equals(other.styleName))
+        {
+            return false;
+        }
+        if ((this.tag == null) ? (other.tag != null) : !this.tag.equals(other.tag))
+        {
+            return false;
+        }
+        if ((this.className == null) ? (other.className != null) : !this.className.equals(other.className))
+        {
+            return false;
+        }
+        return true;
+    }
+
+}
Index: trunk/src/com/kitfox/svg/xml/WritableXMLElement.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/WritableXMLElement.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/WritableXMLElement.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * LoadableObject.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on September 1, 2003, 1:46 AM
Index: trunk/src/com/kitfox/svg/xml/XMLParseUtil.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/XMLParseUtil.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/XMLParseUtil.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * XMLParseUtil.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 18, 2004, 1:49 PM
@@ -28,4 +37,5 @@
 package com.kitfox.svg.xml;
 
+import com.kitfox.svg.SVGConst;
 import org.w3c.dom.*;
 import java.awt.*;
@@ -34,4 +44,6 @@
 import java.util.regex.*;
 import java.lang.reflect.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -140,6 +152,6 @@
         catch (StringIndexOutOfBoundsException e)
         {
-            System.err.println("XMLParseUtil: regex parse problem: '" + val + "'");
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, 
+                "XMLParseUtil: regex parse problem: '" + val + "'", e);
         }
 
@@ -537,6 +549,13 @@
 
             ReadableXMLElement newObj = null;
-            try { newObj = (ReadableXMLElement)classType.newInstance(); }
-            catch (Exception e) { e.printStackTrace(); continue; }
+            try
+            {
+                newObj = (ReadableXMLElement)classType.newInstance();
+            }
+            catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
+                continue;
+            }
             newObj.read(ele, docRoot);
 
@@ -567,11 +586,4 @@
         HashMap retMap = new HashMap();
 
-/*
-        Class[] params = {Element.class, URL.class};
-        Method loadMethod = null;
-        try { loadMethod = classType.getMethod("load", params); }
-        catch (Exception e) { e.printStackTrace(); return null; }
-
- */
         NodeList nl = root.getChildNodes();
         int size = nl.getLength();
@@ -584,14 +596,15 @@
 
             ReadableXMLElement newObj = null;
-            try { newObj = (ReadableXMLElement)classType.newInstance(); }
-            catch (Exception e) { e.printStackTrace(); continue; }
+            try 
+            {
+                newObj = (ReadableXMLElement)classType.newInstance();
+            }
+            catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
+                continue;
+            }
             newObj.read(ele, docRoot);
-/*
-            Object[] args = {ele, source};
-            Object obj = null;
-            try { obj = loadMethod.invoke(null, args); }
-            catch (Exception e) { e.printStackTrace(); }
-
- */
+
             if (newObj == null) continue;
 
@@ -614,11 +627,4 @@
 
         HashSet retSet = new HashSet();
-
-        /*
-        Class[] params = {Element.class, URL.class};
-        Method loadMethod = null;
-        try { loadMethod = classType.getMethod("load", params); }
-        catch (Exception e) { e.printStackTrace(); return null; }
-        */
 
         NodeList nl = root.getChildNodes();
@@ -632,15 +638,19 @@
 
             ReadableXMLElement newObj = null;
-            try { newObj = (ReadableXMLElement)classType.newInstance(); }
-            catch (Exception e) { e.printStackTrace(); continue; }
+            try 
+            {
+                newObj = (ReadableXMLElement)classType.newInstance();
+            }
+            catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
+                continue;
+            }
             newObj.read(ele, docRoot);
-            /*
-            Object[] args = {ele, source};
-            Object obj = null;
-            try { obj = loadMethod.invoke(null, args); }
-            catch (Exception e) { e.printStackTrace(); }
-             */
-
-            if (newObj == null) continue;
+
+            if (newObj == null)
+            {
+                continue;
+            }
 
             retSet.add(newObj);
@@ -672,6 +682,13 @@
 
             ReadableXMLElement newObj = null;
-            try { newObj = (ReadableXMLElement)classType.newInstance(); }
-            catch (Exception e) { e.printStackTrace(); continue; }
+            try 
+            { 
+                newObj = (ReadableXMLElement)classType.newInstance();
+            }
+            catch (Exception e)
+            {
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
+                continue;
+            }
             newObj.read(ele, docRoot);
 
@@ -790,8 +807,4 @@
     public static HashMap parseStyle(String styleString, HashMap map) {
         final Pattern patSemi = Pattern.compile(";");
-        final Pattern patColonSpace = Pattern.compile(":");
-
-        //Strips left and right whitespace
-        final Matcher matcherContent = Pattern.compile("\\s*([^\\s](.*[^\\s])?)\\s*").matcher("");
 
         String[] styles = patSemi.split(styleString);
@@ -804,15 +817,14 @@
             }
 
-            String[] vals = patColonSpace.split(styles[i]);
-
-            matcherContent.reset(vals[0]);
-            matcherContent.matches();
-            vals[0] = matcherContent.group(1);
-
-            matcherContent.reset(vals[1]);
-            matcherContent.matches();
-            vals[1] = matcherContent.group(1);
-
-            map.put(vals[0], new StyleAttribute(vals[0], vals[1]));
+            int colon = styles[i].indexOf(':');
+            if (colon == -1)
+            {
+                continue;
+            }
+
+            String key = styles[i].substring(0, colon).trim();
+            String value = styles[i].substring(colon + 1).trim();
+
+            map.put(key, new StyleAttribute(key, value));
         }
 
Index: trunk/src/com/kitfox/svg/xml/cpx/CPXConsts.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/cpx/CPXConsts.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/cpx/CPXConsts.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * CPXConst.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 12, 2004, 12:51 PM
Index: trunk/src/com/kitfox/svg/xml/cpx/CPXInputStream.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/cpx/CPXInputStream.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/cpx/CPXInputStream.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * CPXInputStream.java
- *
- *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 12, 2004, 10:34 AM
@@ -28,8 +37,11 @@
 package com.kitfox.svg.xml.cpx;
 
+import com.kitfox.svg.SVGConst;
 import java.io.*;
 import java.util.*;
 import java.util.zip.*;
 import java.security.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.crypto.*;
 
@@ -201,5 +213,5 @@
             catch (Exception e)
             {
-                e.printStackTrace();
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
                 return -1;
             }
@@ -207,5 +219,6 @@
             if (!inflater.finished())
             {
-                new Exception("Inflation incomplete").printStackTrace();
+                Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                    "Inflation imncomplete");
             }
 
@@ -213,10 +226,11 @@
         }
 
-        try {
+        try
+        {
             return inflater.inflate(b, off, len);
         }
         catch (DataFormatException e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
             return -1;
         }
Index: trunk/src/com/kitfox/svg/xml/cpx/CPXOutputStream.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/cpx/CPXOutputStream.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/cpx/CPXOutputStream.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * CPXOutputStream.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 12, 2004, 12:50 PM
Index: trunk/src/com/kitfox/svg/xml/cpx/CPXTest.java
===================================================================
--- trunk/src/com/kitfox/svg/xml/cpx/CPXTest.java	(revision 4453)
+++ trunk/src/com/kitfox/svg/xml/cpx/CPXTest.java	(revision 6002)
@@ -1,25 +1,34 @@
 /*
- * CPXTest.java
+ * SVG Salamander
+ * Copyright (c) 2004, Mark McKay
+ * All rights reserved.
  *
+ * Redistribution and use in source and binary forms, with or 
+ * without modification, are permitted provided that the following
+ * conditions are met:
  *
- *  The Salamander Project - 2D and 3D graphics libraries in Java
- *  Copyright (C) 2004 Mark McKay
+ *   - Redistributions of source code must retain the above 
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer.
+ *   - Redistributions in binary form must reproduce the above
+ *     copyright notice, this list of conditions and the following
+ *     disclaimer in the documentation and/or other materials 
+ *     provided with the distribution.
  *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- *  This library 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
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *  Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
- *  projects can be found at http://www.kitfox.com
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * 
+ * Mark McKay can be contacted at mark@kitfox.com.  Salamander and other
+ * projects can be found at http://www.kitfox.com
  *
  * Created on February 12, 2004, 2:45 PM
@@ -28,6 +37,8 @@
 package com.kitfox.svg.xml.cpx;
 
+import com.kitfox.svg.SVGConst;
 import java.io.*;
-import java.net.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
@@ -65,5 +76,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
         }
     }
@@ -87,5 +98,5 @@
         catch (Exception e)
         {
-            e.printStackTrace();
+            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING, null, e);
         }
     }
@@ -94,5 +105,6 @@
      * @param args the command line arguments
      */
-    public static void main(String[] args) {
+    public static void main(String[] args)
+    {
         new CPXTest();
     }
