[svgsalamander] 02/06: Imported Upstream version 1.1.0+dfsg1

Felix Natter fnatter-guest at moszumanska.debian.org
Sat Aug 13 18:22:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

fnatter-guest pushed a commit to branch master
in repository svgsalamander.

commit d07f532d35f9457542a90a08828493d62332fff7
Author: Felix Natter <fnatter at gmx.net>
Date:   Sat Aug 13 20:10:26 2016 +0200

    Imported Upstream version 1.1.0+dfsg1
---
 README.md                                          | 34 ++++++++++++++++++++++
 .../main/java/com/kitfox/svg/LinearGradient.java   | 18 +++++++-----
 svg-core/src/main/java/com/kitfox/svg/Path.java    |  1 -
 .../main/java/com/kitfox/svg/RadialGradient.java   | 19 ++++++------
 .../src/main/java/com/kitfox/svg/SVGUniverse.java  |  9 ++++--
 svg-core/src/main/java/com/kitfox/svg/Text.java    |  3 --
 6 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4f1de55
--- /dev/null
+++ b/README.md
@@ -0,0 +1,34 @@
+SVG Salamander
+==============
+SVG Salamander is an SVG engine for Java that's designed to be small, fast, and allow programmers to use it with a minimum of fuss. It's in particular targeted for making it easy to integrate SVG into Java games and making it much easier for artists to design 2D game content - from rich interactive menus to charts and graphcs to complex animations.
+
+Features
+--------
+* Ant task to allow easy conversion from SVG to images from within Ant scripts
+* SVGIcon class greatly simplifies loading and drawing images to screen
+* A much smaller code foot print than Batik, and only one JAR file to include
+* Direct access to the scene graph tree. You can use Java commands to manipulate it directly.
+* An index of all named shapes in the SVG graph is easily accessible.
+* Picking shapes given (x, y) coordinates is possible, and can be used to implement graphical buttons selected by the mouse
+* Clip region sensitivity makes for fast rendering when only updating part of the image. This makes panning the camera quite efficient.
+* Easy rendering to any Graphics2D or BufferedImage. Unlike Batik, the SVG Salamander engine does not own the graphics context, so you can pass it whatever graphics context you like.
+* Internal and external links are implemented as URIs, which allows the engine to automatically import linked documents - even if they're stored on a remote server.
+* SVG can be read from an InputStream, so you can create documents dynamicly from an in-program XSLT transformation.
+
+Current status
+--------------
+SalamanderSVG is part of the Salamander project hosted on http://www.kitfox.com
+
+Projects using SVG Salamander
+-----------------------------
+* [Apache Pivot](http://pivot.apache.org/) - An alternate crossplatform GUI for Java.
+* [VisiCut](http://visicut.org/) - A tool for laser precision cutting.
+* [Xoetrope](http://www.xoetrope.com/) - An alternate crossplatform GUI for Java.
+* [Power Line](http://suchanek.name/programs/powerline/index.html) - A slide editor for SVG.
+* [Tygron](http://www.tygron.com/) - Serious games illustrating urban planning and climate change.
+* [NeoLogica](http://www.neologica.it/eng/Home.php) - Medical imaging.
+* [JOSM](https://josm.openstreetmap.de/) - Java OpenStreetMap Editor.
+
+License
+-------
+SVG Salamander is avaible both under the [LGPL](https://svgsalamander.java.net/license/license-lgpl.txt) and [BSD](https://svgsalamander.java.net/license/license-bsd.txt) licenses.
diff --git a/svg-core/src/main/java/com/kitfox/svg/LinearGradient.java b/svg-core/src/main/java/com/kitfox/svg/LinearGradient.java
index ffe5fa1..5841835 100644
--- a/svg-core/src/main/java/com/kitfox/svg/LinearGradient.java
+++ b/svg-core/src/main/java/com/kitfox/svg/LinearGradient.java
@@ -37,6 +37,8 @@ package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
 import java.awt.Color;
+import java.awt.LinearGradientPaint;
+import java.awt.MultipleGradientPaint;
 import java.awt.Paint;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
@@ -96,18 +98,18 @@ public class LinearGradient extends Gradient
 
     public Paint getPaint(Rectangle2D bounds, AffineTransform xform)
     {
-        com.kitfox.svg.batik.MultipleGradientPaint.CycleMethodEnum method;
+        MultipleGradientPaint.CycleMethod method;
         switch (spreadMethod)
         {
             default:
             case SM_PAD:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.NO_CYCLE;
+                method = MultipleGradientPaint.CycleMethod.NO_CYCLE;
                 break;
             case SM_REPEAT:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.REPEAT;
+                method = MultipleGradientPaint.CycleMethod.REPEAT;
                 break;
             case SM_REFLECT:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.REFLECT;
+                method = MultipleGradientPaint.CycleMethod.REFLECT;
                 break;
         }
 
@@ -120,13 +122,13 @@ public class LinearGradient extends Gradient
             paint = colors.length > 0 ? colors[0] : Color.black;
         } else if (gradientUnits == GU_USER_SPACE_ON_USE)
         {
-            paint = new com.kitfox.svg.batik.LinearGradientPaint(
+            paint = new LinearGradientPaint(
                 pt1,
                 pt2,
                 getStopFractions(),
                 getStopColors(),
                 method,
-                com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
+                MultipleGradientPaint.ColorSpaceType.SRGB,
                 gradientTransform == null
                 ? new AffineTransform()
                 : gradientTransform);
@@ -145,13 +147,13 @@ public class LinearGradient extends Gradient
                 viewXform.concatenate(gradientTransform);
             }
 
-            paint = new com.kitfox.svg.batik.LinearGradientPaint(
+            paint = new LinearGradientPaint(
                 pt1,
                 pt2,
                 getStopFractions(),
                 getStopColors(),
                 method,
-                com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
+                MultipleGradientPaint.ColorSpaceType.SRGB,
                 viewXform);
         }
 
diff --git a/svg-core/src/main/java/com/kitfox/svg/Path.java b/svg-core/src/main/java/com/kitfox/svg/Path.java
index 7d8db66..ba8afc1 100644
--- a/svg-core/src/main/java/com/kitfox/svg/Path.java
+++ b/svg-core/src/main/java/com/kitfox/svg/Path.java
@@ -41,7 +41,6 @@ import java.awt.Shape;
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Rectangle2D;
 
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
 /**
  * @author Mark McKay
  * @author <a href="mailto:mark at kitfox.com">Mark McKay</a>
diff --git a/svg-core/src/main/java/com/kitfox/svg/RadialGradient.java b/svg-core/src/main/java/com/kitfox/svg/RadialGradient.java
index 29ab070..392799f 100644
--- a/svg-core/src/main/java/com/kitfox/svg/RadialGradient.java
+++ b/svg-core/src/main/java/com/kitfox/svg/RadialGradient.java
@@ -36,8 +36,9 @@
 package com.kitfox.svg;
 
 import com.kitfox.svg.xml.StyleAttribute;
-import java.awt.Color;
+import java.awt.MultipleGradientPaint;
 import java.awt.Paint;
+import java.awt.RadialGradientPaint;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
@@ -106,18 +107,18 @@ public class RadialGradient extends Gradient
 
     public Paint getPaint(Rectangle2D bounds, AffineTransform xform)
     {
-        com.kitfox.svg.batik.MultipleGradientPaint.CycleMethodEnum method;
+        MultipleGradientPaint.CycleMethod method;
         switch (spreadMethod)
         {
             default:
             case SM_PAD:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.NO_CYCLE;
+                method = MultipleGradientPaint.CycleMethod.NO_CYCLE;
                 break;
             case SM_REPEAT:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.REPEAT;
+                method = MultipleGradientPaint.CycleMethod.REPEAT;
                 break;
             case SM_REFLECT:
-                method = com.kitfox.svg.batik.MultipleGradientPaint.REFLECT;
+                method = MultipleGradientPaint.CycleMethod.REFLECT;
                 break;
         }
 
@@ -126,14 +127,14 @@ public class RadialGradient extends Gradient
         Point2D.Float pt2 = hasFocus ? new Point2D.Float(fx, fy) : pt1;
         if (gradientUnits == GU_USER_SPACE_ON_USE)
         {
-            paint = new com.kitfox.svg.batik.RadialGradientPaint(
+            paint = new RadialGradientPaint(
                 pt1,
                 r,
                 pt2,
                 getStopFractions(),
                 getStopColors(),
                 method,
-                com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
+                MultipleGradientPaint.ColorSpaceType.SRGB,
                 gradientTransform);
         } else
         {
@@ -143,14 +144,14 @@ public class RadialGradient extends Gradient
 
             viewXform.concatenate(gradientTransform);
 
-            paint = new com.kitfox.svg.batik.RadialGradientPaint(
+            paint = new RadialGradientPaint(
                 pt1,
                 r,
                 pt2,
                 getStopFractions(),
                 getStopColors(),
                 method,
-                com.kitfox.svg.batik.MultipleGradientPaint.SRGB,
+                MultipleGradientPaint.ColorSpaceType.SRGB,
                 viewXform);
         }
 
diff --git a/svg-core/src/main/java/com/kitfox/svg/SVGUniverse.java b/svg-core/src/main/java/com/kitfox/svg/SVGUniverse.java
index 08d1d18..0a701e1 100644
--- a/svg-core/src/main/java/com/kitfox/svg/SVGUniverse.java
+++ b/svg-core/src/main/java/com/kitfox/svg/SVGUniverse.java
@@ -62,12 +62,13 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import java.util.zip.GZIPInputStream;
 import javax.imageio.ImageIO;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
 
 /**
  * Many SVG files can be loaded at one time. These files will quite likely need
@@ -576,11 +577,13 @@ public class SVGUniverse implements Serializable
         }
     }
 
-    private XMLReader getXMLReaderCached() throws SAXException
+    private XMLReader getXMLReaderCached() throws SAXException, ParserConfigurationException
     {
         if (cachedReader == null)
         {
-            cachedReader = XMLReaderFactory.createXMLReader();
+            SAXParserFactory factory = SAXParserFactory.newInstance();
+            factory.setNamespaceAware(true);
+            cachedReader = factory.newSAXParser().getXMLReader();
         }
         return cachedReader;
     }
diff --git a/svg-core/src/main/java/com/kitfox/svg/Text.java b/svg-core/src/main/java/com/kitfox/svg/Text.java
index 07a640c..868273f 100644
--- a/svg-core/src/main/java/com/kitfox/svg/Text.java
+++ b/svg-core/src/main/java/com/kitfox/svg/Text.java
@@ -36,11 +36,9 @@
 package com.kitfox.svg;
 
 import com.kitfox.svg.util.FontSystem;
-import com.kitfox.svg.util.TextBuilder;
 import com.kitfox.svg.xml.StyleAttribute;
 import java.awt.Graphics2D;
 import java.awt.Shape;
-import java.awt.font.FontRenderContext;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Point2D;
@@ -50,7 +48,6 @@ import java.util.LinkedList;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-//import org.apache.batik.ext.awt.geom.ExtendedGeneralPath;
 /**
  * @author Mark McKay
  * @author <a href="mailto:mark at kitfox.com">Mark McKay</a>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/svgsalamander.git



More information about the pkg-java-commits mailing list