You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2006/03/08 01:04:03 UTC
svn commit: r384062 [2/6] - in /xmlgraphics/batik/branches/anim: ./ lib/
resources/META-INF/services/
resources/org/apache/batik/apps/rasterizer/resources/
resources/org/apache/batik/apps/svgbrowser/resources/
resources/org/apache/batik/dom/svg/resourc...
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthListValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthListValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthListValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthListValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,97 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+import org.w3c.dom.svg.SVGLength;
+
+public class AnimatableLengthListValue extends AnimatableValue {
+
+ /**
+ * The length types.
+ */
+ protected int[] lengthTypes;
+
+ /**
+ * The length values. These should be one of the constants defined in
+ * {@link SVGLength}.
+ */
+ protected float[] lengthValues;
+
+ /**
+ * Creates a new AnimatableLengthListValue.
+ */
+ public AnimatableLengthListValue(AnimationTarget target, int types[],
+ float[] values) {
+ super(target);
+ this.lengthTypes = types;
+ this.lengthValues = values;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ if ((to == null || interpolation == 0) && accumulation == null) {
+ return this;
+ }
+ AnimatableLengthListValue toLengthList = (AnimatableLengthListValue) to;
+ AnimatableLengthListValue accLengthList
+ = (AnimatableLengthListValue) accumulation;
+ int[] newTypes = new int[lengthTypes.length];
+ float[] newValues = new float[lengthValues.length];
+ for (int i = 0; i < newTypes.length; i++) {
+ newTypes[i] = SVGLength.SVG_LENGTHTYPE_NUMBER;
+ newValues[i] = target.convertLength
+ (lengthTypes[i], lengthValues[i],
+ SVGLength.SVG_LENGTHTYPE_NUMBER);
+ }
+ if (to != null) {
+ int[] toTypes = toLengthList.getLengthTypes();
+ float[] toValues = toLengthList.getLengthValues();
+ if (toTypes.length == newTypes.length) {
+ for (int i = 0; i < toTypes.length; i++) {
+ newValues[i] += interpolation *
+ target.convertLength
+ (toTypes[i], toValues[i],
+ SVGLength.SVG_LENGTHTYPE_NUMBER);
+ }
+ }
+ }
+ if (accumulation != null) {
+ int[] accTypes = accLengthList.getLengthTypes();
+ float[] accValues = accLengthList.getLengthValues();
+ if (accTypes.length == newTypes.length) {
+ for (int i = 0; i < accTypes.length; i++) {
+ newValues[i] += target.convertLength
+ (accTypes[i], accValues[i],
+ SVGLength.SVG_LENGTHTYPE_NUMBER);
+ }
+ }
+ }
+ return new AnimatableLengthListValue(target, newTypes, newValues);
+ }
+
+ /**
+ * Gets the length types.
+ */
+ public int[] getLengthTypes() {
+ return lengthTypes;
+ }
+
+ /**
+ * Gets the length values.
+ */
+ public float[] getLengthValues() {
+ return lengthValues;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ float[] vs = new float[lengthValues.length];
+ return new AnimatableLengthListValue(target, lengthTypes, vs);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthListValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,87 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+import org.w3c.dom.svg.SVGLength;
+
+public class AnimatableLengthValue extends AnimatableValue {
+
+ /**
+ * The length type.
+ */
+ protected int lengthType;
+
+ /**
+ * The length value. This should be one of the constants defined in
+ * {@link SVGLength}.
+ */
+ protected float lengthValue;
+
+ /**
+ * Creates a new AnimatableLengthValue.
+ */
+ public AnimatableLengthValue(AnimationTarget target, int type, float v) {
+ super(target);
+ lengthType = type;
+ lengthValue = v;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ if ((to == null || interpolation == 0) && accumulation == null) {
+ return this;
+ }
+ AnimatableLengthValue toLength = (AnimatableLengthValue) to;
+ AnimatableLengthValue accLength = (AnimatableLengthValue) accumulation;
+ boolean convert = to != null && !compatibleTypes(toLength.getLengthType(), lengthType)
+ || accumulation != null && !compatibleTypes(accLength.getLengthType(), lengthType);
+ int type = convert ? SVGLength.SVG_LENGTHTYPE_NUMBER : lengthType;
+ float value = convert ? toType(lengthType, lengthValue, type) : lengthValue;
+ if (to != null) {
+ float toValue = convert ? toType(toLength.getLengthType(),
+ toLength.getLengthValue(), type)
+ : toLength.getLengthValue();
+ value += interpolation * (toValue - value);
+ }
+ if (accumulation != null) {
+ float accValue = convert ? toType(accLength.getLengthType(),
+ accLength.getLengthValue(), type)
+ : accLength.getLengthValue();
+ value += accValue;
+ }
+ return new AnimatableLengthValue(target, type, value);
+ }
+
+ protected boolean compatibleTypes(int t1, int t2) {
+ return t1 == t2
+ || t1 == SVGLength.SVG_LENGTHTYPE_NUMBER
+ && t2 == SVGLength.SVG_LENGTHTYPE_PX
+ || t1 == SVGLength.SVG_LENGTHTYPE_PX
+ && t2 == SVGLength.SVG_LENGTHTYPE_NUMBER;
+ }
+
+ protected float toType(int from, float value, int to) {
+ // XXX ...
+ return 0;
+ }
+
+ public int getLengthType() {
+ return lengthType;
+ }
+
+ public float getLengthValue() {
+ return lengthValue;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ return new AnimatableLengthValue
+ (target, SVGLength.SVG_LENGTHTYPE_NUMBER, 0);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableLengthValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberListValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberListValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberListValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberListValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,69 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public class AnimatableNumberListValue extends AnimatableValue {
+
+ /**
+ * The numbers.
+ */
+ protected float[] numbers;
+
+ /**
+ * Creates a new AnimatableNumberListValue.
+ */
+ public AnimatableNumberListValue(AnimationTarget target, float[] numbers) {
+ super(target);
+ this.numbers = numbers;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ if ((to == null || interpolation == 0) && accumulation == null) {
+ return this;
+ }
+ AnimatableNumberListValue toNumList = (AnimatableNumberListValue) to;
+ AnimatableNumberListValue accNumList =
+ (AnimatableNumberListValue) accumulation;
+ float[] newNums = new float[numbers.length];
+ for (int i = 0; i < numbers.length; i++) {
+ newNums[i] = numbers[i];
+ }
+ if (to != null) {
+ float[] toNums = toNumList.getNumbers();
+ if (toNums.length == numbers.length) {
+ for (int i = 0; i < toNums.length; i++) {
+ newNums[i] += interpolation * toNums[i];
+ }
+ }
+ }
+ if (accumulation != null) {
+ float[] accNums = accNumList.getNumbers();
+ if (accNums.length == numbers.length) {
+ for (int i = 0; i < accNums.length; i++) {
+ newNums[i] += accNums[i];
+ }
+ }
+ }
+ return new AnimatableNumberListValue(target, newNums);
+ }
+
+ /**
+ * Gets the numbers.
+ */
+ public float[] getNumbers() {
+ return numbers;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ float[] ns = new float[numbers.length];
+ return new AnimatableNumberListValue(target, ns);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberListValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,51 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public class AnimatableNumberValue extends AnimatableValue {
+
+ /**
+ * The value.
+ */
+ protected float value;
+
+ /**
+ * Creates a new AnimatableNumberValue.
+ */
+ public AnimatableNumberValue(AnimationTarget target, float v) {
+ super(target);
+ value = v;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ float v = value;
+ if (to != null) {
+ AnimatableNumberValue toNumber = (AnimatableNumberValue) to;
+ v += value + interpolation * (toNumber.getValue() - value);
+ }
+ if (accumulation != null) {
+ AnimatableNumberValue accNumber = (AnimatableNumberValue) accumulation;
+ v += accNumber.getValue();
+ }
+ return new AnimatableNumberValue(target, v);
+ }
+
+ /**
+ * Returns the number value.
+ */
+ public float getValue() {
+ return value;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ return new AnimatableNumberValue(target, 0);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableNumberValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePaintValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePaintValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePaintValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePaintValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,169 @@
+package org.apache.batik.anim.values;
+
+import java.awt.Color;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public class AnimatablePaintValue extends AnimatableColorValue {
+
+ // Constants for paintType.
+ public static int PAINT_NONE = 0;
+ public static int PAINT_CURRENT_COLOR = 1;
+ public static int PAINT_COLOR = 2;
+ public static int PAINT_URI = 3;
+ public static int PAINT_URI_NONE = 4;
+ public static int PAINT_URI_CURRENT_COLOR = 5;
+ public static int PAINT_URI_COLOR = 6;
+ public static int PAINT_INHERIT = 7;
+
+ /**
+ * The type of paint.
+ */
+ protected int paintType;
+
+ /**
+ * The URI of the referenced paint server.
+ */
+ protected String uri;
+
+ /**
+ * Creates a new AnimatablePaintValue.
+ */
+ protected AnimatablePaintValue(AnimationTarget target) {
+ super(target);
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue.
+ */
+ protected AnimatablePaintValue(AnimationTarget target, Color c) {
+ super(target, c);
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a 'none' value.
+ */
+ public static AnimatablePaintValue createNonePaintValue
+ (AnimationTarget target) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.paintType = PAINT_NONE;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a 'currentColor' value.
+ */
+ public static AnimatablePaintValue createCurrentColorPaintValue
+ (AnimationTarget target) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.paintType = PAINT_CURRENT_COLOR;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a color value.
+ */
+ public static AnimatablePaintValue createColorPaintValue
+ (AnimationTarget target, Color c) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target, c);
+ v.paintType = PAINT_COLOR;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a URI reference.
+ */
+ public static AnimatablePaintValue createURIPaintValue
+ (AnimationTarget target, String uri) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.uri = uri;
+ v.paintType = PAINT_URI;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a URI reference with a
+ * 'none' fallback.
+ */
+ public static AnimatablePaintValue createURINonePaintValue
+ (AnimationTarget target, String uri) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.uri = uri;
+ v.paintType = PAINT_URI_NONE;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a URI reference with a
+ * 'currentColor' fallback.
+ */
+ public static AnimatablePaintValue createURICurrentColorPaintValue
+ (AnimationTarget target, String uri) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.uri = uri;
+ v.paintType = PAINT_URI_CURRENT_COLOR;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a URI reference with a
+ * color fallback.
+ */
+ public static AnimatablePaintValue createURIColorPaintValue
+ (AnimationTarget target, String uri, Color c) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target, c);
+ v.uri = uri;
+ v.paintType = PAINT_URI_COLOR;
+ return v;
+ }
+
+ /**
+ * Creates a new AnimatablePaintValue for a 'inherit' value.
+ */
+ public static AnimatablePaintValue createInheritPaintValue
+ (AnimationTarget target) {
+ AnimatablePaintValue v = new AnimatablePaintValue(target);
+ v.paintType = PAINT_INHERIT;
+ return v;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ if (paintType == PAINT_COLOR) {
+ if (to instanceof AnimatablePaintValue) {
+ AnimatablePaintValue toPaint = (AnimatablePaintValue) to;
+ if (toPaint.getPaintType() == PAINT_COLOR) {
+ return super.interpolate(to, interpolation, accumulation);
+ }
+ } else if (to instanceof AnimatableColorValue) {
+ return super.interpolate(to, interpolation, accumulation);
+ }
+ }
+ return this;
+ }
+
+ /**
+ * Returns the type of paint this value represents.
+ */
+ public int getPaintType() {
+ return paintType;
+ }
+
+ /**
+ * Returns the paint server URI.
+ */
+ public String getURI() {
+ return uri;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ return AnimatablePaintValue.createColorPaintValue(target, Color.BLACK);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePaintValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePercentageValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePercentageValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePercentageValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePercentageValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,20 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public class AnimatablePercentageValue extends AnimatableNumberValue {
+
+ /**
+ * Creates a new AnimatablePercentageValue.
+ */
+ public AnimatablePercentageValue(AnimationTarget target, float v) {
+ super(target, v);
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public AnimatableValue getZeroValue() {
+ return new AnimatablePercentageValue(target, 0);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePercentageValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePointListValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePointListValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePointListValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePointListValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,18 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public class AnimatablePointListValue extends AnimatableNumberListValue {
+
+ /**
+ * The numbers.
+ */
+ protected float[] numbers;
+
+ /**
+ * Creates a new AnimatablePointListValue.
+ */
+ public AnimatablePointListValue(AnimationTarget target, float[] numbers) {
+ super(target, numbers);
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatablePointListValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,38 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+public abstract class AnimatableValue {
+
+ /**
+ * The target of the animation.
+ */
+ protected AnimationTarget target;
+
+ /**
+ * Creates a new AnimatableValue.
+ */
+ protected AnimatableValue(AnimationTarget target) {
+ this.target = target;
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public abstract AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation);
+
+ /**
+ * Adds the given AnimatableValue to this one and returns the result.
+ */
+ public /*abstract*/ AnimatableValue add(AnimatableValue v) {
+ // XXX
+ return null;
+ }
+
+ /**
+ * Returns a zero value of this AnimatableValue's type.
+ */
+ public abstract AnimatableValue getZeroValue();
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/AnimatableValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/UninterpolableAnimatableValue.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/UninterpolableAnimatableValue.java?rev=384062&view=auto
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/UninterpolableAnimatableValue.java (added)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/UninterpolableAnimatableValue.java Tue Mar 7 16:03:46 2006
@@ -0,0 +1,25 @@
+package org.apache.batik.anim.values;
+
+import org.apache.batik.anim.AnimationTarget;
+
+/**
+ * A class for AnimatableValues that cannot be interpolated.
+ */
+public abstract class UninterpolableAnimatableValue extends AnimatableValue {
+
+ /**
+ * Creates a new UninterpolableAnimatableValue.
+ */
+ protected UninterpolableAnimatableValue(AnimationTarget target) {
+ super(target);
+ }
+
+ /**
+ * Performs interpolation to the given value.
+ */
+ public AnimatableValue interpolate(AnimatableValue to,
+ float interpolation,
+ AnimatableValue accumulation) {
+ return this;
+ }
+}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/anim/values/UninterpolableAnimatableValue.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverter.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverter.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverter.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverter.java Tue Mar 7 16:03:46 2006
@@ -1024,10 +1024,10 @@
String dest = null;
if (suffixStart != -1) {
// Replace existing suffix.
- dest = new String(oldName.substring(0, suffixStart) + newSuffix);
+ dest = oldName.substring(0, suffixStart) + newSuffix;
} else {
// Add new suffix.
- dest = new String(oldName + newSuffix);
+ dest = oldName + newSuffix;
}
return dest;
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterFileSource.java Tue Mar 7 16:03:46 2006
@@ -78,6 +78,10 @@
return file.equals(((SVGConverterFileSource)o).file);
}
+ public int hashCode() {
+ return file.hashCode();
+ }
+
public InputStream openStream() throws FileNotFoundException{
return new FileInputStream(file);
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterURLSource.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterURLSource.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterURLSource.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/rasterizer/SVGConverterURLSource.java Tue Mar 7 16:03:46 2006
@@ -93,6 +93,11 @@
return purl.equals(((SVGConverterURLSource)o).purl);
}
+
+ public int hashCode() {
+ return purl.hashCode();
+ }
+
public InputStream openStream() throws IOException {
return purl.openStream();
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/slideshow/Main.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/slideshow/Main.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/slideshow/Main.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/slideshow/Main.java Tue Mar 7 16:03:46 2006
@@ -297,7 +297,7 @@
int idx = str.indexOf('#');
if (idx != -1)
str = str.substring(0, idx);
- str.trim();
+ str = str.trim();
if (str.length() == 0)
continue;
try {
@@ -309,6 +309,8 @@
}
} catch (IOException ioe) {
System.err.println("Error while reading file-list: " + file);
+ } finally {
+ try { br.close(); } catch (IOException ioe) { }
}
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/JSVGViewerFrame.java Tue Mar 7 16:03:46 2006
@@ -789,52 +789,51 @@
t = st.substring(i + 1);
st = st.substring(0, i);
}
- if (!st.equals("")) {
- try{
- File f = new File(st);
- if (f.exists()) {
- if (f.isDirectory()) {
- st = null;
- } else {
- try {
- st = f.getCanonicalPath();
- if (st.startsWith("/")) {
- st = "file:" + st;
- } else {
- st = "file:/" + st;
- }
- } catch (IOException ex) {
+
+ if (st.equals(""))
+ return;
+
+ try{
+ File f = new File(st);
+ if (f.exists()) {
+ if (f.isDirectory()) {
+ return;
+ } else {
+ try {
+ st = f.getCanonicalPath();
+ if (st.startsWith("/")) {
+ st = "file:" + st;
+ } else {
+ st = "file:/" + st;
}
+ } catch (IOException ex) {
}
}
- }catch(SecurityException se){
- // Could not patch the file URI for security
- // reasons (e.g., when run as an unsigned
- // JavaWebStart jar): file access is not
- // allowed. Loading will fail, but there is
- // nothing more to do at this point.
}
+ }catch(SecurityException se){
+ // Could not patch the file URI for security
+ // reasons (e.g., when run as an unsigned
+ // JavaWebStart jar): file access is not
+ // allowed. Loading will fail, but there is
+ // nothing more to do at this point.
+ }
- if (st != null) {
- String fi = svgCanvas.getFragmentIdentifier();
- if (svgDocument != null) {
- ParsedURL docPURL
- = new ParsedURL(svgDocument.getURL());
- ParsedURL purl = new ParsedURL(docPURL, st);
- fi = (fi == null) ? "" : fi;
- if (docPURL.equals(purl) && t.equals(fi)) {
- return;
- }
- }
- if (t.length() != 0) {
- st = st.substring(0, st.length()-(fi.length()+1));
- st += "#" + t;
- }
- locationBar.setText(st);
- locationBar.addToHistory(st);
- showSVGDocument(st);
+ String fi = svgCanvas.getFragmentIdentifier();
+ if (svgDocument != null) {
+ ParsedURL docPURL
+ = new ParsedURL(svgDocument.getURL());
+ ParsedURL purl = new ParsedURL(docPURL, st);
+ fi = (fi == null) ? "" : fi;
+ if (docPURL.equals(purl) && t.equals(fi)) {
+ return;
}
}
+ if (t.length() != 0) {
+ st += "#" + t;
+ }
+ locationBar.setText(st);
+ locationBar.addToHistory(st);
+ showSVGDocument(st);
}
});
@@ -1219,8 +1218,11 @@
//
// Set transcoding hints
//
- pt.addTranscodingHint(PrintTranscoder.KEY_XML_PARSER_CLASSNAME,
- application.getXMLParserClassName());
+ if (application.getXMLParserClassName() != null) {
+ pt.addTranscodingHint
+ (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
+ application.getXMLParserClassName());
+ }
pt.addTranscodingHint(PrintTranscoder.KEY_SHOW_PAGE_DIALOG,
Boolean.TRUE);
@@ -1396,9 +1398,11 @@
int w = buffer.getWidth();
int h = buffer.getHeight();
final ImageTranscoder trans = new JPEGTranscoder();
- trans.addTranscodingHint
- (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
- application.getXMLParserClassName());
+ if (application.getXMLParserClassName() != null) {
+ trans.addTranscodingHint
+ (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
+ application.getXMLParserClassName());
+ }
trans.addTranscodingHint
(JPEGTranscoder.KEY_QUALITY, new Float(quality));
@@ -1416,7 +1420,6 @@
OutputStream ostream =
new BufferedOutputStream(new FileOutputStream(f));
trans.writeImage(img, new TranscoderOutput(ostream));
- ostream.flush();
ostream.close();
} catch (Exception ex) { }
statusBar.setMessage
@@ -1460,8 +1463,11 @@
int w = buffer.getWidth();
int h = buffer.getHeight();
final ImageTranscoder trans = new PNGTranscoder();
- trans.addTranscodingHint(PNGTranscoder.KEY_XML_PARSER_CLASSNAME,
- application.getXMLParserClassName());
+ if (application.getXMLParserClassName() != null) {
+ trans.addTranscodingHint
+ (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
+ application.getXMLParserClassName());
+ }
trans.addTranscodingHint(PNGTranscoder.KEY_FORCE_TRANSPARENT_WHITE,
new Boolean(true));
@@ -1485,7 +1491,7 @@
new BufferedOutputStream(new FileOutputStream(f));
trans.writeImage(img,
new TranscoderOutput(ostream));
- ostream.flush();
+ ostream.close();
} catch (Exception ex) {}
statusBar.setMessage
(resources.getString("Message.done"));
@@ -1522,9 +1528,11 @@
int w = buffer.getWidth();
int h = buffer.getHeight();
final ImageTranscoder trans = new TIFFTranscoder();
- trans.addTranscodingHint
- (TIFFTranscoder.KEY_XML_PARSER_CLASSNAME,
- application.getXMLParserClassName());
+ if (application.getXMLParserClassName() != null) {
+ trans.addTranscodingHint
+ (JPEGTranscoder.KEY_XML_PARSER_CLASSNAME,
+ application.getXMLParserClassName());
+ }
final BufferedImage img = trans.createImage(w, h);
// paint the buffer to the image
@@ -1538,7 +1546,7 @@
(new FileOutputStream(f));
trans.writeImage
(img, new TranscoderOutput(ostream));
- ostream.flush();
+ ostream.close();
} catch (Exception ex) {}
statusBar.setMessage
(resources.getString("Message.done"));
@@ -2044,11 +2052,6 @@
stopAction.update(false);
svgCanvas.setCursor(DEFAULT_CURSOR);
String s = svgDocumentURL;
- String t = svgCanvas.getFragmentIdentifier();
- if (t != null) {
- s += "#" + t;
- }
-
locationBar.setText(s);
if (title == null) {
title = getTitle();
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/Main.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/Main.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/Main.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/apps/svgbrowser/Main.java Tue Mar 7 16:03:46 2006
@@ -219,7 +219,7 @@
* Controls whether the application can override the
* system security policy property. This is done when there
* was no initial security policy specified when the application
- * stated, in which case Batik will use that property.
+ * started, in which case Batik will use that property.
*/
protected boolean overrideSecurityPolicy = false;
@@ -303,6 +303,7 @@
securityEnforcer
= new ApplicationSecurityEnforcer(this.getClass(),
SQUIGGLE_SECURITY_POLICY);
+
try {
preferenceManager = new XMLPreferenceManager(SQUIGGLE_CONFIGURATION_FILE,
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractGraphicsNodeBridge.java Tue Mar 7 16:03:46 2006
@@ -61,28 +61,18 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public abstract class AbstractGraphicsNodeBridge extends AbstractSVGBridge
+public abstract class AbstractGraphicsNodeBridge extends AnimatableSVGBridge
implements SVGContext,
BridgeUpdateHandler,
GraphicsNodeBridge,
ErrorConstants {
/**
- * The element that has been handled by this bridge.
- */
- protected Element e;
-
- /**
* The graphics node constructed by this bridge.
*/
protected GraphicsNode node;
/**
- * The bridge context to use for dynamic updates.
- */
- protected BridgeContext ctx;
-
- /**
* Whether the document is an SVG 1.2 document.
*/
protected boolean isSVG12;
@@ -158,7 +148,7 @@
/**
* This method is invoked during the build phase if the document
- * is dynamic. The responsability of this method is to ensure that
+ * is dynamic. The responsibility of this method is to ensure that
* any dynamic modifications of the element this bridge is
* dedicated to, happen on its associated GVT product.
*/
@@ -390,7 +380,6 @@
*/
public float getPixelToMM() {
return getPixelUnitToMillimeter();
-
}
protected SoftReference bboxShape = null;
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGFilterPrimitiveElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGFilterPrimitiveElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGFilterPrimitiveElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGFilterPrimitiveElementBridge.java Tue Mar 7 16:03:46 2006
@@ -39,8 +39,8 @@
* @version $Id$
*/
public abstract class AbstractSVGFilterPrimitiveElementBridge
- extends AbstractSVGBridge
- implements FilterPrimitiveBridge, ErrorConstants {
+ extends AnimatableGenericSVGBridge
+ implements FilterPrimitiveBridge, ErrorConstants {
/**
* Constructs a new bridge for a filter primitive element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGGradientElementBridge.java Tue Mar 7 16:03:46 2006
@@ -40,8 +40,9 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public abstract class AbstractSVGGradientElementBridge extends AbstractSVGBridge
- implements PaintBridge, ErrorConstants {
+public abstract class AbstractSVGGradientElementBridge
+ extends AnimatableGenericSVGBridge
+ implements PaintBridge, ErrorConstants {
/**
* Constructs a new AbstractSVGGradientElementBridge.
@@ -288,8 +289,8 @@
/**
* Bridge class for the gradient <stop> element.
*/
- public static class SVGStopElementBridge extends AbstractSVGBridge
- implements Bridge {
+ public static class SVGStopElementBridge extends AnimatableGenericSVGBridge
+ implements Bridge {
/**
* Returns 'stop'.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGLightingElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGLightingElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGLightingElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/AbstractSVGLightingElementBridge.java Tue Mar 7 16:03:46 2006
@@ -112,7 +112,7 @@
* The base bridge class for light element.
*/
protected static abstract class AbstractSVGLightElementBridge
- extends AbstractSVGBridge {
+ extends AnimatableGenericSVGBridge {
/**
* Creates a <tt>Light</tt> according to the specified parameters.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/Bridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/Bridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/Bridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/Bridge.java Tue Mar 7 16:03:46 2006
@@ -19,7 +19,7 @@
/**
* A tagging interface that all bridges must implement. A bridge is
- * responsible on creating and maintaining an appropriate object
+ * responsible for creating and maintaining an appropriate object
* according to an Element.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/BridgeContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/BridgeContext.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/BridgeContext.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/BridgeContext.java Tue Mar 7 16:03:46 2006
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.InterruptedIOException;
import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
@@ -34,6 +35,7 @@
import java.util.Set;
import java.util.WeakHashMap;
+import org.apache.batik.bridge.svg12.SVG12BridgeContext;
import org.apache.batik.bridge.svg12.SVG12BridgeExtension;
import org.apache.batik.css.engine.CSSContext;
import org.apache.batik.css.engine.CSSEngine;
@@ -248,9 +250,14 @@
protected BridgeContext primaryContext;
/**
- * Constructs a new empty bridge context.
+ * Set of WeakReferences to child BridgeContexts.
*/
- protected BridgeContext() {}
+ protected HashSet childContexts = new HashSet();
+
+ /**
+ * The animation engine for the document.
+ */
+ protected SVGAnimationEngine animationEngine;
/**
* By default we share a unique instance of InterpreterPool.
@@ -258,6 +265,11 @@
private static InterpreterPool sharedPool = new InterpreterPool();
/**
+ * Constructs a new empty bridge context.
+ */
+ protected BridgeContext() {}
+
+ /**
* Constructs a new bridge context.
* @param userAgent the user agent
*/
@@ -305,8 +317,9 @@
return (BridgeContext)newDoc.getCSSEngine().getCSSContext();
BridgeContext subCtx;
- subCtx = createBridgeContext();
+ subCtx = createBridgeContext(newDoc);
subCtx.primaryContext = primaryContext != null ? primaryContext : this;
+ subCtx.primaryContext.childContexts.add(new WeakReference(subCtx));
subCtx.dynamicStatus = dynamicStatus;
subCtx.setGVTBuilder(getGVTBuilder());
subCtx.setTextPainter(getTextPainter());
@@ -320,9 +333,12 @@
/**
* This function creates a new BridgeContext, it mostly
* exists so subclasses can provide an instance of
- * themselves when a sub BridgeContext is needed
+ * themselves when a sub BridgeContext is needed.
*/
- public BridgeContext createBridgeContext() {
+ public BridgeContext createBridgeContext(SVGOMDocument doc) {
+ if (doc.isSVG12()) {
+ return new SVG12BridgeContext(getUserAgent(), getDocumentLoader());
+ }
return new BridgeContext(getUserAgent(), getDocumentLoader());
}
@@ -422,20 +438,19 @@
}
/**
- * Set Element Data.
- * Associates data object with element so it can be
- * retrieved later.
+ * Associates a data object with a node so it can be retrieved later.
+ * This is primarily used for caching the graphics node generated from
+ * a 'pattern' element. A soft reference to the data object is used.
*/
public void setElementData(Node n, Object data) {
- if (elementDataMap == null)
+ if (elementDataMap == null) {
elementDataMap = new WeakHashMap();
+ }
elementDataMap.put(n, new SoftReference(data));
}
/**
- * Set Element Data.
- * Associates data object with element so it can be
- * retrieved later.
+ * Retrieves a data object associated with the given node.
*/
public Object getElementData(Node n) {
if (elementDataMap == null)
@@ -665,6 +680,30 @@
return this;
}
+ /**
+ * Returns an array of the child contexts.
+ */
+ public BridgeContext[] getChildContexts() {
+ BridgeContext[] res = new BridgeContext[childContexts.size()];
+ Iterator it = childContexts.iterator();
+ for (int i = 0; i < res.length; i++) {
+ WeakReference wr = (WeakReference) it.next();
+ res[i] = (BridgeContext) wr.get();
+ }
+ return res;
+ }
+
+ /**
+ * Returns the AnimationEngine for the document. Creates one if
+ * it doesn't exist.
+ */
+ public SVGAnimationEngine getAnimationEngine() {
+ if (animationEngine == null) {
+ animationEngine = new SVGAnimationEngine(document, this);
+ }
+ return animationEngine;
+ }
+
// reference management //////////////////////////////////////////////////
/**
@@ -1325,7 +1364,7 @@
* Disposes this BridgeContext.
*/
public void dispose() {
-
+ childContexts.clear();
synchronized (eventListenerSet) {
// remove all listeners added by Bridges
Iterator iter = eventListenerSet.iterator();
@@ -1365,7 +1404,8 @@
}
/**
- * Returns the SVGContext associated to the specified Node or null if any.
+ * Returns the SVGContext associated to the specified Node or null if
+ * there is none.
*/
protected static SVGContext getSVGContext(Node node) {
if (node instanceof SVGOMElement) {
@@ -1376,7 +1416,8 @@
}
/**
- * Returns the SVGContext associated to the specified Node or null if any.
+ * Returns the BridgeUpdateHandler associated to the specified Node
+ * or null if there is none.
*/
protected static BridgeUpdateHandler getBridgeUpdateHandler(Node node) {
SVGContext ctx = getSVGContext(node);
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GVTBuilder.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GVTBuilder.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GVTBuilder.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GVTBuilder.java Tue Mar 7 16:03:46 2006
@@ -81,7 +81,7 @@
ex.setGraphicsNode(rootNode);
Element errElement = ex.getElement();
ex.setLineNumber(ctx.getDocumentLoader().getLineNumber(errElement));
- //ex.printStackTrace();
+ ex.printStackTrace();
throw ex; // re-throw the udpated exception
}
@@ -113,8 +113,10 @@
// get the appropriate bridge according to the specified element
Bridge bridge = ctx.getBridge(e);
if (bridge instanceof GenericBridge) {
- // If it is a GenericBridge just handle it and return.
+ // If it is a GenericBridge just handle it and any GenericBridge
+ // descendents and return.
((GenericBridge) bridge).handleElement(ctx, e);
+ handleGenericBridges(ctx, e);
return null;
} else if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
return null;
@@ -183,8 +185,10 @@
// get the appropriate bridge according to the specified element
Bridge bridge = ctx.getBridge(e);
if (bridge instanceof GenericBridge) {
- // If it is a GenericBridge just handle it and return.
+ // If it is a GenericBridge just handle it and any GenericBridge
+ // descendents and return.
((GenericBridge) bridge).handleElement(ctx, e);
+ handleGenericBridges(ctx, e);
return;
} else if (bridge == null || !(bridge instanceof GraphicsNodeBridge)) {
return;
@@ -237,6 +241,7 @@
Bridge b = ctx.getBridge(e2);
if (b instanceof GenericBridge) {
((GenericBridge) b).handleElement(ctx, e2);
+ handleGenericBridges(ctx, e2);
}
}
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GenericBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GenericBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GenericBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/GenericBridge.java Tue Mar 7 16:03:46 2006
@@ -34,8 +34,7 @@
* For example, see the <tt>SVGTitleElementBridge</tt>.
*
* @param ctx the bridge context to use
- * @param e the element that describes the graphics node to build
+ * @param e the element being handled
*/
void handleElement(BridgeContext ctx, Element e);
-
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGAElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGAElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGAElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGAElementBridge.java Tue Mar 7 16:03:46 2006
@@ -38,6 +38,10 @@
*/
public class SVGAElementBridge extends SVGGElementBridge {
+ protected AnchorListener al;
+ protected CursorMouseOverListener bl;
+ protected CursorMouseOutListener cl;
+
/**
* Constructs a new bridge for the <a> element.
*/
@@ -73,32 +77,56 @@
if (ctx.isInteractive()) {
NodeEventTarget target = (NodeEventTarget)e;
- EventListener l = new AnchorListener(ctx.getUserAgent());
+ al = new AnchorListener(ctx.getUserAgent());
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_CLICK,
- l, false, null);
+ al, false, null);
ctx.storeEventListenerNS
- (target, XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_CLICK,
- l, false);
+ (target,
+ XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_CLICK,
+ al, false);
- l = new CursorMouseOverListener(ctx.getUserAgent());
+ bl = new CursorMouseOverListener(ctx.getUserAgent());
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOVER,
- l, false, null);
+ bl, false, null);
ctx.storeEventListenerNS
- (target, XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOVER,
- l, false);
-
- l = new CursorMouseOutListener(ctx.getUserAgent());
+ (target,
+ XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOVER,
+ bl, false);
+ cl = new CursorMouseOutListener(ctx.getUserAgent());
target.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOUT,
- l, false, null);
+ cl, false, null);
ctx.storeEventListenerNS
- (target, XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOUT,
- l, false);
+ (target,
+ XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOUT,
+ cl, false);
}
}
+ public void dispose() {
+ NodeEventTarget target = (NodeEventTarget)e;
+ if (al != null) {
+ target.removeEventListenerNS
+ (XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_CLICK,
+ al, false);
+ al = null;
+ }
+ if (bl != null) {
+ target.removeEventListenerNS
+ (XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOVER,
+ bl, false);
+ bl = null;
+ }
+ if (cl != null) {
+ target.removeEventListenerNS
+ (XMLConstants.XML_EVENTS_NAMESPACE_URI, SVG_EVENT_MOUSEOUT,
+ cl, false);
+ cl = null;
+ }
+ super.dispose();
+ }
/**
* Returns true as the <a> element is a container.
*/
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGBridgeExtension.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGBridgeExtension.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGBridgeExtension.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGBridgeExtension.java Tue Mar 7 16:03:46 2006
@@ -147,7 +147,8 @@
ctx.putBridge(new SVGTitleElementBridge());
ctx.putBridge(new SVGUseElementBridge());
ctx.putBridge(new SVGVKernElementBridge());
-
+ ctx.putBridge(new SVGSetElementBridge());
+ System.err.println("added");
}
/**
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java Tue Mar 7 16:03:46 2006
@@ -39,8 +39,8 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public class SVGClipPathElementBridge extends AbstractSVGBridge
- implements ClipBridge {
+public class SVGClipPathElementBridge extends AnimatableGenericSVGBridge
+ implements ClipBridge {
/**
* Constructs a new bridge for the <clipPath> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescElementBridge.java Tue Mar 7 16:03:46 2006
@@ -39,10 +39,8 @@
return SVG_DESC_TAG;
}
-
/**
* Returns a new instance of this bridge.
*/
public Bridge getInstance() { return new SVGDescElementBridge(); }
}
-
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGDescriptiveElementBridge.java Tue Mar 7 16:03:46 2006
@@ -51,9 +51,10 @@
* <tt>SVGDescElementBridge</tt>.
*
* @param ctx the bridge context to use
- * @param e the element that describes the graphics node to build
+ * @param e the element to be handled
*/
public void handleElement(BridgeContext ctx, Element e){
+ System.err.println("desc handledElement");
UserAgent ua = ctx.getUserAgent();
ua.handleElement(e, Boolean.TRUE);
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeComponentTransferElementBridge.java Tue Mar 7 16:03:46 2006
@@ -227,7 +227,7 @@
* The base bridge class for component transfer function.
*/
protected static abstract class SVGFeFuncElementBridge
- extends AbstractSVGBridge {
+ extends AnimatableGenericSVGBridge {
/**
* Constructs a new bridge for component transfer function.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeMergeElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeMergeElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeMergeElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFeMergeElementBridge.java Tue Mar 7 16:03:46 2006
@@ -179,7 +179,8 @@
/**
* Bridge class for the <feMergeNode> element.
*/
- public static class SVGFeMergeNodeElementBridge extends AbstractSVGBridge {
+ public static class SVGFeMergeNodeElementBridge
+ extends AnimatableGenericSVGBridge {
/**
* Constructs a new bridge for the <feMergeNode> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFilterElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFilterElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFilterElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGFilterElementBridge.java Tue Mar 7 16:03:46 2006
@@ -43,8 +43,8 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public class SVGFilterElementBridge extends AbstractSVGBridge
- implements FilterBridge, ErrorConstants {
+public class SVGFilterElementBridge extends AnimatableGenericSVGBridge
+ implements FilterBridge, ErrorConstants {
/**
* Constructs a new bridge for the <filter> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMarkerElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMarkerElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMarkerElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMarkerElementBridge.java Tue Mar 7 16:03:46 2006
@@ -37,8 +37,8 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public class SVGMarkerElementBridge extends AbstractSVGBridge
- implements MarkerBridge, ErrorConstants {
+public class SVGMarkerElementBridge extends AnimatableGenericSVGBridge
+ implements MarkerBridge, ErrorConstants {
/**
* Constructs a new bridge for the <marker> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMaskElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMaskElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMaskElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGMaskElementBridge.java Tue Mar 7 16:03:46 2006
@@ -34,8 +34,8 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public class SVGMaskElementBridge extends AbstractSVGBridge
- implements MaskBridge {
+public class SVGMaskElementBridge extends AnimatableGenericSVGBridge
+ implements MaskBridge {
/**
* Constructs a new bridge for the <mask> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGPatternElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGPatternElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGPatternElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGPatternElementBridge.java Tue Mar 7 16:03:46 2006
@@ -45,8 +45,8 @@
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
* @version $Id$
*/
-public class SVGPatternElementBridge extends AbstractSVGBridge
- implements PaintBridge, ErrorConstants {
+public class SVGPatternElementBridge extends AnimatableGenericSVGBridge
+ implements PaintBridge, ErrorConstants {
/**
* Constructs a new SVGPatternElementBridge.
@@ -360,6 +360,4 @@
}
}
-
}
-
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextElementBridge.java Tue Mar 7 16:03:46 2006
@@ -877,10 +877,10 @@
if (preserve)
endLimit = asb.length();
- Map map = getAttributeMap(ctx, element, textPath, bidiLevel);
- Object o = map.get(TextAttribute.BIDI_EMBEDDING);
+ Map map = getAttributeMap(ctx, element, textPath, bidiLevel);
+ Object o = map.get(TextAttribute.BIDI_EMBEDDING);
Integer subBidiLevel = bidiLevel;
- if (o != null)
+ if (o != null)
subBidiLevel = ((Integer)o);
for (Node n = getFirstChild(element);
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextPathElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextPathElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextPathElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTextPathElementBridge.java Tue Mar 7 16:03:46 2006
@@ -34,7 +34,7 @@
* @author <a href="mailto:bella.robinson@cmis.csiro.au">Bella Robinson</a>
* @version $Id$
*/
-public class SVGTextPathElementBridge extends AbstractSVGBridge
+public class SVGTextPathElementBridge extends AnimatableGenericSVGBridge
implements ErrorConstants {
/**
@@ -137,7 +137,4 @@
return textPath;
}
-
-
}
-
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTitleElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTitleElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTitleElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/SVGTitleElementBridge.java Tue Mar 7 16:03:46 2006
@@ -45,4 +45,3 @@
*/
public Bridge getInstance() { return new SVGTitleElementBridge(); }
}
-
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UpdateManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UpdateManager.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UpdateManager.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UpdateManager.java Tue Mar 7 16:03:46 2006
@@ -126,6 +126,17 @@
protected boolean started;
/**
+ * Array of resource documents' BridgeContexts.
+ */
+ protected BridgeContext[] secondaryBridgeContexts;
+
+ /**
+ * Array of resource documents' ScriptingEnvironments that should
+ * have their SVGLoad event dispatched.
+ */
+ protected ScriptingEnvironment[] secondaryScriptingEnvironments;
+
+ /**
* Creates a new update manager.
* @param ctx The bridge context.
* @param gn GraphicsNode whose updates are to be tracked.
@@ -145,27 +156,74 @@
graphicsNode = gn;
- SVGOMDocument d = (SVGOMDocument) doc;
+ scriptingEnvironment = initializeScriptingEnvironment(bridgeContext);
+
+ // Any BridgeContexts for resource documents that exist
+ // when initializing the scripting environment for the
+ // primary document also need to have their scripting
+ // environments initialized.
+ secondaryBridgeContexts =
+ (BridgeContext[]) ctx.getChildContexts().clone();
+ secondaryScriptingEnvironments =
+ new ScriptingEnvironment[secondaryBridgeContexts.length];
+ for (int i = 0; i < secondaryBridgeContexts.length; i++) {
+ BridgeContext resCtx = secondaryBridgeContexts[i];
+ if (!((SVGOMDocument) resCtx.getDocument()).isSVG12()) {
+ continue;
+ }
+ resCtx.setUpdateManager(this);
+ ScriptingEnvironment se = initializeScriptingEnvironment(resCtx);
+ secondaryScriptingEnvironments[i] = se;
+ }
+ }
+
+ /**
+ * Creates an appropriate ScriptingEnvironment and XBL manager for
+ * the given document.
+ */
+ protected ScriptingEnvironment initializeScriptingEnvironment
+ (BridgeContext ctx) {
+ SVGOMDocument d = (SVGOMDocument) ctx.getDocument();
+ ScriptingEnvironment se;
if (d.isSVG12()) {
- scriptingEnvironment = new SVG12ScriptingEnvironment(ctx);
+ se = new SVG12ScriptingEnvironment(ctx);
ctx.xblManager = new DefaultXBLManager(d, ctx);
d.setXBLManager(ctx.xblManager);
} else {
- scriptingEnvironment = new ScriptingEnvironment(ctx);
+ se = new ScriptingEnvironment(ctx);
}
+ return se;
}
/**
* Dispatches an 'SVGLoad' event to the document.
*/
public synchronized void dispatchSVGLoadEvent()
- throws InterruptedException {
- scriptingEnvironment.loadScripts();
- scriptingEnvironment.dispatchSVGLoadEvent();
- if (bridgeContext.isSVG12() && bridgeContext.xblManager != null) {
- SVG12BridgeContext ctx12 = (SVG12BridgeContext) bridgeContext;
+ throws InterruptedException {
+ dispatchSVGLoadEvent(bridgeContext, scriptingEnvironment);
+ for (int i = 0; i < secondaryScriptingEnvironments.length; i++) {
+ BridgeContext ctx = secondaryBridgeContexts[i];
+ if (!((SVGOMDocument) ctx.getDocument()).isSVG12()) {
+ continue;
+ }
+ ScriptingEnvironment se = secondaryScriptingEnvironments[i];
+ dispatchSVGLoadEvent(ctx, se);
+ }
+ secondaryBridgeContexts = null;
+ secondaryScriptingEnvironments = null;
+ }
+
+ /**
+ * Dispatches an 'SVGLoad' event to the document.
+ */
+ protected void dispatchSVGLoadEvent(BridgeContext ctx,
+ ScriptingEnvironment se) {
+ se.loadScripts();
+ se.dispatchSVGLoadEvent();
+ if (ctx.isSVG12() && ctx.xblManager != null) {
+ SVG12BridgeContext ctx12 = (SVG12BridgeContext) ctx;
ctx12.addBindingListener();
- bridgeContext.xblManager.startProcessing();
+ ctx12.xblManager.startProcessing();
}
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UserAgent.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UserAgent.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UserAgent.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/UserAgent.java Tue Mar 7 16:03:46 2006
@@ -292,10 +292,10 @@
* can't be loaded. If it returns 'null' then a BridgeException will
* be thrown.
*
- * @param e The <image> element that can't be loaded.
+ * @param e The <image> element that can't be loaded.
* @param url The resolved url that can't be loaded.
* @param message As best as can be determined the reason it can't be
- * loaded (not available, corrupt, unknown format,...).
+ * loaded (not available, corrupt, unknown format, ...).
*/
SVGDocument getBrokenLinkDocument(Element e, String url, String message);
}
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVG12BridgeContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVG12BridgeContext.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVG12BridgeContext.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVG12BridgeContext.java Tue Mar 7 16:03:46 2006
@@ -133,6 +133,7 @@
AbstractNode n = (AbstractNode) document;
XBLEventSupport es = (XBLEventSupport) n.initializeEventSupport();
+ childContexts.clear();
synchronized (eventListenerSet) {
// remove all listeners added by Bridges
Iterator iter = eventListenerSet.iterator();
@@ -378,10 +379,13 @@
/**
* This function creates a new BridgeContext, it mostly
* exists so subclasses can provide an instance of
- * themselves when a sub BridgeContext is needed
+ * themselves when a sub BridgeContext is needed.
*/
- public BridgeContext createBridgeContext() {
- return new SVG12BridgeContext(getUserAgent(), getDocumentLoader());
+ public BridgeContext createBridgeContext(SVGOMDocument doc) {
+ if (doc.isSVG12()) {
+ return new SVG12BridgeContext(getUserAgent(), getDocumentLoader());
+ }
+ return new BridgeContext(getUserAgent(), getDocumentLoader());
}
public BridgeContext createSubBridgeContext(SVGOMDocument newDoc) {
@@ -391,21 +395,24 @@
}
BridgeContext subCtx = super.createSubBridgeContext(newDoc);
- if (isDynamic()) {
+ if (isDynamic() && subCtx.isDynamic()) {
setUpdateManager(subCtx, updateManager);
- ScriptingEnvironment se;
- if (newDoc.isSVG12()) {
- se = new SVG12ScriptingEnvironment(subCtx);
- } else {
- se = new ScriptingEnvironment(subCtx);
- }
- se.loadScripts();
- se.dispatchSVGLoadEvent();
- if (newDoc.isSVG12()) {
- DefaultXBLManager xm = new DefaultXBLManager(newDoc, subCtx);
- setXBLManager(subCtx, xm);
- newDoc.setXBLManager(xm);
- xm.startProcessing();
+ if (updateManager != null) {
+ ScriptingEnvironment se;
+ if (newDoc.isSVG12()) {
+ se = new SVG12ScriptingEnvironment(subCtx);
+ } else {
+ se = new ScriptingEnvironment(subCtx);
+ }
+ se.loadScripts();
+ se.dispatchSVGLoadEvent();
+ if (newDoc.isSVG12()) {
+ DefaultXBLManager xm =
+ new DefaultXBLManager(newDoc, subCtx);
+ setXBLManager(subCtx, xm);
+ newDoc.setXBLManager(xm);
+ xm.startProcessing();
+ }
}
}
return subCtx;
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGMultiImageElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGMultiImageElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGMultiImageElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGMultiImageElementBridge.java Tue Mar 7 16:03:46 2006
@@ -94,7 +94,7 @@
* Returns a new instance of this bridge.
*/
public Bridge getInstance() {
- return new SVGImageElementBridge();
+ return new SVGMultiImageElementBridge();
}
/**
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGSolidColorElementBridge.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGSolidColorElementBridge.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGSolidColorElementBridge.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/bridge/svg12/SVGSolidColorElementBridge.java Tue Mar 7 16:03:46 2006
@@ -22,7 +22,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.batik.bridge.AbstractSVGBridge;
+import org.apache.batik.bridge.AnimatableGenericSVGBridge;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.BridgeException;
import org.apache.batik.bridge.CSSUtilities;
@@ -48,8 +48,8 @@
*
* @author <a href="mailto:thomas.deweese@kodak.com">Thomas Deweese</a>
*/
-public class SVGSolidColorElementBridge extends AbstractSVGBridge
- implements PaintBridge {
+public class SVGSolidColorElementBridge extends AnimatableGenericSVGBridge
+ implements PaintBridge {
/**
* Constructs a new bridge for the <rect> element.
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMSVGStyleDeclaration.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMSVGStyleDeclaration.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMSVGStyleDeclaration.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMSVGStyleDeclaration.java Tue Mar 7 16:03:46 2006
@@ -171,5 +171,4 @@
}
}
-
}
Propchange: xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMStoredStyleDeclaration.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMStyleDeclaration.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMStyleDeclaration.java?rev=384062&r1=384061&r2=384062&view=diff
==============================================================================
--- xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMStyleDeclaration.java (original)
+++ xmlgraphics/batik/branches/anim/sources/org/apache/batik/css/dom/CSSOMStyleDeclaration.java Tue Mar 7 16:03:46 2006
@@ -235,7 +235,6 @@
* Returns the value at the given.
*/
String item(int idx);
-
}
/**
@@ -258,7 +257,6 @@
*/
void propertyChanged(String name, String value, String prio)
throws DOMException;
-
}
/**
@@ -307,6 +305,5 @@
public Value getValue() {
return CSSOMStyleDeclaration.this.valueProvider.getValue(property);
}
-
}
}