summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkitfox2007-04-12 22:35:16 +0200
committerkitfox2007-04-12 22:35:16 +0200
commit23ebe96d580929d66b7c8efc1b61226db0c7dcf9 (patch)
treef218607e111344462350292ac2a64ec05a464504
parentPseudocode for main rendering logic. Roughing in SVG structure. (diff)
downloadsvg-salamander-core-23ebe96d580929d66b7c8efc1b61226db0c7dcf9.tar.gz
svg-salamander-core-23ebe96d580929d66b7c8efc1b61226db0c7dcf9.tar.xz
svg-salamander-core-23ebe96d580929d66b7c8efc1b61226db0c7dcf9.zip
Pseudocode for main rendering logic. Roughing in SVG structure.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@11 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/SVGConstants.java22
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/renderer/SRMarkedNode.java42
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/renderer/SRTreeNode.java83
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/renderer/SurfaceManager.java236
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/DOMException.java35
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/SVGException.java35
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/ColorTable.java277
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAngle.java69
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedAngle.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedBoolean.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedDataType.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedEnumeration.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedInteger.java31
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLength.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLengthList.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumber.java31
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumberList.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedRect.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedString.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGCSSRule.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGColor.java78
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGDataType.java19
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGElement.java35
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGExternalResourcesRequired.java23
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGFitToViewBox.java29
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGICCColor.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGLangSpace.java27
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGLength.java96
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGLengthList.java24
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGList.java86
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGLocatable.java54
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGNumber.java23
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGNumberList.java24
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGRect.java34
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGRenderingIntent.java43
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGString.java23
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGStringList.java24
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGStylable.java35
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGTests.java37
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGTransformable.java25
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGURIReference.java23
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGUnitTypes.java30
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGViewSpec.java45
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/basic/SVGZoomAndPan.java37
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedPreserveAspectRatio.java22
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedTransformList.java21
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGMatrix.java127
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGPreserveAspectRatio.java89
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransform.java102
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransformList.java36
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/svg/paint/SVGPaint.java87
-rwxr-xr-xsrc/main/java/com/kitfox/salamander/writer/SVGWriter.java34
52 files changed, 2502 insertions, 0 deletions
diff --git a/src/main/java/com/kitfox/salamander/SVGConstants.java b/src/main/java/com/kitfox/salamander/SVGConstants.java
new file mode 100755
index 0000000..2e4b120
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/SVGConstants.java
@@ -0,0 +1,22 @@
+/*
+ * SVGConstants.java
+ *
+ * Created on April 12, 2007, 7:13 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander;
+
+/**
+ *
+ * @author kitfox
+ */
+public interface SVGConstants
+{
+ public static final String NAMESPACE_SVG = "http://www.w3.org/2000/svg";
+ public static final String PUBLIC_IDENTIFIER_SVG = "PUBLIC \"-//W3C//DTD SVG 1.1//EN\"";
+ public static final String SYSTEM_IDENTIFIER_SVG = "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";
+ public static final String MIME_TYPE_SVG = "image/svg+xml";
+}
diff --git a/src/main/java/com/kitfox/salamander/renderer/SRMarkedNode.java b/src/main/java/com/kitfox/salamander/renderer/SRMarkedNode.java
new file mode 100755
index 0000000..0b6aa00
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/renderer/SRMarkedNode.java
@@ -0,0 +1,42 @@
+/*
+ * SRTreeNode.java
+ *
+ * Created on April 12, 2007, 8:07 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.renderer;
+
+import com.kitfox.salamander.renderer.SRTreeNode.RenderingSurface;
+import java.awt.geom.Point2D;
+import java.util.List;
+
+/**
+ * Nodes that provide points where markers can be placed.
+ *
+ * @author kitfox
+ */
+abstract public class SRMarkedNode extends SRTreeNode
+{
+ /** Creates a new instance of SRTreeNode */
+ public SRMarkedNode()
+ {
+ }
+
+ abstract protected List<Point2D.Float> getMarkerPoints();
+
+ /**
+ * Draw content specific to this element (not including child elements)
+ */
+ protected void renderLocal(RenderingSurface surface)
+ {
+ super.renderLocal(surface);
+
+ for (Point2D.Float pt: getMarkerPoints())
+ {
+ getMarkerPoints();
+ }
+ }
+}
diff --git a/src/main/java/com/kitfox/salamander/renderer/SRTreeNode.java b/src/main/java/com/kitfox/salamander/renderer/SRTreeNode.java
new file mode 100755
index 0000000..6f88129
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/renderer/SRTreeNode.java
@@ -0,0 +1,83 @@
+/*
+ * SRTreeNode.java
+ *
+ * Created on April 12, 2007, 8:07 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.renderer;
+
+import com.kitfox.salamander.renderer.SurfaceManager.SurfaceInfo;
+import java.util.ArrayList;
+
+/**
+ *
+ * @author kitfox
+ */
+abstract public class SRTreeNode
+{
+ public static class RenderingSurface
+ {
+ }
+
+ ArrayList<SRTreeNode> children = new ArrayList<SRTreeNode>();
+
+ /** Creates a new instance of SRTreeNode */
+ public SRTreeNode()
+ {
+ }
+
+ public void addChild(SRTreeNode child)
+ {
+ children.add(child);
+ }
+
+ public boolean removeChild(SRTreeNode child)
+ {
+ return children.remove(child);
+ }
+
+ protected void render(RenderingSurface surface)
+ {
+ /*
+ if (isFiltered() || isComplexClipArea())
+ {
+ RenderingSurface oldSurf = surface;
+ //New surface initialized to transparent black
+ SurfaceInfo backing = SurfaceManager.getDefault().getSurface(width, height, surface.getGraphicsConfiguration());
+ surface = new RenderingSurface(backing);
+
+ renderLocal(surface);
+
+ for (SRTreeNode child: children)
+ {
+ child.render(surface);
+ }
+
+ applyFilters(surface);
+ applyClipArea();
+ oldSurf.overlay(surface);
+ }
+ else
+ {
+ applyClipArea();
+ renderLocal(surface);
+
+ for (SRTreeNode child: children)
+ {
+ child.render(surface);
+ }
+ }
+ */
+ }
+
+ /**
+ * Draw content specific to this element (not including child elements)
+ */
+ protected void renderLocal(RenderingSurface surface)
+ {
+ //No rendering by default
+ }
+}
diff --git a/src/main/java/com/kitfox/salamander/renderer/SurfaceManager.java b/src/main/java/com/kitfox/salamander/renderer/SurfaceManager.java
new file mode 100755
index 0000000..83cd227
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/renderer/SurfaceManager.java
@@ -0,0 +1,236 @@
+/*
+ * SurfaceManager.java
+ *
+ * Created on April 12, 2007, 8:37 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.renderer;
+
+import java.awt.AlphaComposite;
+import java.awt.Graphics2D;
+import java.awt.GraphicsConfiguration;
+import java.awt.image.BufferedImage;
+import java.lang.ref.WeakReference;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.TreeSet;
+import java.util.WeakHashMap;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SurfaceManager implements Runnable
+{
+ public class SurfaceInfo
+ {
+ private BufferedImage image;
+ private BufImgInfo info;
+
+ SurfaceInfo(BufferedImage image, BufImgInfo info)
+ {
+ this.image = image;
+ this.info = info;
+ }
+
+ public BufferedImage getBuffer()
+ {
+ return image;
+ }
+
+ /**
+ * Release resources to be recycled. Do not use the image after calling this.
+ */
+ public void dispose()
+ {
+ image = null;
+ allocatedSurfs.remove(info);
+ pooledSurfs.add(info);
+ info.touch();
+ info = null;
+ }
+ }
+
+ static class BufImgInfo implements Comparable<BufImgInfo>
+ {
+ final int width;
+ final int height;
+ final int area;
+ WeakReference<SurfaceInfo> surfRef;
+ final BufferedImage image;
+ long touchTime;
+
+ BufImgInfo(BufferedImage image)
+ {
+ this.width = image.getWidth();
+ this.height = image.getHeight();
+ this.area = width * height;
+// ref = new SoftReference(img);
+ this.image = image;
+// this.surfRef = new WeakReference<SurfaceInfo>(null);
+ }
+
+ public void attach(SurfaceInfo surf)
+ {
+ surfRef = new WeakReference(surf);
+// touch();
+ }
+
+ public int compareTo(SurfaceManager.BufImgInfo obj)
+ {
+ return area < obj.area ? -1 : (area > obj.area ? 1 : 0);
+ }
+
+ void touch()
+ {
+ touchTime = System.currentTimeMillis();
+ }
+ }
+
+ private static final SurfaceManager singleton = new SurfaceManager();
+ TreeSet<BufImgInfo> pooledSurfs = new TreeSet<BufImgInfo>();
+ HashSet<BufImgInfo> allocatedSurfs = new HashSet<BufImgInfo>();
+// WeakHashMap<SurfaceInfo, BufImgInfo> surfaces = new WeakHashMap<SurfaceInfo, BufImgInfo>();
+
+ int SWEEP_DELAY = 10000; //Every 10 seconds
+
+ /** Creates a new instance of SurfaceManager */
+ private SurfaceManager()
+ {
+ Thread thread = new Thread(this);
+ thread.setDaemon(true);
+ thread.start();
+ }
+
+ public static SurfaceManager getDefault()
+ {
+ return singleton;
+ }
+
+ /**
+ * @return a new, cleared temporary surface to render upon. Remember to call
+ * dispose() on the SurfaceInfo when you're finished with it.
+ */
+ public SurfaceInfo getSurface(int width, int height, GraphicsConfiguration gc)
+ {
+ SurfaceInfo surfInfo;
+ BufImgInfo bufInfo = null;
+ int targetArea = width * height;
+
+ //Search for exising surface
+ Iterator<BufImgInfo> it = pooledSurfs.iterator();
+ for (; it.hasNext();)
+ {
+ BufImgInfo info = it.next();
+ if (info.area >= targetArea)
+ {
+ if (info.width >= width && info.height >= height)
+ {
+ bufInfo = info;
+ }
+ break;
+ }
+ }
+
+ if (bufInfo == null)
+ {
+ for (; it.hasNext();)
+ {
+ BufImgInfo info = it.next();
+ if (info.area / 2 <= targetArea)
+ {
+ //Do not use exceptionally poorly fit buffers
+ break;
+ }
+ if (info.width >= width && info.height >= height)
+ {
+ bufInfo = info;
+ break;
+ }
+ }
+ }
+
+ if (bufInfo != null)
+ {
+ //Refurbish
+// BufferedImage img = bufInfo.ref.get();
+ BufferedImage img = bufInfo.image;
+
+ Graphics2D g = img.createGraphics();
+
+ g.setComposite(AlphaComposite.Clear);
+ g.fillRect(0, 0, width, height);
+
+ g.dispose();
+
+ surfInfo = new SurfaceInfo(img.getSubimage(0, 0, width, height), bufInfo);
+// surfaces.put(surfInfo, bufInfo);
+ allocatedSurfs.add(bufInfo);
+ pooledSurfs.remove(bufInfo);
+ }
+ else
+ {
+ //Create a new surface
+ BufferedImage img;
+ if (gc.getColorModel().hasAlpha())
+ {
+ img = gc.createCompatibleImage(width, height);
+ }
+ else
+ {
+ img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+ }
+
+ bufInfo = new BufImgInfo(img);
+ surfInfo = new SurfaceInfo(img, bufInfo);
+// surfaces.put(surfInfo, bufInfo);
+ allocatedSurfs.add(bufInfo);
+ }
+
+ bufInfo.attach(surfInfo);
+ return surfInfo;
+ }
+
+ public void run()
+ {
+ while (true)
+ {
+ /*
+ //Clean up memory leaked images
+ for (Iterator<BufImgInfo> it = allocatedSurfs.iterator(); it.hasNext();)
+ {
+ BufImgInfo info = it.next();
+ if (info.surfRef.get() == null)
+ {
+ it.remove();
+ pooledSurfs.add(info);
+ info.touch();
+ }
+ }
+ */
+
+ //Kill out of date pooled surfaces
+ long curTime = System.currentTimeMillis();
+ for (Iterator<BufImgInfo> it = pooledSurfs.iterator(); it.hasNext();)
+ {
+ BufImgInfo info = it.next();
+ if ((curTime - info.touchTime) > SWEEP_DELAY)
+ {
+ it.remove();
+ }
+ }
+
+ try
+ {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/DOMException.java b/src/main/java/com/kitfox/salamander/svg/DOMException.java
new file mode 100755
index 0000000..06c4615
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/DOMException.java
@@ -0,0 +1,35 @@
+/*
+ * SVGException.java
+ *
+ * Created on April 12, 2007, 1:15 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public class DOMException extends java.lang.Exception
+{
+
+ /**
+ * Creates a new instance of <code>SVGException</code> without detail message.
+ */
+ public DOMException()
+ {
+ }
+
+
+ /**
+ * Constructs an instance of <code>SVGException</code> with the specified detail message.
+ * @param msg the detail message.
+ */
+ public DOMException(String msg)
+ {
+ super(msg);
+ }
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/SVGException.java b/src/main/java/com/kitfox/salamander/svg/SVGException.java
new file mode 100755
index 0000000..3133adf
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/SVGException.java
@@ -0,0 +1,35 @@
+/*
+ * SVGException.java
+ *
+ * Created on April 12, 2007, 1:15 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGException extends java.lang.Exception
+{
+
+ /**
+ * Creates a new instance of <code>SVGException</code> without detail message.
+ */
+ public SVGException()
+ {
+ }
+
+
+ /**
+ * Constructs an instance of <code>SVGException</code> with the specified detail message.
+ * @param msg the detail message.
+ */
+ public SVGException(String msg)
+ {
+ super(msg);
+ }
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/ColorTable.java b/src/main/java/com/kitfox/salamander/svg/basic/ColorTable.java
new file mode 100755
index 0000000..3f6a487
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/ColorTable.java
@@ -0,0 +1,277 @@
+/*
+ * 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
+ *
+ * Created on January 26, 2004, 4:34 AM
+ */
+
+package com.kitfox.svg.xml;
+
+import java.awt.*;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Mark McKay
+ * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
+ */
+public class ColorTable
+{
+
+ static final Map colorTable;
+ static {
+ HashMap table = new HashMap();
+ table.put("aliceblue", new Color(240, 248, 255));
+ table.put("antiquewhite", new Color(250, 235, 215));
+ table.put("aqua", new Color(0, 255, 255));
+ table.put("aquamarine", new Color(127, 255, 212));
+ table.put("azure", new Color(240, 255, 255));
+ table.put("beige", new Color(245, 245, 220));
+ table.put("bisque", new Color(255, 228, 196));
+ table.put("black", new Color(0, 0, 0));
+ table.put("blanchedalmond", new Color(255, 235, 205));
+ table.put("blue", new Color(0, 0, 255));
+ table.put("blueviolet", new Color(138, 43, 226));
+ table.put("brown", new Color(165, 42, 42));
+ table.put("burlywood", new Color(222, 184, 135));
+ table.put("cadetblue", new Color(95, 158, 160));
+ table.put("chartreuse", new Color(127, 255, 0));
+ table.put("chocolate", new Color(210, 105, 30));
+ table.put("coral", new Color(255, 127, 80));
+ table.put("cornflowerblue", new Color(100, 149, 237));
+ table.put("cornsilk", new Color(255, 248, 220));
+ table.put("crimson", new Color(220, 20, 60));
+ table.put("cyan", new Color(0, 255, 255));
+ table.put("darkblue", new Color(0, 0, 139));
+ table.put("darkcyan", new Color(0, 139, 139));
+ table.put("darkgoldenrod", new Color(184, 134, 11));
+ table.put("darkgray", new Color(169, 169, 169));
+ table.put("darkgreen", new Color(0, 100, 0));
+ table.put("darkgrey", new Color(169, 169, 169));
+ table.put("darkkhaki", new Color(189, 183, 107));
+ table.put("darkmagenta", new Color(139, 0, 139));
+ table.put("darkolivegreen", new Color(85, 107, 47));
+ table.put("darkorange", new Color(255, 140, 0));
+ table.put("darkorchid", new Color(153, 50, 204));
+ table.put("darkred", new Color(139, 0, 0));
+ table.put("darksalmon", new Color(233, 150, 122));
+ table.put("darkseagreen", new Color(143, 188, 143));
+ table.put("darkslateblue", new Color(72, 61, 139));
+ table.put("darkslategray", new Color(47, 79, 79));
+ table.put("darkslategrey", new Color(47, 79, 79));
+ table.put("darkturquoise", new Color(0, 206, 209));
+ table.put("darkviolet", new Color(148, 0, 211));
+ table.put("deeppink", new Color(255, 20, 147));
+ table.put("deepskyblue", new Color(0, 191, 255));
+ table.put("dimgray", new Color(105, 105, 105));
+ table.put("dimgrey", new Color(105, 105, 105));
+ table.put("dodgerblue", new Color(30, 144, 255));
+ table.put("firebrick", new Color(178, 34, 34));
+ table.put("floralwhite", new Color(255, 250, 240));
+ table.put("forestgreen", new Color(34, 139, 34));
+ table.put("fuchsia", new Color(255, 0, 255));
+ table.put("gainsboro", new Color(220, 220, 220));
+ table.put("ghostwhite", new Color(248, 248, 255));
+ table.put("gold", new Color(255, 215, 0));
+ table.put("goldenrod", new Color(218, 165, 32));
+ table.put("gray", new Color(128, 128, 128));
+ table.put("grey", new Color(128, 128, 128));
+ table.put("green", new Color(0, 128, 0));
+ table.put("greenyellow", new Color(173, 255, 47));
+ table.put("honeydew", new Color(240, 255, 240));
+ table.put("hotpink", new Color(255, 105, 180));
+ table.put("indianred", new Color(205, 92, 92));
+ table.put("indigo", new Color(75, 0, 130));
+ table.put("ivory", new Color(255, 255, 240));
+ table.put("khaki", new Color(240, 230, 140));
+ table.put("lavender", new Color(230, 230, 250));
+ table.put("lavenderblush", new Color(255, 240, 245));
+ table.put("lawngreen", new Color(124, 252, 0));
+ table.put("lemonchiffon", new Color(255, 250, 205));
+ table.put("lightblue", new Color(173, 216, 230));
+ table.put("lightcoral", new Color(240, 128, 128));
+ table.put("lightcyan", new Color(224, 255, 255));
+ table.put("lightgoldenrodyellow", new Color(250, 250, 210));
+ table.put("lightgray", new Color(211, 211, 211));
+ table.put("lightgreen", new Color(144, 238, 144));
+ table.put("lightgrey", new Color(211, 211, 211));
+ table.put("lightpink", new Color(255, 182, 193));
+ table.put("lightsalmon", new Color(255, 160, 122));
+ table.put("lightseagreen", new Color(32, 178, 170));
+ table.put("lightskyblue", new Color(135, 206, 250));
+ table.put("lightslategray", new Color(119, 136, 153));
+ table.put("lightslategrey", new Color(119, 136, 153));
+ table.put("lightsteelblue", new Color(176, 196, 222));
+ table.put("lightyellow", new Color(255, 255, 224));
+ table.put("lime", new Color(0, 255, 0));
+ table.put("limegreen", new Color(50, 205, 50));
+ table.put("linen", new Color(250, 240, 230));
+ table.put("magenta", new Color(255, 0, 255));
+ table.put("maroon", new Color(128, 0, 0));
+ table.put("mediumaquamarine", new Color(102, 205, 170));
+ table.put("mediumblue", new Color(0, 0, 205));
+ table.put("mediumorchid", new Color(186, 85, 211));
+ table.put("mediumpurple", new Color(147, 112, 219));
+ table.put("mediumseagreen", new Color(60, 179, 113));
+ table.put("mediumslateblue", new Color(123, 104, 238));
+ table.put("mediumspringgreen", new Color(0, 250, 154));
+ table.put("mediumturquoise", new Color(72, 209, 204));
+ table.put("mediumvioletred", new Color(199, 21, 133));
+ table.put("midnightblue", new Color(25, 25, 112));
+ table.put("mintcream", new Color(245, 255, 250));
+ table.put("mistyrose", new Color(255, 228, 225));
+ table.put("moccasin", new Color(255, 228, 181));
+ table.put("navajowhite", new Color(255, 222, 173));
+ table.put("navy", new Color(0, 0, 128));
+ table.put("oldlace", new Color(253, 245, 230));
+ table.put("olive", new Color(128, 128, 0));
+ table.put("olivedrab", new Color(107, 142, 35));
+ table.put("orange", new Color(255, 165, 0));
+ table.put("orangered", new Color(255, 69, 0));
+ table.put("orchid", new Color(218, 112, 214));
+ table.put("palegoldenrod", new Color(238, 232, 170));
+ table.put("palegreen", new Color(152, 251, 152));
+ table.put("paleturquoise", new Color(175, 238, 238));
+ table.put("palevioletred", new Color(219, 112, 147));
+ table.put("papayawhip", new Color(255, 239, 213));
+ table.put("peachpuff", new Color(255, 218, 185));
+ table.put("peru", new Color(205, 133, 63));
+ table.put("pink", new Color(255, 192, 203));
+ table.put("plum", new Color(221, 160, 221));
+ table.put("powderblue", new Color(176, 224, 230));
+ table.put("purple", new Color(128, 0, 128));
+ table.put("red", new Color(255, 0, 0));
+ table.put("rosybrown", new Color(188, 143, 143));
+ table.put("royalblue", new Color(65, 105, 225));
+ table.put("saddlebrown", new Color(139, 69, 19));
+ table.put("salmon", new Color(250, 128, 114));
+ table.put("sandybrown", new Color(244, 164, 96));
+ table.put("seagreen", new Color(46, 139, 87));
+ table.put("seashell", new Color(255, 245, 238));
+ table.put("sienna", new Color(160, 82, 45));
+ table.put("silver", new Color(192, 192, 192));
+ table.put("skyblue", new Color(135, 206, 235));
+ table.put("slateblue", new Color(106, 90, 205));
+ table.put("slategray", new Color(112, 128, 144));
+ table.put("slategrey", new Color(112, 128, 144));
+ table.put("snow", new Color(255, 250, 250));
+ table.put("springgreen", new Color(0, 255, 127));
+ table.put("steelblue", new Color(70, 130, 180));
+ table.put("tan", new Color(210, 180, 140));
+ table.put("teal", new Color(0, 128, 128));
+ table.put("thistle", new Color(216, 191, 216));
+ table.put("tomato", new Color(255, 99, 71));
+ table.put("turquoise", new Color(64, 224, 208));
+ table.put("violet", new Color(238, 130, 238));
+ table.put("wheat", new Color(245, 222, 179));
+ table.put("white", new Color(255, 255, 255));
+ table.put("whitesmoke", new Color(245, 245, 245));
+ table.put("yellow", new Color(255, 255, 0));
+ table.put("yellowgreen", new Color(154, 205, 50));
+
+ colorTable = Collections.unmodifiableMap(table);
+ }
+
+ static ColorTable singleton = new ColorTable();
+
+ /** Creates a new instance of ColorTable */
+ protected ColorTable() {
+// buildColorList();
+ }
+
+ static public ColorTable instance() { return singleton; }
+
+ public Color lookupColor(String name) {
+ Object obj = colorTable.get(name.toLowerCase());
+ if (obj == null) return null;
+
+ return (Color)obj;
+ }
+
+ public static Color parseColor(String val)
+ {
+ Color retVal = null;
+
+ if (val.charAt(0) == '#')
+ {
+ String hexStrn = val.substring(1);
+
+ if (hexStrn.length() == 3)
+ {
+ hexStrn = "" + hexStrn.charAt(0) + hexStrn.charAt(0) + hexStrn.charAt(1) + hexStrn.charAt(1) + hexStrn.charAt(2) + hexStrn.charAt(2);
+ }
+ int hexVal = parseHex(hexStrn);
+
+ retVal = new Color(hexVal);
+ }
+ else
+ {
+ final Matcher rgbMatch = Pattern.compile("rgb\\((\\d+),(\\d+),(\\d+)\\)", Pattern.CASE_INSENSITIVE).matcher("");
+
+ rgbMatch.reset(val);
+ if (rgbMatch.matches())
+ {
+ int r = Integer.parseInt(rgbMatch.group(1));
+ int g = Integer.parseInt(rgbMatch.group(2));
+ int b = Integer.parseInt(rgbMatch.group(3));
+ retVal = new Color(r, g, b);
+ }
+ else
+ {
+ Color lookupCol = ColorTable.instance().lookupColor(val);
+ if (lookupCol != null) retVal = lookupCol;
+ }
+ }
+
+ return retVal;
+ }
+
+ public static int parseHex(String val)
+ {
+ int retVal = 0;
+
+ for (int i = 0; i < val.length(); i++)
+ {
+ retVal <<= 4;
+
+ char ch = val.charAt(i);
+ if (ch >= '0' && ch <= '9')
+ {
+ retVal |= ch - '0';
+ }
+ else if (ch >= 'a' && ch <= 'z')
+ {
+ retVal |= ch - 'a' + 10;
+ }
+ else if (ch >= 'A' && ch <= 'Z')
+ {
+ retVal |= ch - 'A' + 10;
+ }
+ else throw new RuntimeException();
+ }
+
+ return retVal;
+ }
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAngle.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAngle.java
new file mode 100755
index 0000000..2bb0beb
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAngle.java
@@ -0,0 +1,69 @@
+/*
+ * SVGAngle.java
+ *
+ * Created on April 12, 2007, 1:55 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * The SVGAngle interface corresponds to the &lt;angle&gt; basic data type.
+ * @author kitfox
+ */
+public interface SVGAngle extends SVGDataType
+{
+ public static enum Type {
+ /**
+ * The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * No unit type was provided (i.e., a unitless value was specified). For angles, a unitless value is treated the same as if degrees were specified.
+ */
+ UNSPECIFIED,
+ /**
+ * The unit type was explicitly set to degrees.
+ */
+ DEG,
+ /**
+ * The unit type is radians.
+ */
+ RAD,
+ /**
+ * The unit type is grads.
+ */
+ GRAD};
+
+ /**
+ * The type of the value as specified by one of the constants specified above.
+ */
+ public Type getUnitType();
+ /**
+ * The angle value as a floating point value, in degrees. Setting this attribute will cause valueInSpecifiedUnits and valueAsString to be updated automatically to reflect this setting.
+ */
+ public float getValue();
+ /**
+ * The angle value as a floating point value, in the units expressed by unitType. Setting this attribute will cause value and valueAsString to be updated automatically to reflect this setting.
+ */
+ public float getValueInSpecifiedUnits();
+ /**
+ * The angle value as a string value, in the units expressed by unitType. Setting this attribute will cause value and valueInSpecifiedUnits to be updated automatically to reflect this setting.
+ */
+ public SVGString getValueAsString();
+
+ /**
+ * Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
+ * @param unitType The unitType for the angle value (e.g., SVG_ANGLETYPE_DEG).
+ * @param valueInSpecifiedUnits The angle value.
+ */
+ public void newValueSpecifiedUnits(Type unitType, float valueInSpecifiedUnits);
+ /**
+ * Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueAsSpecified and valueAsString might be modified as a result of this method.
+ * @param unitType The unitType to switch to (e.g., SVG_ANGLETYPE_DEG).
+ */
+ public void convertToSpecifiedUnits(Type unitType);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedAngle.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedAngle.java
new file mode 100755
index 0000000..ebdef4d
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedAngle.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedAngle.java
+ *
+ * Created on April 12, 2007, 1:59 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Corresponds to all properties and attributes whose values can be basic type 'angle' and which are animatable.
+ * @author kitfox
+ */
+public interface SVGAnimatedAngle extends SVGAnimatedDataType<SVGAngle>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedBoolean.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedBoolean.java
new file mode 100755
index 0000000..dd76748
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedBoolean.java
@@ -0,0 +1,27 @@
+/*
+ * SVGAnimatedInteger.java
+ *
+ * Created on April 12, 2007, 12:48 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ * Used for attributes of type boolean which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedBoolean
+{
+ /**
+ * The base value of the given attribute before applying any animations.
+ */
+ public boolean getBaseVal();
+
+ /**
+ * If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as 'baseVal'.
+ */
+ public boolean getAnimVal();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedDataType.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedDataType.java
new file mode 100755
index 0000000..5e2c55f
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedDataType.java
@@ -0,0 +1,27 @@
+/*
+ * SVGAnimatedAngle.java
+ *
+ * Created on April 12, 2007, 1:59 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Corresponds to all properties and attributes whose values can be basic type 'angle' and which are animatable.
+ * @author kitfox
+ */
+public interface SVGAnimatedDataType<T extends SVGDataType>
+{
+ /**
+ * The base value of the given attribute before applying any animations.
+ */
+ public T getBaseVal();
+ /**
+ * If the given attribute or property is being animated, contains the current animated value of the attribute or property, and both the object itself and its contents are readonly. If the given attribute or property is not currently being animated, contains the same value as 'baseVal'.
+ */
+ public T getAnimVal();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedEnumeration.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedEnumeration.java
new file mode 100755
index 0000000..cc79e8c
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedEnumeration.java
@@ -0,0 +1,27 @@
+/*
+ * SVGAnimatedString.java
+ *
+ * Created on April 12, 2007, 2:20 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of type DOMString which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedEnumeration
+{
+ /**
+ * The base value of the given attribute before applying any animations.
+ */
+ public Enum getBaseVal();
+ /**
+ * If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as 'baseVal'.
+ */
+ public Enum getAnimVal();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedInteger.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedInteger.java
new file mode 100755
index 0000000..0603ca4
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedInteger.java
@@ -0,0 +1,31 @@
+/*
+ * SVGAnimatedInteger.java
+ *
+ * Created on April 12, 2007, 12:48 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of basic type 'integer' which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedInteger
+{
+ /**
+ * The base value of the given attribute before applying any animations.
+ */
+ public int getBaseVal();
+
+ /**
+ * If the given attribute or property is being animated, contains the
+ * current animated value of the attribute or property. If the given
+ * attribute or property is not currently being animated, contains the
+ * same value as 'baseVal'.
+ */
+ public int getAnimVal();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLength.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLength.java
new file mode 100755
index 0000000..c43def6
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLength.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedInteger.java
+ *
+ * Created on April 12, 2007, 12:48 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of basic type 'length' which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedLength extends SVGAnimatedDataType<SVGLength>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLengthList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLengthList.java
new file mode 100755
index 0000000..63a38e4
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedLengthList.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedTransformList.java
+ *
+ * Created on April 12, 2007, 2:19 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for the various attributes which specify a set of transformations, such as the transform attribute which is available for many of SVG's elements, and which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedLengthList extends SVGAnimatedDataType<SVGLengthList>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumber.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumber.java
new file mode 100755
index 0000000..e971e56
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumber.java
@@ -0,0 +1,31 @@
+/*
+ * SVGAnimatedInteger.java
+ *
+ * Created on April 12, 2007, 12:48 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of basic type 'number' which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedNumber
+{
+ /**
+ * The base value of the given attribute before applying any animations.
+ */
+ public float getBaseVal();
+
+ /**
+ * If the given attribute or property is being animated, contains the
+ * current animated value of the attribute or property. If the given
+ * attribute or property is not currently being animated, contains the
+ * same value as 'baseVal'.
+ */
+ public float getAnimVal();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumberList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumberList.java
new file mode 100755
index 0000000..35cfa28
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedNumberList.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedTransformList.java
+ *
+ * Created on April 12, 2007, 2:19 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for the various attributes which specify a set of transformations, such as the transform attribute which is available for many of SVG's elements, and which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedNumberList extends SVGAnimatedDataType<SVGNumberList>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedRect.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedRect.java
new file mode 100755
index 0000000..810632f
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedRect.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedString.java
+ *
+ * Created on April 12, 2007, 2:20 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of type DOMString which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedRect extends SVGAnimatedDataType<SVGRect>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedString.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedString.java
new file mode 100755
index 0000000..e105b7d
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGAnimatedString.java
@@ -0,0 +1,19 @@
+/*
+ * SVGAnimatedString.java
+ *
+ * Created on April 12, 2007, 2:20 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of type DOMString which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedString extends SVGAnimatedDataType<SVGString>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGCSSRule.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGCSSRule.java
new file mode 100755
index 0000000..1997b14
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGCSSRule.java
@@ -0,0 +1,27 @@
+/*
+ * SVGCSSRule.java
+ *
+ * Created on April 12, 2007, 3:27 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import org.w3c.dom.css.CSSRule;
+
+/**
+ *
+ * SVG extends interface CSSRule with interface SVGCSSRule by adding an SVGColorProfileRule rule to allow for specification of ICC-based color.
+ *
+ * It is likely that this extension will become part of a future version of CSS and DOM.
+ * @author kitfox
+ */
+public interface SVGCSSRule extends CSSRule
+{
+ /**
+ * The rule is an @color-profile.
+ */
+ public static final short COLOR_PROFILE_RULE = 7;
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGColor.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGColor.java
new file mode 100755
index 0000000..c7dc25b
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGColor.java
@@ -0,0 +1,78 @@
+/*
+ * SVGColor.java
+ *
+ * Created on April 12, 2007, 2:02 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.SVGException;
+import org.w3c.dom.css.CSSValue;
+import org.w3c.dom.css.RGBColor;
+
+/**
+ *
+ * The SVGColor interface corresponds to color value definition for properties 'stop-color', 'flood-color' and 'lighting-color' and is a base class for interface SVGPaint. It incorporates SVG's extended notion of color, which incorporates ICC-based color specifications.
+ *
+ * Interface SVGColor does not correspond to the <color> basic data type. For the <color> basic data type, the applicable DOM interfaces are defined in [DOM2-CSS]; in particular, see the [DOM2-CSS-RGBCOLOR].
+ * @author kitfox
+ */
+public interface SVGColor extends SVGDataType, CSSValue
+{
+ public static enum Type {
+ /**
+ * The color type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * An sRGB color has been specified without an alternative ICC color specification.
+ */
+ RGBCOLOR,
+ /**
+ * An sRGB color has been specified along with an alternative ICC color specification.
+ */
+ RGBCOLOR_ICCCOLOR,
+ /**
+ * Corresponds to when keyword 'currentColor' has been specified.
+ */
+ CURRENTCOLOR};
+
+ /**
+ * The type of the value as specified by one of the constants specified above.
+ */
+ public Type getColorType();
+ /**
+ * The color specified in the sRGB color space.
+ */
+ public RGBColor getRGBColor();
+ /**
+ * The alternate ICC color specification.
+ */
+ public SVGICCColor getICCColor();
+
+ /**
+ * Modifies the color value to be the specified sRGB color without an alternate ICC color specification.
+ * @param rgbColor The new color value.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_INVALID_VALUE_ERR: Raised if one of the parameters has an invalid value.
+ */
+ public void setRGBColor(SVGString rgbColor) throws SVGException;
+ /**
+ * Modifies the color value to be the specified sRGB color with an alternate ICC color specification.
+ * @param rgbColor The new color value.
+ * @param iccColor The alternate ICC color specification.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_INVALID_VALUE_ERR: Raised if one of the parameters has an invalid value.
+ */
+ public void setRGBColorICCCOlor(SVGString rgbColor, SVGString iccColor) throws SVGException;
+ /**
+ * Sets the colorType as specified by the parameters. If colorType requires an RGBColor, then rgbColor must be a valid RGBColor object; otherwise, rgbColor must be null. If colorType requires an SVGICCColor, then iccColor must be a valid SVGICCColor object; otherwise, iccColor must be null.
+ * @param colorType One of the defined constants for colorType.
+ * @param rgbColor The specification of an sRGB color, or null.
+ * @param iccColor The specification of an ICC color, or null.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_INVALID_VALUE_ERR: Raised if one of the parameters has an invalid value.
+ */
+ public void setColor(Type colorType, SVGString rgbColor, SVGString iccColor) throws SVGException;
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGDataType.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGDataType.java
new file mode 100755
index 0000000..2cf4f56
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGDataType.java
@@ -0,0 +1,19 @@
+/*
+ * SVGDataType.java
+ *
+ * Created on April 12, 2007, 2:37 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * @author kitfox
+ */
+public interface SVGDataType
+{
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGElement.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGElement.java
new file mode 100755
index 0000000..aa1c962
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGElement.java
@@ -0,0 +1,35 @@
+/*
+ * SVGElement.java
+ *
+ * Created on April 12, 2007, 12:45 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * All of the SVG DOM interfaces that correspond directly to elements in the SVG language (e.g., the SVGPathElement interface corresponds directly to the 'path' element in the language) are derivative from base class SVGElement.
+ * @author kitfox
+ */
+public interface SVGElement
+{
+ /**
+ * The value of the id attribute on the given element.
+ */
+ public String getId();
+ /**
+ * Corresponds to attribute xml:base on the given element.
+ */
+ public String getXmlbase();
+ /**
+ * The nearest ancestor 'svg' element. Null if the given element is the outermost 'svg' element.
+ */
+ public SVGElement getOwnerSVGElement();
+ /**
+ * The element which established the current viewport. Often, the nearest ancestor 'svg' element. Null if the given element is the outermost 'svg' element.
+ */
+ public SVGElement getViewportElement();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGExternalResourcesRequired.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGExternalResourcesRequired.java
new file mode 100755
index 0000000..cdfdaa3
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGExternalResourcesRequired.java
@@ -0,0 +1,23 @@
+/*
+ * SVGExternalResourcesRequired.java
+ *
+ * Created on April 12, 2007, 3:18 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Interface SVGExternalResourcesRequired defines an interface which applies to all elements where this element or one of its descendants can reference an external resource.
+ * @author kitfox
+ */
+public interface SVGExternalResourcesRequired
+{
+ /**
+ * Corresponds to attribute externalResourcesRequired on the given element. Note that the SVG DOM defines the attribute externalResourcesRequired as being of type SVGAnimatedBoolean, whereas the SVG language definition says that externalResourcesRequired is not animated. Because the SVG language definition states that externalResourcesRequired cannot be animated, the animVal will always be the same as the baseVal.
+ */
+ public SVGAnimatedBoolean getExternalResourcesRequired();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGFitToViewBox.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGFitToViewBox.java
new file mode 100755
index 0000000..2f30454
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGFitToViewBox.java
@@ -0,0 +1,29 @@
+/*
+ * SVGFitToViewBox.java
+ *
+ * Created on April 12, 2007, 3:19 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.coordSystems.SVGAnimatedPreserveAspectRatio;
+
+/**
+ *
+ * Interface SVGFitToViewBox defines DOM attributes that apply to elements which have XML attributes viewBox and preserveAspectRatio.
+ * @author kitfox
+ */
+public interface SVGFitToViewBox
+{
+ /**
+ * Corresponds to attribute viewBox on the given element.
+ */
+ public SVGAnimatedRect getViewBox();
+ /**
+ * Corresponds to attribute preserveAspectRatio on the given element.
+ */
+ public SVGAnimatedPreserveAspectRatio getPreserveAspectRatio();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGICCColor.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGICCColor.java
new file mode 100755
index 0000000..d47f44f
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGICCColor.java
@@ -0,0 +1,27 @@
+/*
+ * SVGICCColor.java
+ *
+ * Created on April 12, 2007, 2:10 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * The SVGICCColor interface expresses an ICC-based color specification.
+ * @author kitfox
+ */
+public interface SVGICCColor
+{
+ /**
+ * The name of the color profile, which is the first parameter of an ICC color specification.
+ */
+ public String getColorProfile();
+ /**
+ * The list of color values that define this ICC color. Each color value is an arbitrary floating point number.
+ */
+ public SVGNumberList getColors();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGLangSpace.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGLangSpace.java
new file mode 100755
index 0000000..005f4aa
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGLangSpace.java
@@ -0,0 +1,27 @@
+/*
+ * SVGLangSpace.java
+ *
+ * Created on April 12, 2007, 3:17 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Interface SVGLangSpace defines an interface which applies to all elements which have attributes xml:lang and xml:space.
+ * @author kitfox
+ */
+public interface SVGLangSpace
+{
+ /**
+ * Corresponds to attribute xml:lang on the given element.
+ */
+ public SVGString getXmllang();
+ /**
+ * Corresponds to attribute xml:space on the given element.
+ */
+ public SVGString getXmlspace();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGLength.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGLength.java
new file mode 100755
index 0000000..472498d
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGLength.java
@@ -0,0 +1,96 @@
+/*
+ * SVGAnimatedInteger.java
+ *
+ * Created on April 12, 2007, 12:48 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * The SVGLength interface corresponds to the &lt;length&gt; basic data type.
+ * @author kitfox
+ */
+public interface SVGLength extends SVGDataType
+{
+ public static enum Type {
+ /**
+ * The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units.
+ */
+ NUMBER,
+ /**
+ * A percentage value was specified.
+ */
+ PERCENTAGE,
+ /**
+ * A value was specified using the "em" units defined in CSS2.
+ */
+ EMS,
+ /**
+ * A value was specified using the "ex" units defined in CSS2.
+ */
+ EXS,
+ /**
+ * A value was specified using the "px" units defined in CSS2.
+ */
+ PX,
+ /**
+ * A value was specified using the "cm" units defined in CSS2.
+ */
+ CM,
+ /**
+ * A value was specified using the "mm" units defined in CSS2.
+ */
+ MM,
+ /**
+ * A value was specified using the "in" units defined in CSS2.
+ */
+ IN,
+ /**
+ * A value was specified using the "pt" units defined in CSS2.
+ */
+ PT,
+ /**
+ * A value was specified using the "pc" units defined in CSS2.
+ */
+ PC
+ };
+
+ /**
+ * The type of the value as specified by one of the constants specified above.
+ */
+ public Type getUnitType();
+
+ /**
+ * The value as an floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits and valueAsString to be updated automatically to reflect this setting.
+ */
+ public float getValue();
+ /**
+ * The value as an floating point value, in the units expressed by unitType. Setting this attribute will cause value and valueAsString to be updated automatically to reflect this setting.
+ */
+ public float getValueInSpecifiedUnits();
+
+ /**
+ * The value as a string value, in the units expressed by unitType. Setting this attribute will cause value and valueInSpecifiedUnits to be updated automatically to reflect this setting.
+ */
+ public SVGString getValueAsString();
+
+ /**
+ * Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.
+ * @param unitType The unitType for the value (e.g., SVG_LENGTHTYPE_MM).
+ * @param valueInSpecifiedUnits The new value.
+ */
+ public void newValueSpecifiedUnits(Type unitType, float valueInSpecifiedUnits);
+ /**
+ * Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueAsSpecified and valueAsString might be modified as a result of this method. For example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the unitType would be changed to SVG_LENGTHTYPE_MM, valueAsSpecified would be changed to the numeric value 5 and valueAsString would be changed to "5mm".
+ * @param unitType The unitType to switch to (e.g., SVG_LENGTHTYPE_MM).
+ */
+ public void convertToSpecifiedUnits(Type unitType);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGLengthList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGLengthList.java
new file mode 100755
index 0000000..5b7522d
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGLengthList.java
@@ -0,0 +1,24 @@
+/*
+ * SVGNumberList.java
+ *
+ * Created on April 12, 2007, 1:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.DOMException;
+import com.kitfox.salamander.svg.SVGException;
+
+
+/**
+ * This interface defines a list of DOMSVGNumber objects.
+ *
+ * SVGSVGNumberList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
+ * @author kitfox
+ */
+public interface SVGLengthList extends SVGList<SVGLength>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGList.java
new file mode 100755
index 0000000..7d53f3b
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGList.java
@@ -0,0 +1,86 @@
+/*
+ * SVGLengthList.java
+ *
+ * Created on April 12, 2007, 1:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.DOMException;
+import com.kitfox.salamander.svg.SVGException;
+
+
+/**
+ * This interface defines a list of DOMSVGLength objects.
+ *
+ * SVGSVGLengthList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
+ * @author kitfox
+ */
+public interface SVGList<T extends SVGDataType> extends SVGDataType
+{
+ /**
+ * The number of items in the list.
+ */
+ public int getNumberOfItems();
+
+ /**
+ * Clears all existing current items from the list, with the result being an empty list.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ */
+ public void clear() throws DOMException;
+ /**
+ * Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter.
+ * @param newItem The item which should become the only member of the list.
+ * @return The item being inserted into the list.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_WRONG_TYPE_ERR: Raised if parameter newItem is the wrong type of object for the given list.
+ */
+ public T initialize(SVGLength newItem) throws DOMException, SVGException;
+ /**
+ * Returns the specified item from the list.
+ * @param index The index of the item from the list which is to be returned. The first item is number 0.
+ * @return The selected item.
+ * @throws com.kitfox.salamander.svg.DOMException INDEX_SIZE_ERR: Raised if the index number is negative or greater than or equal to numberOfItems.
+ */
+ public T getItem(int index) throws DOMException;
+ /**
+ * Inserts a new item into the list at the specified position. The first item is number 0. If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ * @param newItem The item which is to be inserted into the list.
+ * @param index The index of the item before which the new item is to be inserted. The first item is number 0.
+ * If the index is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
+ * @return The inserted item.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_WRONG_TYPE_ERR: Raised if parameter newItem is the wrong type of object for the given list.
+ */
+ public T insertItemBefore(SVGLength newItem, int index) throws DOMException, SVGException;
+ /**
+ * Replaces an existing item in the list with a new item. If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ * @param newItem The item which is to be inserted into the list.
+ * @param index The index of the item which is to be replaced. The first item is number 0.
+ * @return The inserted item.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ * INDEX_SIZE_ERR: Raised if the index number is negative or greater than or equal to numberOfItems.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_WRONG_TYPE_ERR: Raised if parameter newItem is the wrong type of object for the given list.
+ */
+ public T replaceItem(SVGLength newItem, int index) throws DOMException, SVGException;
+ /**
+ * Removes an existing item from the list.
+ * @param index The index of the item which is to be removed. The first item is number 0.
+ * @return The removed item.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ * INDEX_SIZE_ERR: Raised if the index number is negative or greater than or equal to numberOfItems.
+ */
+ public T removeItem(int index) throws DOMException;
+ /**
+ * Inserts a new item at the end of the list. If newItem is already in a list, it is removed from its previous list before it is inserted into this list.
+ * @param newItem The item which is to be inserted into the list. The first item is number 0.
+ * @return The inserted item.
+ * @throws com.kitfox.salamander.svg.DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the list cannot be modified.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_WRONG_TYPE_ERR: Raised if parameter newItem is the wrong type of object for the given list.
+ */
+ public T appendItem(SVGLength newItem) throws DOMException, SVGException;
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGLocatable.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGLocatable.java
new file mode 100755
index 0000000..304de04
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGLocatable.java
@@ -0,0 +1,54 @@
+/*
+ * SVGLocatable.java
+ *
+ * Created on April 12, 2007, 3:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.SVGException;
+import com.kitfox.salamander.svg.coordSystems.SVGMatrix;
+
+/**
+ *
+ * Interface SVGLocatable is for all elements which either have a transform attribute or don't have a transform attribute but whose content can have a bounding box in current user space.
+ * @author kitfox
+ */
+public interface SVGLocatable
+{
+ /**
+ * The element which established the current viewport. Often, the nearest ancestor 'svg' element. Null if the current element is the outermost 'svg' element.
+ */
+ public SVGElement getNearestViewportElement();
+ /**
+ * The farthest ancestor 'svg' element. Null if the current element is the outermost 'svg' element.
+ */
+ public SVGElement getFarthestViewportElement();
+
+ /**
+ * Returns the tight bounding box in current user space (i.e., after application of the transform attribute, if any) on the geometry of all contained graphics elements, exclusive of stroke-width and filter effects).
+ * @return An SVGRect object that defines the bounding box.
+ */
+ public SVGRect getBBox();
+ /**
+ * Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the viewport coordinate system for the nearestViewportElement.
+ * @return An SVGMatrix object that defines the CTM.
+ */
+ public SVGMatrix getCTM();
+ /**
+ * Returns the transformation matrix from current user units (i.e., after application of the transform attribute, if any) to the parent user agent's notice of a "pixel". For display devices, ideally this represents a physical screen pixel. For other devices or environments where physical pixel sizes are not known, then an algorithm similar to the CSS2 definition of a "pixel" can be used instead.
+ * @return An SVGMatrix object that defines the given transformation matrix.
+ */
+ public SVGMatrix getScreenCTM();
+ /**
+ * Returns the transformation matrix from the user coordinate system on the current element (after application of the transform attribute, if any) to the user coordinate system on parameter element (after application of its transform attribute, if any).
+ * @param element The target element.
+ * @return An SVGMatrix object that defines the transformation.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_MATRIX_NOT_INVERTABLE: Raised if the currently defined transformation matrices make it impossible to compute the given matrix (e.g., because one of the transformations is singular).
+ */
+ public SVGMatrix getTransformToElement(SVGElement element) throws SVGException;
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGNumber.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGNumber.java
new file mode 100755
index 0000000..beea9c2
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGNumber.java
@@ -0,0 +1,23 @@
+/*
+ * SVGNumber.java
+ *
+ * Created on April 12, 2007, 2:31 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Used for attributes of basic type 'number'.
+ * @author kitfox
+ */
+public interface SVGNumber extends SVGDataType
+{
+ /**
+ * The value of the given attribute.
+ */
+ public float getValue();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGNumberList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGNumberList.java
new file mode 100755
index 0000000..72e2a22
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGNumberList.java
@@ -0,0 +1,24 @@
+/*
+ * SVGNumberList.java
+ *
+ * Created on April 12, 2007, 1:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.DOMException;
+import com.kitfox.salamander.svg.SVGException;
+
+
+/**
+ * This interface defines a list of DOMSVGNumber objects.
+ *
+ * SVGSVGNumberList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
+ * @author kitfox
+ */
+public interface SVGNumberList extends SVGList<SVGNumber>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGRect.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGRect.java
new file mode 100755
index 0000000..aae86c6
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGRect.java
@@ -0,0 +1,34 @@
+/*
+ * SVGString.java
+ *
+ * Created on April 12, 2007, 2:47 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ * Rectangles are defined as consisting of a (x,y) coordinate pair identifying a minimum X value, a minimum Y value, and a width and height, which are usually constrained to be non-negative.
+ * @author kitfox
+ */
+public interface SVGRect extends SVGDataType
+{
+ /**
+ * Corresponds to attribute x on the given element.
+ */
+ public float getX();
+ /**
+ * Corresponds to attribute y on the given element.
+ */
+ public float getY();
+ /**
+ * Corresponds to attribute width on the given element.
+ */
+ public float getWidth();
+ /**
+ * Corresponds to attribute height on the given element.
+ */
+ public float getHeight();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGRenderingIntent.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGRenderingIntent.java
new file mode 100755
index 0000000..b745d04
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGRenderingIntent.java
@@ -0,0 +1,43 @@
+/*
+ * SVGRenderingIntent.java
+ *
+ * Created on April 12, 2007, 3:29 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * The SVGRenderingIntent interface defines the enumerated list of possible values for 'rendering-intent' attributes or descriptors.
+ * @author kitfox
+ */
+public enum SVGRenderingIntent
+{
+ /**
+ * The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * Corresponds to a value of auto.
+ */
+ AUTO,
+ /**
+ * Corresponds to a value of perceptual.
+ */
+ PERCEPTUAL,
+ /**
+ * Corresponds to a value of relative-colorimetric.
+ */
+ RELATIVE_COLORIMETRIC,
+ /**
+ * Corresponds to a value of saturation.
+ */
+ SATURATION,
+ /**
+ * Corresponds to a value of absolute-colorimetric.
+ */
+ ABSOLUTE_COLORIMETRIC
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGString.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGString.java
new file mode 100755
index 0000000..6fcbf69
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGString.java
@@ -0,0 +1,23 @@
+/*
+ * SVGString.java
+ *
+ * Created on April 12, 2007, 2:47 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ * Used for attributes of basic type 'string'.
+ * @author kitfox
+ */
+public interface SVGString extends SVGDataType
+{
+ /**
+ * The value of the given attribute.
+ */
+ public String getValue();
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGStringList.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGStringList.java
new file mode 100755
index 0000000..1a60497
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGStringList.java
@@ -0,0 +1,24 @@
+/*
+ * StringList.java
+ *
+ * Created on April 12, 2007, 1:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.DOMException;
+import com.kitfox.salamander.svg.SVGException;
+
+
+/**
+ * This interface defines a list of DOMString objects.
+ *
+ * SVGStringList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.
+ * @author kitfox
+ */
+public interface SVGStringList extends SVGList<SVGString>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGStylable.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGStylable.java
new file mode 100755
index 0000000..41cdc13
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGStylable.java
@@ -0,0 +1,35 @@
+/*
+ * SVGStylable.java
+ *
+ * Created on April 12, 2007, 3:00 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import org.w3c.dom.css.CSSStyleDeclaration;
+import org.w3c.dom.css.CSSValue;
+
+/**
+ *
+ * @author kitfox
+ */
+public interface SVGStylable
+{
+ /**
+ * Corresponds to attribute class on the given element.
+ */
+ public SVGAnimatedString getClassName();
+ /**
+ * Corresponds to attribute style on the given element. If the user agent does not support styling with CSS, then this attribute must always have the value of null.
+ */
+ public CSSStyleDeclaration getStyle();
+ /**
+ * Returns the base (i.e., static) value of a given presentation attribute as an object of type CSSValue. The returned object is live; changes to the objects represent immediate changes to the objects to which the CSSValue is attached.
+ * @param name Retrieves a "presentation attribute" by name.
+ * @return The static/base value of the given presentation attribute as a CSSValue, or NULL if the given attribute does not have a specified value.
+ */
+ public CSSValue getPresentationAttribute(SVGString name);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGTests.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGTests.java
new file mode 100755
index 0000000..aaa2041
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGTests.java
@@ -0,0 +1,37 @@
+/*
+ * SVGTests.java
+ *
+ * Created on April 12, 2007, 3:15 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Interface SVGTests defines an interface which applies to all elements which have attributes requiredFeatures, requiredExtensions and systemLanguage.
+ * @author kitfox
+ */
+public interface SVGTests
+{
+ /**
+ * Corresponds to attribute requiredFeatures on the given element.
+ */
+ public SVGStringList getRequiredFeatures();
+ /**
+ * Corresponds to attribute requiredExtensions on the given element.
+ */
+ public SVGStringList getRequiredExtensions();
+ /**
+ * Corresponds to attribute systemLanguage on the given element.
+ */
+ public SVGStringList getSystemLanguage();
+ /**
+ * Returns true if the user agent supports the given extension, specified by a URI.
+ * @param extension The name of the extension, expressed as a URI.
+ * @return True or false, depending on whether the given extension is supported.
+ */
+ public boolean hasExtension(SVGString extension);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGTransformable.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGTransformable.java
new file mode 100755
index 0000000..95372ff
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGTransformable.java
@@ -0,0 +1,25 @@
+/*
+ * SVGTransformable.java
+ *
+ * Created on April 12, 2007, 3:13 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.coordSystems.SVGAnimatedTransformList;
+
+/**
+ *
+ * Interface SVGTransformable contains properties and methods that apply to all elements which have attribute transform.
+ * @author kitfox
+ */
+public interface SVGTransformable extends SVGLocatable
+{
+ /**
+ * Corresponds to attribute transform on the given element.
+ */
+ public SVGAnimatedTransformList getTransform();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGURIReference.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGURIReference.java
new file mode 100755
index 0000000..8dc95c7
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGURIReference.java
@@ -0,0 +1,23 @@
+/*
+ * SVGURIReference.java
+ *
+ * Created on April 12, 2007, 3:26 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * Interface SVGURIReference defines an interface which applies to all elements which have the collection of XLink attributes, such as xlink:href, which define a URI reference.
+ * @author kitfox
+ */
+public interface SVGURIReference
+{
+ /**
+ * Corresponds to attribute xlink:href on the given element.
+ */
+ public SVGAnimatedString getHref();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGUnitTypes.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGUnitTypes.java
new file mode 100755
index 0000000..58d9f1d
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGUnitTypes.java
@@ -0,0 +1,30 @@
+/*
+ * SVGUnitTypes.java
+ *
+ * Created on April 12, 2007, 2:58 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ * The SVGUnitTypes interface defines a commonly used set of constants and is a base interface used by SVGGradientElement, SVGPatternElement, SVGClipPathElement, SVGMaskElement, and SVGFilterElement.
+ * @author kitfox
+ */
+public enum SVGUnitTypes
+{
+ /**
+ * The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * Corresponds to value userSpaceOnUse.
+ */
+ USER_SPACE_ON_USE,
+ /**
+ * Corresponds to value objectBoundingBox.
+ */
+ OBJECT_BOUNDING_BOX
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGViewSpec.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGViewSpec.java
new file mode 100755
index 0000000..addb8bd
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGViewSpec.java
@@ -0,0 +1,45 @@
+/*
+ * SVGViewSpec.java
+ *
+ * Created on April 12, 2007, 3:24 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+import com.kitfox.salamander.svg.coordSystems.SVGTransformList;
+
+/**
+ *
+ * The interface corresponds to an SVG View Specification.
+ * @author kitfox
+ */
+public interface SVGViewSpec extends SVGZoomAndPan, SVGFitToViewBox
+{
+ /**
+ * Corresponds to the transform setting on the SVG View Specification.
+ */
+ public SVGTransformList getTransform();
+ /**
+ * Corresponds to the viewTarget setting on the SVG View Specification.
+ */
+ public SVGElement getViewTarget();
+ /**
+ * Corresponds to the viewBox setting on the SVG View Specification.
+ */
+ public SVGString getViewBoxString();
+ /**
+ * Corresponds to the preserveAspectRatio setting on the SVG View Specification.
+ */
+ public SVGString getPreserveAspectRatioString();
+ /**
+ * Corresponds to the transform setting on the SVG View Specification.
+ */
+ public SVGString getTransformString();
+ /**
+ * Corresponds to the viewTarget setting on the SVG View Specification.
+ */
+ public SVGString getTargetString();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/basic/SVGZoomAndPan.java b/src/main/java/com/kitfox/salamander/svg/basic/SVGZoomAndPan.java
new file mode 100755
index 0000000..6da7bf0
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/basic/SVGZoomAndPan.java
@@ -0,0 +1,37 @@
+/*
+ * SVGZoomAndPan.java
+ *
+ * Created on April 12, 2007, 3:21 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.basic;
+
+/**
+ *
+ * The SVGZoomAndPan interface defines attribute "zoomAndPan" and associated constants.
+ * @author kitfox
+ */
+public interface SVGZoomAndPan
+{
+ public static enum Type {
+ /**
+ * The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * Corresponds to value disable.
+ */
+ DISABLE,
+ /**
+ * Corresponds to value magnify.
+ */
+ MAGNIFY};
+
+ /**
+ * Corresponds to attribute zoomAndPan on the given element. The value must be one of the zoom and pan constants specified above.
+ */
+ public Type getZoomAndPan();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedPreserveAspectRatio.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedPreserveAspectRatio.java
new file mode 100755
index 0000000..35f84f5
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedPreserveAspectRatio.java
@@ -0,0 +1,22 @@
+/*
+ * SVGAnimatedPreserveAspectRatio.java
+ *
+ * Created on April 12, 2007, 3:46 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.basic.SVGAnimatedDataType;
+
+/**
+ *
+ * Used for attributes of type SVGPreserveAspectRatio which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedPreserveAspectRatio extends SVGAnimatedDataType<SVGPreserveAspectRatio>
+{
+
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedTransformList.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedTransformList.java
new file mode 100755
index 0000000..b97b70e
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGAnimatedTransformList.java
@@ -0,0 +1,21 @@
+/*
+ * SVGAnimatedTransformList.java
+ *
+ * Created on April 12, 2007, 2:19 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.basic.SVGAnimatedDataType;
+
+/**
+ *
+ * Used for the various attributes which specify a set of transformations, such as the transform attribute which is available for many of SVG's elements, and which can be animated.
+ * @author kitfox
+ */
+public interface SVGAnimatedTransformList extends SVGAnimatedDataType<SVGTransformList>
+{
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGMatrix.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGMatrix.java
new file mode 100755
index 0000000..160fd28
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGMatrix.java
@@ -0,0 +1,127 @@
+/*
+ * SVGMatrix.java
+ *
+ * Created on April 12, 2007, 1:35 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.SVGException;
+import com.kitfox.salamander.svg.basic.SVGDataType;
+
+/**
+ * Many of SVG's graphics operations utilize 2x3 matrices of the form:
+ *
+ * <CODE>
+ * [a c e]
+ * [b d f]
+ * </CODE>
+ *
+ * which, when expanded into a 3x3 matrix for the purposes of matrix arithmetic, become:
+ *
+ * <CODE>
+ * [a c e]
+ * [b d f]
+ * [0 0 1]
+ * </CODE>
+ * @author kitfox
+ */
+public interface SVGMatrix extends SVGDataType
+{
+ /**
+ * The a component of the matrix.
+ */
+ public float getA();
+ /**
+ * The b component of the matrix.
+ */
+ public float getB();
+ /**
+ * The c component of the matrix.
+ */
+ public float getC();
+ /**
+ * The d component of the matrix.
+ */
+ public float getD();
+ /**
+ * The e component of the matrix.
+ */
+ public float getE();
+ /**
+ * The f component of the matrix.
+ */
+ public float getF();
+
+ /**
+ * Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix.
+ * @param secondMatrix The matrix which is post-multiplied to this matrix.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix multiply(SVGMatrix secondMatrix);
+ /**
+ * Returns the inverse matrix.
+ * @return The inverse matrix.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_MATRIX_NOT_INVERTABLE: Raised if this matrix is not invertable.
+ */
+ public SVGMatrix inverse() throws SVGException;
+ /**
+ * Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.
+ * @param x The distance to translate along the x-axis.
+ * @param y The distance to translate along the y-axis.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix translate(float x, float y);
+ /**
+ * Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.
+ * @param scaleFactor Scale factor in both X and Y.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix scale(float scaleFactor);
+ /**
+ * Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.
+ * @param scaleFactorX Scale factor in X.
+ * @param scaleFactorY Scale factor in Y.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix scaleNonUniform(float scaleFactorX, float scaleFactorY);
+ /**
+ * Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.
+ * @param angle Rotation angle.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix rotate(float angle);
+ /**
+ * Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. The rotation angle is determined by taking (+/-) atan(y/x). The direction of the vector (x,y) determines whether the positive or negative angle value is used.
+ * @param x The X coordinate of the vector (x,y). Must not be zero.
+ * @param y The Y coordinate of the vector (x,y). Must not be zero.
+ * @return The resulting matrix.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_INVALID_VALUE_ERR: Raised if one of the parameters has an invalid value.
+ */
+ public SVGMatrix rotateFromVector(float x, float y) throws SVGException;
+ /**
+ * Post-multiplies the transformation [-1 0 0 1 0 0] and returns the resulting matrix.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix flipX();
+ /**
+ * Post-multiplies the transformation [1 0 0 -1 0 0] and returns the resulting matrix.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix flipY();
+ /**
+ * Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.
+ * @param angle Skew angle.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix skewX(float angle);
+ /**
+ * Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.
+ * @param angle Skew angle.
+ * @return The resulting matrix.
+ */
+ public SVGMatrix skewY(float angle);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGPreserveAspectRatio.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGPreserveAspectRatio.java
new file mode 100755
index 0000000..5db5c16
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGPreserveAspectRatio.java
@@ -0,0 +1,89 @@
+/*
+ * SVGPreserveAspectRatio.java
+ *
+ * Created on April 12, 2007, 3:47 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.basic.SVGDataType;
+
+/**
+ * The SVGPreserveAspectRatio interface corresponds to the preserveAspectRatio attribute, which is available for some of SVG's elements.
+ * @author kitfox
+ */
+public interface SVGPreserveAspectRatio extends SVGDataType
+{
+ public static enum Type {
+ /**
+ * The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * Corresponds to value 'none' for attribute preserveAspectRatio.
+ */
+ NONE,
+ /**
+ * Corresponds to value 'xMinYMin' for attribute preserveAspectRatio.
+ */
+ X_MIN_Y_MIN,
+ /**
+ * Corresponds to value 'xMidYMin' for attribute preserveAspectRatio.
+ */
+ X_MID_Y_MIN,
+ /**
+ * Corresponds to value 'xMaxYMin' for attribute preserveAspectRatio.
+ */
+ X_MAX_Y_MIN,
+ /**
+ * Corresponds to value 'xMinYMid' for attribute preserveAspectRatio.
+ */
+ X_MIN_Y_MID,
+ /**
+ * Corresponds to value 'xMidYMid' for attribute preserveAspectRatio.
+ */
+ X_MID_Y_MID,
+ /**
+ * Corresponds to value 'xMaxYMid' for attribute preserveAspectRatio.
+ */
+ X_MAX_Y_MID,
+ /**
+ * Corresponds to value 'xMinYMax' for attribute preserveAspectRatio.
+ */
+ X_MIN_Y_MAX,
+ /**
+ * Corresponds to value 'xMidYMax' for attribute preserveAspectRatio.
+ */
+ X_MID_Y_MAX,
+ /**
+ * Corresponds to value 'xMaxYMax' for attribute preserveAspectRatio.
+ */
+ X_MAX_Y_MAX,
+ };
+
+ public static enum MeetOrSlice {
+ /**
+ * The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * Corresponds to value 'meet' for attribute preserveAspectRatio.
+ */
+ MEET,
+ /**
+ * Corresponds to value 'slice' for attribute preserveAspectRatio.
+ */
+ SLICE};
+
+ /**
+ * The type of the alignment value as specified by one of the constants specified above.
+ */
+ public Type getAlign();
+ /**
+ * The type of the meet-or-slice value as specified by one of the constants specified above.
+ */
+ public MeetOrSlice getMeetOrSlice();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransform.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransform.java
new file mode 100755
index 0000000..029ce47
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransform.java
@@ -0,0 +1,102 @@
+/*
+ * SVGTransform.java
+ *
+ * Created on April 12, 2007, 1:26 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.basic.SVGDataType;
+
+/**
+ * SVGTransform is the interface for one of the component transformations within a SVGTransformList; thus, a SVGTransform object corresponds to a single component (e.g., "scale(..)" or "matrix(...)") within a transform attribute specification.
+ * @author kitfox
+ */
+public interface SVGTransform extends SVGDataType
+{
+ public static enum Type {
+ /**
+ * The unit type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * A "matrix(...)" transformation.
+ */
+ MATRIX,
+ /**
+ * A "translate(...)" transformation.
+ */
+ TRANSLATE,
+ /**
+ * A "scale(...)" transformation.
+ */
+ SCALE,
+ /**
+ * A "rotate(...)" transformation.
+ */
+ ROTATE,
+ /**
+ * A "skewX(...)" transformation.
+ */
+ SKEWX,
+ /**
+ * A "skewY(...)" transformation.
+ */
+ SKEWY};
+
+ /**
+ * The type of the value as specified by one of the constants specified above.
+ */
+ public Type getType();
+ /**
+ * The matrix that represents this transformation.
+ * For SVG_TRANSFORM_MATRIX, the matrix contains the a, b, c, d, e, f values supplied by the user.
+ * For SVG_TRANSFORM_TRANSLATE, e and f represent the translation amounts (a=1,b=0,c=0,d=1).
+ * For SVG_TRANSFORM_SCALE, a and d represent the scale amounts (b=0,c=0,e=0,f=0).
+ * For SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY, a, b, c and d represent the matrix which will result in the given transformation (e=0,f=0).
+ */
+ public SVGMatrix getMatrix();
+ /**
+ * A convenience attribute for SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY. It holds the angle that was specified.
+ * For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero.
+ */
+ public float getAngle();
+
+ /**
+ * Sets the transform type to SVG_TRANSFORM_MATRIX, with parameter matrix defining the new transformation.
+ * @param matrix The new matrix for the transformation.
+ */
+ public void setMatrix(SVGMatrix matrix);
+ /**
+ * Sets the transform type to SVG_TRANSFORM_TRANSLATE, with parameters tx and ty defining the translation amounts.
+ * @param tx The translation amount in X.
+ * @param ty The translation amount in Y.
+ */
+ public void setTranslate(float tx, float ty);
+ /**
+ * Sets the transform type to SVG_TRANSFORM_SCALE, with parameters sx and sy defining the scale amounts.
+ * @param sx The scale factor in X.
+ * @param sy The scale factor in Y.
+ */
+ public void setScale(float sx, float sy);
+ /**
+ * Sets the transform type to SVG_TRANSFORM_ROTATE, with parameter angle defining the rotation angle and parameters cx and cy defining the optional centre of rotation.
+ * @param angle The rotation angle.
+ * @param cx The x coordinate of centre of rotation.
+ * @param cy The y coordinate of centre of rotation.
+ */
+ public void setRotate(float angle, float cx, float cy);
+ /**
+ * Sets the transform type to SVG_TRANSFORM_SKEWX, with parameter angle defining the amount of skew.
+ * @param angle The skew angle.
+ */
+ public void setSkewX(float angle);
+ /**
+ * Sets the transform type to SVG_TRANSFORM_SKEWY, with parameter angle defining the amount of skew.
+ * @param angle The skew angle.
+ */
+ public void setSkewY(float angle);
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransformList.java b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransformList.java
new file mode 100755
index 0000000..9135385
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/coordSystems/SVGTransformList.java
@@ -0,0 +1,36 @@
+/*
+ * SVGTransformList.java
+ *
+ * Created on April 12, 2007, 1:09 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.coordSystems;
+
+import com.kitfox.salamander.svg.basic.SVGList;
+
+
+/**
+ * <p>This interface defines a list of SVGTransform objects.</p>
+ *
+ * <p>The SVGTransformList and SVGTransform interfaces correspond to the various attributes which specify a set of transformations, such as the transform attribute which is available for many of SVG's elements.</p>
+ *
+ * <p>SVGTransformList has the same attributes and methods as other SVGxxxList interfaces. Implementers may consider using a single base class to implement the various SVGxxxList interfaces.</p>
+ * @author kitfox
+ */
+public interface SVGTransformList extends SVGList<SVGTransform>
+{
+ /**
+ * Creates an SVGTransform object which is initialized to transform of type SVG_TRANSFORM_MATRIX and whose values are the given matrix.
+ * @param matrix The matrix which defines the transformation.
+ * @return The returned SVGTransform object.
+ */
+ public SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix);
+ /**
+ * Consolidates the list of separate SVGTransform objects by multiplying the equivalent transformation matrices together to result in a list consisting of a single SVGTransform object of type SVG_TRANSFORM_MATRIX.
+ * @return The resulting SVGTransform object which becomes single item in the list. If the list was empty, then a value of null is returned.
+ */
+ public SVGTransform consolidate();
+}
diff --git a/src/main/java/com/kitfox/salamander/svg/paint/SVGPaint.java b/src/main/java/com/kitfox/salamander/svg/paint/SVGPaint.java
new file mode 100755
index 0000000..c47dc69
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/svg/paint/SVGPaint.java
@@ -0,0 +1,87 @@
+/*
+ * SVGPaint.java
+ *
+ * Created on April 12, 2007, 2:12 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.svg.paint;
+
+import com.kitfox.salamander.svg.SVGException;
+import com.kitfox.salamander.svg.basic.SVGDataType;
+import com.kitfox.salamander.svg.basic.SVGString;
+
+/**
+ *
+ * The SVGPaint interface corresponds to basic type <paint> and represents the values of properties 'fill' and 'stroke'.
+ * @author kitfox
+ */
+public interface SVGPaint extends SVGDataType
+{
+ public static enum Type {
+ /**
+ * The paint type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
+ */
+ UNKNOWN,
+ /**
+ * An sRGB color has been specified without an alternative ICC color specification.
+ */
+ RGBCOLOR,
+ /**
+ * An sRGB color has been specified along with an alternative ICC color specification.
+ */
+ RGBCOLOR_ICCCOLOR,
+ /**
+ * Corresponds to a 'none' value on a <paint> specification.
+ */
+ NONE,
+ /**
+ * Corresponds to a 'currentColor' value on a <paint> specification.
+ */
+ CURRENTCOLOR,
+ /**
+ * A URI has been specified, along with an explicit 'none' as the backup paint method in case the URI is unavailable or invalid.
+ */
+ URI_NONE,
+ /**
+ * A URI has been specified, along with 'currentColor' as the backup paint method in case the URI is unavailable or invalid.
+ */
+ URI_CURRENTCOLOR,
+ /**
+ * A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.
+ */
+ URI_RGBCOLOR,
+ /**
+ * A URI has been specified, along with both an sRGB color and alternate ICC color as the backup paint method in case the URI is unavailable or invalid.
+ */
+ URI_RGBCOLOR_ICCCOLOR,
+ /**
+ * Only a URI has been specified.
+ */
+ URI};
+
+ /**
+ * The type of paint, identified by one of the constants above.
+ */
+ public Type getPaintType();
+ /**
+ * When the paintType specifies a URI, this attribute holds the URI string. When the paintType does not specify a URI, this attribute is null.
+ */
+ public SVGString getUri();
+ /**
+ * Sets the paintType to SVG_PAINTTYPE_URI_NONE and sets uri to the specified value.
+ * @param uri The URI for the desired paint server.
+ */
+ public void setUri(SVGString uri);
+ /**
+ * Sets the paintType as specified by the parameters. If paintType requires a URI, then uri must be non-null and a valid string; otherwise, uri must be null. If paintType requires an RGBColor, then rgbColor must be a valid RGBColor object; otherwise, rgbColor must be null. If paintType requires an SVGICCColor, then iccColor must be a valid SVGICCColor object; otherwise, iccColor must be null.
+ * @param paintType One of the defined constants for paintType.
+ * @param uri The URI for the desired paint server, or null.
+ * @param rgbColor The specification of an sRGB color, or null.
+ * @param iccColor The specification of an ICC color, or null.
+ * @throws com.kitfox.salamander.svg.SVGException SVG_INVALID_VALUE_ERR: Raised if one of the parameters has an invalid value.
+ */
+ public void setPaint(Type paintType, String uri, String rgbColor, String iccColor) throws SVGException;
+}
diff --git a/src/main/java/com/kitfox/salamander/writer/SVGWriter.java b/src/main/java/com/kitfox/salamander/writer/SVGWriter.java
new file mode 100755
index 0000000..4d51fc5
--- /dev/null
+++ b/src/main/java/com/kitfox/salamander/writer/SVGWriter.java
@@ -0,0 +1,34 @@
+/*
+ * SVGWriter.java
+ *
+ * Created on April 12, 2007, 7:17 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package com.kitfox.salamander.writer;
+
+import com.kitfox.salamander.SVGConstants;
+import java.io.PrintWriter;
+
+/**
+ *
+ * @author kitfox
+ */
+public class SVGWriter implements SVGConstants
+{
+ final PrintWriter pw;
+
+ /** Creates a new instance of SVGWriter */
+ public SVGWriter(PrintWriter pw)
+ {
+ this.pw = pw;
+ }
+
+ private void writeHeader()
+ {
+ pw.printf("<!DOCTYPE svg %s \"%s\"\n", PUBLIC_IDENTIFIER_SVG, SYSTEM_IDENTIFIER_SVG);
+ }
+
+}