summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/kitfox/svg/animation
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/kitfox/svg/animation')
-rw-r--r--src/main/java/com/kitfox/svg/animation/AnimTimeParser.jjt41
-rw-r--r--src/main/java/com/kitfox/svg/animation/AnimateBase.java13
-rw-r--r--src/main/java/com/kitfox/svg/animation/AnimationElement.java12
3 files changed, 51 insertions, 15 deletions
diff --git a/src/main/java/com/kitfox/svg/animation/AnimTimeParser.jjt b/src/main/java/com/kitfox/svg/animation/AnimTimeParser.jjt
index c7588e5..4b01b5c 100644
--- a/src/main/java/com/kitfox/svg/animation/AnimTimeParser.jjt
+++ b/src/main/java/com/kitfox/svg/animation/AnimTimeParser.jjt
@@ -42,9 +42,17 @@ PARSER_BEGIN(AnimTimeParser)
package com.kitfox.svg.animation.parser;
-import java.util.*;
-import java.io.*;
-import com.kitfox.svg.animation.*;
+import com.kitfox.svg.SVGConst;
+import com.kitfox.svg.animation.TimeBase;
+import com.kitfox.svg.animation.TimeCompound;
+import com.kitfox.svg.animation.TimeDiscrete;
+import com.kitfox.svg.animation.TimeIndefinite;
+import com.kitfox.svg.animation.TimeLookup;
+import com.kitfox.svg.animation.TimeSum;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class AnimTimeParser
{
@@ -283,15 +291,25 @@ double Number() :
{
t=<FLOAT>
{
- try { return Double.parseDouble(t.image); }
- catch (Exception e) { e.printStackTrace(); }
+ try {
+ return Double.parseDouble(t.image);
+ }
+ catch (Exception e) {
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse double '" + t.image + "'", e);
+ }
return 0.0;
}
| t=<INTEGER>
{
- try { return Double.parseDouble(t.image); }
- catch (Exception e) { e.printStackTrace(); }
+ try {
+ return Double.parseDouble(t.image);
+ }
+ catch (Exception e) {
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse double '" + t.image + "'", e);
+ }
return 0.0;
}
@@ -304,8 +322,13 @@ int Integer() :
{
t=<INTEGER>
{
- try { return Integer.parseInt(t.image); }
- catch (Exception e) { e.printStackTrace(); }
+ try {
+ return Integer.parseInt(t.image);
+ }
+ catch (Exception e) {
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse int '" + t.image + "'", e);
+ }
return 0;
}
diff --git a/src/main/java/com/kitfox/svg/animation/AnimateBase.java b/src/main/java/com/kitfox/svg/animation/AnimateBase.java
index 0605f0e..047305d 100644
--- a/src/main/java/com/kitfox/svg/animation/AnimateBase.java
+++ b/src/main/java/com/kitfox/svg/animation/AnimateBase.java
@@ -36,6 +36,7 @@
package com.kitfox.svg.animation;
+import com.kitfox.svg.SVGConst;
import com.kitfox.svg.SVGElement;
import com.kitfox.svg.SVGException;
import com.kitfox.svg.SVGLoaderHelper;
@@ -43,6 +44,8 @@ import com.kitfox.svg.animation.parser.AnimTimeParser;
import com.kitfox.svg.animation.parser.ParseException;
import com.kitfox.svg.xml.StyleAttribute;
import java.io.StringReader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -114,10 +117,14 @@ abstract public class AnimateBase extends AnimationElement
if (strn != null)
{
animTimeParser.ReInit(new StringReader(strn));
- try {
+ try
+ {
this.repeatDur = animTimeParser.Expr();
- } catch (ParseException ex) {
- ex.printStackTrace();
+ }
+ catch (ParseException ex)
+ {
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse '" + strn + "'", ex);
}
}
}
diff --git a/src/main/java/com/kitfox/svg/animation/AnimationElement.java b/src/main/java/com/kitfox/svg/animation/AnimationElement.java
index ce49ffa..980a826 100644
--- a/src/main/java/com/kitfox/svg/animation/AnimationElement.java
+++ b/src/main/java/com/kitfox/svg/animation/AnimationElement.java
@@ -36,6 +36,7 @@
package com.kitfox.svg.animation;
+import com.kitfox.svg.SVGConst;
import com.kitfox.svg.SVGElement;
import com.kitfox.svg.SVGException;
import com.kitfox.svg.SVGLoaderHelper;
@@ -43,6 +44,8 @@ import com.kitfox.svg.animation.parser.AnimTimeParser;
import com.kitfox.svg.animation.parser.ParseException;
import com.kitfox.svg.xml.StyleAttribute;
import java.io.StringReader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@@ -369,7 +372,8 @@ public abstract class AnimationElement extends SVGElement
try {
this.beginTime = animTimeParser.Expr();
} catch (ParseException ex) {
- ex.printStackTrace();
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse '" + newVal + "'", ex);
}
}
@@ -380,7 +384,8 @@ public abstract class AnimationElement extends SVGElement
try {
this.durTime = animTimeParser.Expr();
} catch (ParseException ex) {
- ex.printStackTrace();
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse '" + newVal + "'", ex);
}
}
@@ -391,7 +396,8 @@ public abstract class AnimationElement extends SVGElement
try {
this.endTime = animTimeParser.Expr();
} catch (ParseException ex) {
- ex.printStackTrace();
+ Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+ "Could not parse '" + newVal + "'", ex);
}
}