You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2013/10/08 16:03:29 UTC
[14/62] [abbrv] [partial] Merged Apache Flex 4.9.0 release branch
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGColorProfileElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGColorProfileElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGColorProfileElementBridge.java
index 73c74b0..5e37b43 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGColorProfileElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGColorProfileElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -20,11 +21,12 @@ package org.apache.flex.forks.batik.bridge;
import java.awt.color.ICC_Profile;
import java.io.IOException;
-import org.apache.flex.forks.batik.dom.svg.SVGOMDocument;
+import org.apache.flex.forks.batik.dom.AbstractNode;
import org.apache.flex.forks.batik.dom.util.XLinkSupport;
import org.apache.flex.forks.batik.ext.awt.color.ICCColorSpaceExt;
import org.apache.flex.forks.batik.ext.awt.color.NamedProfileCache;
import org.apache.flex.forks.batik.util.ParsedURL;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -35,7 +37,7 @@ import org.w3c.dom.NodeList;
* <tt>ICC_ColorSpace</tt> object.
*
* @author <a href="mailto:vincent.hardy@eng.sun.com">Vincent Hardy</a>
- * @version $Id: SVGColorProfileElementBridge.java,v 1.13 2004/08/18 07:12:33 vhardy Exp $ */
+ * @version $Id: SVGColorProfileElementBridge.java 501922 2007-01-31 17:47:47Z dvholten $ */
public class SVGColorProfileElementBridge extends AbstractSVGBridge
implements ErrorConstants {
@@ -64,7 +66,7 @@ public class SVGColorProfileElementBridge extends AbstractSVGBridge
Element paintedElement,
String iccProfileName) {
// Check if there is one if the cache.
- ICCColorSpaceExt cs = cache.request(iccProfileName.toLowerCase());
+ ICCColorSpaceExt cs = cache.request(iccProfileName.toLowerCase()); // todo locale??
if (cs != null){
return cs;
}
@@ -98,27 +100,25 @@ public class SVGColorProfileElementBridge extends AbstractSVGBridge
String href = XLinkSupport.getXLinkHref(profile);
ICC_Profile p = null;
if (href != null) {
- String baseURI= ((SVGOMDocument)doc).getURL();
- ParsedURL purl = new ParsedURL(baseURI, href);
- if (!purl.complete())
- throw new BridgeException(paintedElement, ERR_URI_MALFORMED,
- new Object[] {href});
- try{
- ParsedURL pDocURL = null;
- if (baseURI != null) {
- pDocURL = new ParsedURL(baseURI);
- }
-
- ctx.getUserAgent().checkLoadExternalResource(purl,
- pDocURL);
+ String baseURI = ((AbstractNode) profile).getBaseURI();
+ ParsedURL pDocURL = null;
+ if (baseURI != null) {
+ pDocURL = new ParsedURL(baseURI);
+ }
+ ParsedURL purl = new ParsedURL(pDocURL, href);
+ if (!purl.complete())
+ throw new BridgeException(ctx, paintedElement, ERR_URI_MALFORMED,
+ new Object[] {href});
+ try {
+ ctx.getUserAgent().checkLoadExternalResource(purl, pDocURL);
p = ICC_Profile.getInstance(purl.openStream());
- } catch(IOException e) {
- throw new BridgeException(paintedElement, ERR_URI_IO,
+ } catch (IOException ioEx) {
+ throw new BridgeException(ctx, paintedElement, ioEx, ERR_URI_IO,
new Object[] {href});
// ??? IS THAT AN ERROR FOR THE SVG SPEC ???
- } catch(SecurityException e) {
- throw new BridgeException(paintedElement, ERR_URI_UNSECURE,
+ } catch (SecurityException secEx) {
+ throw new BridgeException(ctx, paintedElement, secEx, ERR_URI_UNSECURE,
new Object[] {href});
}
}
@@ -127,7 +127,7 @@ public class SVGColorProfileElementBridge extends AbstractSVGBridge
}
// Extract the rendering intent from profile element
- int intent = convertIntent(profile);
+ int intent = convertIntent(profile, ctx);
cs = new ICCColorSpaceExt(p, intent);
// Add profile to cache
@@ -135,7 +135,7 @@ public class SVGColorProfileElementBridge extends AbstractSVGBridge
return cs;
}
- private static int convertIntent(Element profile) {
+ private static int convertIntent(Element profile, BridgeContext ctx) {
String intent
= profile.getAttributeNS(null, SVG_RENDERING_INTENT_ATTRIBUTE);
@@ -159,7 +159,7 @@ public class SVGColorProfileElementBridge extends AbstractSVGBridge
return ICCColorSpaceExt.SATURATION;
}
throw new BridgeException
- (profile, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, profile, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_RENDERING_INTENT_ATTRIBUTE, intent});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDecoratedShapeElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDecoratedShapeElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDecoratedShapeElementBridge.java
index 9fa7e7a..f02fb4e 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDecoratedShapeElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDecoratedShapeElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001,2003-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -30,7 +31,7 @@ import org.w3c.dom.Element;
* filled, stroked and can have markers.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGDecoratedShapeElementBridge.java,v 1.10 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGDecoratedShapeElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public abstract class SVGDecoratedShapeElementBridge
extends SVGShapeElementBridge {
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescElementBridge.java
index f6152d4..8392d2c 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001,2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -17,13 +18,11 @@
*/
package org.apache.flex.forks.batik.bridge;
-import org.w3c.dom.Element;
-
/**
* Bridge class for the <desc> element.
*
* @author <a href="mailto:vhardy@apache.org">Vincent Hardy</a>
- * @version $Id: SVGDescElementBridge.java,v 1.4 2005/02/27 02:08:51 deweese Exp $
+ * @version $Id: SVGDescElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGDescElementBridge extends SVGDescriptiveElementBridge {
@@ -39,10 +38,8 @@ public class SVGDescElementBridge extends SVGDescriptiveElementBridge {
return SVG_DESC_TAG;
}
-
/**
* Returns a new instance of this bridge.
*/
public Bridge getInstance() { return new SVGDescElementBridge(); }
}
-
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescriptiveElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescriptiveElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescriptiveElementBridge.java
index fcc631f..6e9d2c1 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescriptiveElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDescriptiveElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -25,16 +26,17 @@ import org.w3c.dom.Element;
import org.w3c.dom.events.MutationEvent;
import org.apache.flex.forks.batik.css.engine.CSSEngineEvent;
+import org.apache.flex.forks.batik.dom.svg.AnimatedLiveAttributeValue;
import org.apache.flex.forks.batik.dom.svg.SVGContext;
import org.apache.flex.forks.batik.dom.svg.SVGOMElement;
/**
* Base class for 'descriptive' elements, mostly title and desc.
*
- * @author <a href="mailto:deweese@apache.org">deweese</a>
- * @version $Id: SVGDescriptiveElementBridge.java,v 1.2 2005/03/27 08:58:30 cam Exp $
+ * @author <a href="mailto:deweese@apache.org">Thomas DeWeese</a>
+ * @version $Id: SVGDescriptiveElementBridge.java 478160 2006-11-22 13:35:06Z dvholten $
*/
-public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
+public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
implements GenericBridge, BridgeUpdateHandler, SVGContext {
Element theElt;
@@ -51,12 +53,12 @@ public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
* <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){
UserAgent ua = ctx.getUserAgent();
ua.handleElement(e, Boolean.TRUE);
-
+
if (ctx.isDynamic()) {
SVGDescriptiveElementBridge b;
b = (SVGDescriptiveElementBridge)getInstance();
@@ -77,21 +79,25 @@ public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
theElt = null;
parent = null;
}
- public void handleDOMNodeInsertedEvent(MutationEvent evt) {
+ public void handleDOMNodeInsertedEvent(MutationEvent evt) {
UserAgent ua = theCtx.getUserAgent();
ua.handleElement(theElt, Boolean.TRUE);
}
- public void handleDOMCharacterDataModified(MutationEvent evt) {
+ public void handleDOMCharacterDataModified(MutationEvent evt) {
UserAgent ua = theCtx.getUserAgent();
ua.handleElement(theElt, Boolean.TRUE);
}
- public void handleDOMNodeRemovedEvent (MutationEvent evt) {
+ public void handleDOMNodeRemovedEvent (MutationEvent evt) {
dispose();
}
public void handleDOMAttrModifiedEvent(MutationEvent evt) { }
public void handleCSSEngineEvent(CSSEngineEvent evt) { }
+ public void handleAnimatedAttributeChanged
+ (AnimatedLiveAttributeValue alav) { }
+ public void handleOtherAnimationChanged(String type) { }
+
// SVGContext implementation ///////////////////////////////////////////
@@ -109,14 +115,14 @@ public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
*/
public float getPixelToMM() {
return getPixelUnitToMillimeter();
-
+
}
public Rectangle2D getBBox() { return null; }
- public AffineTransform getScreenTransform() {
+ public AffineTransform getScreenTransform() {
return theCtx.getUserAgent().getTransform();
}
- public void setScreenTransform(AffineTransform at) {
+ public void setScreenTransform(AffineTransform at) {
theCtx.getUserAgent().setTransform(at);
}
public AffineTransform getCTM() { return null; }
@@ -128,4 +134,4 @@ public abstract class SVGDescriptiveElementBridge extends AbstractSVGBridge
return theCtx.getBlockHeight(theElt);
}
public float getFontSize() { return 0; }
-};
+}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDocumentBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDocumentBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDocumentBridge.java
new file mode 100644
index 0000000..129f011
--- /dev/null
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGDocumentBridge.java
@@ -0,0 +1,226 @@
+/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ */
+package org.apache.flex.forks.batik.bridge;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+
+import org.apache.flex.forks.batik.css.engine.CSSEngineEvent;
+import org.apache.flex.forks.batik.dom.svg.AnimatedLiveAttributeValue;
+import org.apache.flex.forks.batik.dom.svg.SVGContext;
+import org.apache.flex.forks.batik.dom.svg.SVGOMDocument;
+import org.apache.flex.forks.batik.gvt.GraphicsNode;
+import org.apache.flex.forks.batik.gvt.RootGraphicsNode;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.events.MutationEvent;
+
+/**
+ * Bridge class for an SVGDocument node.
+ *
+ * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
+ * @version $Id: SVGDocumentBridge.java 582434 2007-10-06 02:11:51Z cam $
+ */
+public class SVGDocumentBridge implements DocumentBridge, BridgeUpdateHandler,
+ SVGContext {
+
+ /**
+ * The document node this bridge is associated with.
+ */
+ protected Document document;
+
+ /**
+ * The graphics node constructed by this bridge.
+ */
+ protected RootGraphicsNode node;
+
+ /**
+ * The bridge context.
+ */
+ protected BridgeContext ctx;
+
+ /**
+ * Constructs a new bridge the SVG document.
+ */
+ public SVGDocumentBridge() {
+ }
+
+ // Bridge ////////////////////////////////////////////////////////////////
+
+ /**
+ * Returns the namespace URI of the element this <tt>Bridge</tt> is
+ * dedicated to. Returns <code>null</code>, as a Document node has no
+ * namespace URI.
+ */
+ public String getNamespaceURI() {
+ return null;
+ }
+
+ /**
+ * Returns the local name of the element this <tt>Bridge</tt> is dedicated
+ * to. Returns <code>null</code>, as a Document node has no local name.
+ */
+ public String getLocalName() {
+ return null;
+ }
+
+ /**
+ * Returns a new instance of this bridge.
+ */
+ public Bridge getInstance() {
+ return new SVGDocumentBridge();
+ }
+
+ // DocumentBridge ////////////////////////////////////////////////////////
+
+ /**
+ * Creates a <tt>GraphicsNode</tt> according to the specified parameters.
+ * This is called before children have been added to the
+ * returned GraphicsNode (obviously since you construct and return it).
+ *
+ * @param ctx the bridge context to use
+ * @param doc the document node that describes the graphics node to build
+ * @return a graphics node that represents the specified document node
+ */
+ public RootGraphicsNode createGraphicsNode(BridgeContext ctx,
+ Document doc) {
+ RootGraphicsNode gn = new RootGraphicsNode();
+ this.document = doc;
+ this.node = gn;
+ this.ctx = ctx;
+ ((SVGOMDocument) doc).setSVGContext(this);
+ return gn;
+ }
+
+ /**
+ * Builds using the specified BridgeContext and element, the
+ * specified graphics node. This is called after all the children
+ * of the node have been constructed and added, so it is safe to
+ * do work that depends on being able to see your children nodes
+ * in this method.
+ *
+ * @param ctx the bridge context to use
+ * @param doc the document node that describes the graphics node to build
+ * @param node the graphics node to build
+ */
+ public void buildGraphicsNode(BridgeContext ctx,
+ Document doc,
+ RootGraphicsNode node) {
+ if (ctx.isDynamic()) {
+ ctx.bind(doc, node);
+ }
+ }
+
+ // BridgeUpdateHandler ///////////////////////////////////////////////////
+
+ /**
+ * Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
+ */
+ public void handleDOMAttrModifiedEvent(MutationEvent evt) {
+ }
+
+ /**
+ * Invoked when an MutationEvent of type 'DOMNodeInserted' is fired.
+ */
+ public void handleDOMNodeInsertedEvent(MutationEvent evt) {
+ if (evt.getTarget() instanceof Element) {
+ Element childElt = (Element) evt.getTarget();
+
+ GVTBuilder builder = ctx.getGVTBuilder();
+ GraphicsNode childNode = builder.build(ctx, childElt);
+ if (childNode == null) {
+ return;
+ }
+
+ // There can only be one document element.
+ node.add(childNode);
+ }
+ }
+
+ /**
+ * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
+ */
+ public void handleDOMNodeRemovedEvent(MutationEvent evt) {
+ }
+
+ /**
+ * Invoked when an MutationEvent of type 'DOMCharacterDataModified'
+ * is fired.
+ */
+ public void handleDOMCharacterDataModified(MutationEvent evt) {
+ }
+
+ /**
+ * Invoked when an CSSEngineEvent is fired.
+ */
+ public void handleCSSEngineEvent(CSSEngineEvent evt) {
+ }
+
+ /**
+ * Invoked when the animated value of an animated attribute has changed.
+ */
+ public void handleAnimatedAttributeChanged(AnimatedLiveAttributeValue alav) {
+ }
+
+ /**
+ * Invoked when an 'other' animation value has changed.
+ */
+ public void handleOtherAnimationChanged(String type) {
+ }
+
+ /**
+ * Disposes this BridgeUpdateHandler and releases all resources.
+ */
+ public void dispose() {
+ ((SVGOMDocument) document).setSVGContext(null);
+ ctx.unbind(document);
+ }
+
+ // SVGContext //////////////////////////////////////////////////////////
+
+ /**
+ * Returns the size of a px CSS unit in millimeters.
+ */
+ public float getPixelUnitToMillimeter() {
+ return ctx.getUserAgent().getPixelUnitToMillimeter();
+ }
+
+ /**
+ * Returns the size of a px CSS unit in millimeters.
+ * This will be removed after next release.
+ * @see #getPixelUnitToMillimeter()
+ */
+ public float getPixelToMM() {
+ return getPixelUnitToMillimeter();
+ }
+
+ public Rectangle2D getBBox() { return null; }
+ public AffineTransform getScreenTransform() {
+ return ctx.getUserAgent().getTransform();
+ }
+ public void setScreenTransform(AffineTransform at) {
+ ctx.getUserAgent().setTransform(at);
+ }
+ public AffineTransform getCTM() { return null; }
+ public AffineTransform getGlobalTransform() { return null; }
+ public float getViewportWidth() { return 0f; }
+ public float getViewportHeight() { return 0f; }
+ public float getFontSize() { return 0; }
+}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGEllipseElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGEllipseElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGEllipseElementBridge.java
index 89298ee..02df05d 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGEllipseElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGEllipseElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -20,16 +21,20 @@ package org.apache.flex.forks.batik.bridge;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;
+import org.apache.flex.forks.batik.dom.svg.AbstractSVGAnimatedLength;
+import org.apache.flex.forks.batik.dom.svg.AnimatedLiveAttributeValue;
+import org.apache.flex.forks.batik.dom.svg.LiveAttributeException;
+import org.apache.flex.forks.batik.dom.svg.SVGOMEllipseElement;
import org.apache.flex.forks.batik.gvt.ShapeNode;
import org.apache.flex.forks.batik.gvt.ShapePainter;
+
import org.w3c.dom.Element;
-import org.w3c.dom.events.MutationEvent;
/**
* Bridge class for the <ellipse> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGEllipseElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGEllipseElementBridge.java 527382 2007-04-11 04:31:58Z cam $
*/
public class SVGEllipseElementBridge extends SVGShapeElementBridge {
@@ -62,68 +67,55 @@ public class SVGEllipseElementBridge extends SVGShapeElementBridge {
protected void buildShape(BridgeContext ctx,
Element e,
ShapeNode shapeNode) {
-
- UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, e);
- String s;
-
- // 'cx' attribute - default is 0
- s = e.getAttributeNS(null, SVG_CX_ATTRIBUTE);
- float cx = 0;
- if (s.length() != 0) {
- cx = UnitProcessor.svgHorizontalCoordinateToUserSpace
- (s, SVG_CX_ATTRIBUTE, uctx);
- }
-
- // 'cy' attribute - default is 0
- s = e.getAttributeNS(null, SVG_CY_ATTRIBUTE);
- float cy = 0;
- if (s.length() != 0) {
- cy = UnitProcessor.svgVerticalCoordinateToUserSpace
- (s, SVG_CY_ATTRIBUTE, uctx);
+ try {
+ SVGOMEllipseElement ee = (SVGOMEllipseElement) e;
+
+ // 'cx' attribute - default is 0
+ AbstractSVGAnimatedLength _cx =
+ (AbstractSVGAnimatedLength) ee.getCx();
+ float cx = _cx.getCheckedValue();
+
+ // 'cy' attribute - default is 0
+ AbstractSVGAnimatedLength _cy =
+ (AbstractSVGAnimatedLength) ee.getCy();
+ float cy = _cy.getCheckedValue();
+
+ // 'rx' attribute - required
+ AbstractSVGAnimatedLength _rx =
+ (AbstractSVGAnimatedLength) ee.getRx();
+ float rx = _rx.getCheckedValue();
+
+ // 'ry' attribute - required
+ AbstractSVGAnimatedLength _ry =
+ (AbstractSVGAnimatedLength) ee.getRy();
+ float ry = _ry.getCheckedValue();
+
+ shapeNode.setShape(new Ellipse2D.Float(cx - rx, cy - ry,
+ rx * 2, ry * 2));
+ } catch (LiveAttributeException ex) {
+ throw new BridgeException(ctx, ex);
}
-
- // 'rx' attribute - required
- s = e.getAttributeNS(null, SVG_RX_ATTRIBUTE);
- float rx;
- if (s.length() != 0) {
- rx = UnitProcessor.svgHorizontalLengthToUserSpace
- (s, SVG_RX_ATTRIBUTE, uctx);
- } else {
- throw new BridgeException(e, ERR_ATTRIBUTE_MISSING,
- new Object[] {SVG_RX_ATTRIBUTE, s});
- }
-
- // 'ry' attribute - required
- s = e.getAttributeNS(null, SVG_RY_ATTRIBUTE);
- float ry;
- if (s.length() != 0) {
- ry = UnitProcessor.svgVerticalLengthToUserSpace
- (s, SVG_RY_ATTRIBUTE, uctx);
- } else {
- throw new BridgeException(e, ERR_ATTRIBUTE_MISSING,
- new Object[] {SVG_RY_ATTRIBUTE, s});
- }
-
- shapeNode.setShape(new Ellipse2D.Float(cx-rx, cy-ry, rx*2, ry*2));
}
// BridgeUpdateHandler implementation //////////////////////////////////
/**
- * Invoked when an MutationEvent of type 'DOMAttrModified' is fired.
+ * Invoked when the animated value of an animatable attribute has changed.
*/
- public void handleDOMAttrModifiedEvent(MutationEvent evt) {
- String attrName = evt.getAttrName();
- if (attrName.equals(SVG_CX_ATTRIBUTE) ||
- attrName.equals(SVG_CY_ATTRIBUTE) ||
- attrName.equals(SVG_RX_ATTRIBUTE) ||
- attrName.equals(SVG_RY_ATTRIBUTE)) {
-
- buildShape(ctx, e, (ShapeNode)node);
- handleGeometryChanged();
- } else {
- super.handleDOMAttrModifiedEvent(evt);
+ public void handleAnimatedAttributeChanged
+ (AnimatedLiveAttributeValue alav) {
+ if (alav.getNamespaceURI() == null) {
+ String ln = alav.getLocalName();
+ if (ln.equals(SVG_CX_ATTRIBUTE)
+ || ln.equals(SVG_CY_ATTRIBUTE)
+ || ln.equals(SVG_RX_ATTRIBUTE)
+ || ln.equals(SVG_RY_ATTRIBUTE)) {
+ buildShape(ctx, e, (ShapeNode)node);
+ handleGeometryChanged();
+ return;
+ }
}
+ super.handleAnimatedAttributeChanged(alav);
}
protected ShapePainter createShapePainter(BridgeContext ctx,
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeBlendElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeBlendElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeBlendElementBridge.java
index 0c25a66..4c1cbbe 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeBlendElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeBlendElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -34,7 +35,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feBlend> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeBlendElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeBlendElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGFeBlendElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -80,7 +81,7 @@ public class SVGFeBlendElementBridge
// 'mode' attribute - default is 'normal'
- CompositeRule rule = convertMode(filterElement);
+ CompositeRule rule = convertMode(filterElement, ctx);
// 'in' attribute
Filter in = getIn(filterElement,
@@ -140,7 +141,8 @@ public class SVGFeBlendElementBridge
*
* @param filterElement the filter feBlend element
*/
- protected static CompositeRule convertMode(Element filterElement) {
+ protected static CompositeRule convertMode(Element filterElement,
+ BridgeContext ctx) {
String rule = filterElement.getAttributeNS(null, SVG_MODE_ATTRIBUTE);
if (rule.length() == 0) {
return CompositeRule.OVER;
@@ -160,7 +162,8 @@ public class SVGFeBlendElementBridge
if (SVG_LIGHTEN_VALUE.equals(rule)) {
return CompositeRule.LIGHTEN;
}
- throw new BridgeException(filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_MODE_ATTRIBUTE, rule});
+ throw new BridgeException
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_MODE_ATTRIBUTE, rule});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeColorMatrixElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeColorMatrixElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeColorMatrixElementBridge.java
index d21a0d7..e046c02 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeColorMatrixElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeColorMatrixElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -33,7 +34,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feColorMatrix> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeColorMatrixElementBridge.java,v 1.16 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeColorMatrixElementBridge.java 504084 2007-02-06 11:24:46Z dvholten $
*/
public class SVGFeColorMatrixElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -99,26 +100,26 @@ public class SVGFeColorMatrixElementBridge
filterRegion,
ctx);
- int type = convertType(filterElement);
+ int type = convertType(filterElement, ctx);
ColorMatrixRable colorMatrix;
switch (type) {
case ColorMatrixRable.TYPE_HUE_ROTATE:
- float a = convertValuesToHueRotate(filterElement);
+ float a = convertValuesToHueRotate(filterElement, ctx);
colorMatrix = ColorMatrixRable8Bit.buildHueRotate(a);
break;
case ColorMatrixRable.TYPE_LUMINANCE_TO_ALPHA:
colorMatrix = ColorMatrixRable8Bit.buildLuminanceToAlpha();
break;
case ColorMatrixRable.TYPE_MATRIX:
- float [][] matrix = convertValuesToMatrix(filterElement);
+ float [][] matrix = convertValuesToMatrix(filterElement, ctx);
colorMatrix = ColorMatrixRable8Bit.buildMatrix(matrix);
break;
case ColorMatrixRable.TYPE_SATURATE:
- float s = convertValuesToSaturate(filterElement);
+ float s = convertValuesToSaturate(filterElement, ctx);
colorMatrix = ColorMatrixRable8Bit.buildSaturate(s);
break;
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid convertType:" + type ); // can't be reached
}
colorMatrix.setSource(in);
@@ -139,8 +140,10 @@ public class SVGFeColorMatrixElementBridge
* filter primitive element for the 'matrix' type.
*
* @param filterElement the filter element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static float[][] convertValuesToMatrix(Element filterElement) {
+ protected static float[][] convertValuesToMatrix(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
float [][] matrix = new float[4][5];
if (s.length() == 0) {
@@ -158,14 +161,14 @@ public class SVGFeColorMatrixElementBridge
= SVGUtilities.convertSVGNumber(tokens.nextToken());
n++;
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_VALUES_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_VALUES_ATTRIBUTE, s, nfEx });
}
if (n != 20 || tokens.hasMoreTokens()) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_VALUES_ATTRIBUTE, s});
}
@@ -180,17 +183,19 @@ public class SVGFeColorMatrixElementBridge
* filter primitive element for the 'saturate' type.
*
* @param filterElement the filter element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static float convertValuesToSaturate(Element filterElement) {
+ protected static float convertValuesToSaturate(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
if (s.length() == 0)
return 1; // default is 1
try {
return SVGUtilities.convertSVGNumber(s);
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object [] {SVG_VALUES_ATTRIBUTE, s});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_VALUES_ATTRIBUTE, s});
}
}
@@ -199,16 +204,18 @@ public class SVGFeColorMatrixElementBridge
* filter primitive element for the 'hueRotate' type.
*
* @param filterElement the filter element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static float convertValuesToHueRotate(Element filterElement) {
+ protected static float convertValuesToHueRotate(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
if (s.length() == 0)
return 0; // default is 0
try {
- return (float)(SVGUtilities.convertSVGNumber(s)*Math.PI)/180f;
- } catch (NumberFormatException ex) {
+ return (float) Math.toRadians( SVGUtilities.convertSVGNumber(s) );
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object [] {SVG_VALUES_ATTRIBUTE, s});
}
}
@@ -217,8 +224,9 @@ public class SVGFeColorMatrixElementBridge
* Converts the type of the specified color matrix filter primitive.
*
* @param filterElement the filter element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static int convertType(Element filterElement) {
+ protected static int convertType(Element filterElement, BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_TYPE_ATTRIBUTE);
if (s.length() == 0) {
return ColorMatrixRable.TYPE_MATRIX;
@@ -235,7 +243,8 @@ public class SVGFeColorMatrixElementBridge
if (SVG_SATURATE_VALUE.equals(s)) {
return ColorMatrixRable.TYPE_SATURATE;
}
- throw new BridgeException(filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_TYPE_ATTRIBUTE, s});
+ throw new BridgeException
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_TYPE_ATTRIBUTE, s});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeComponentTransferElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeComponentTransferElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeComponentTransferElementBridge.java
index 9025e50..cb48a82 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeComponentTransferElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeComponentTransferElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -35,7 +36,7 @@ import org.w3c.dom.Node;
* Bridge class for the <feComponentTransfer> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeComponentTransferElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeComponentTransferElementBridge.java 504084 2007-02-06 11:24:46Z dvholten $
*/
public class SVGFeComponentTransferElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -226,8 +227,8 @@ public class SVGFeComponentTransferElementBridge
/**
* The base bridge class for component transfer function.
*/
- protected static abstract class SVGFeFuncElementBridge
- extends AbstractSVGBridge {
+ protected abstract static class SVGFeFuncElementBridge
+ extends AnimatableGenericSVGBridge {
/**
* Constructs a new bridge for component transfer function.
@@ -244,10 +245,10 @@ public class SVGFeComponentTransferElementBridge
public ComponentTransferFunction createComponentTransferFunction
(Element filterElement, Element funcElement) {
- int type = convertType(funcElement);
+ int type = convertType(funcElement, ctx);
switch (type) {
case ComponentTransferFunction.DISCRETE: {
- float [] v = convertTableValues(funcElement);
+ float [] v = convertTableValues(funcElement, ctx);
if (v == null) {
return ConcreteComponentTransferFunction.getIdentityTransfer();
} else {
@@ -260,13 +261,13 @@ public class SVGFeComponentTransferElementBridge
case ComponentTransferFunction.GAMMA: {
// 'amplitude' attribute - default is 1
float amplitude
- = convertNumber(funcElement, SVG_AMPLITUDE_ATTRIBUTE, 1);
+ = convertNumber(funcElement, SVG_AMPLITUDE_ATTRIBUTE, 1, ctx);
// 'exponent' attribute - default is 1
float exponent
- = convertNumber(funcElement, SVG_EXPONENT_ATTRIBUTE, 1);
+ = convertNumber(funcElement, SVG_EXPONENT_ATTRIBUTE, 1, ctx);
// 'offset' attribute - default is 0
float offset
- = convertNumber(funcElement, SVG_OFFSET_ATTRIBUTE, 0);
+ = convertNumber(funcElement, SVG_OFFSET_ATTRIBUTE, 0, ctx);
return ConcreteComponentTransferFunction.getGammaTransfer
(amplitude, exponent, offset);
@@ -274,16 +275,16 @@ public class SVGFeComponentTransferElementBridge
case ComponentTransferFunction.LINEAR: {
// 'slope' attribute - default is 1
float slope
- = convertNumber(funcElement, SVG_SLOPE_ATTRIBUTE, 1);
+ = convertNumber(funcElement, SVG_SLOPE_ATTRIBUTE, 1, ctx);
// 'intercept' attribute - default is 0
float intercept
- = convertNumber(funcElement, SVG_INTERCEPT_ATTRIBUTE, 0);
+ = convertNumber(funcElement, SVG_INTERCEPT_ATTRIBUTE, 0, ctx);
return ConcreteComponentTransferFunction.getLinearTransfer
(slope, intercept);
}
case ComponentTransferFunction.TABLE: {
- float [] v = convertTableValues(funcElement);
+ float [] v = convertTableValues(funcElement, ctx);
if (v == null) {
return ConcreteComponentTransferFunction.getIdentityTransfer();
} else {
@@ -291,7 +292,7 @@ public class SVGFeComponentTransferElementBridge
}
}
default:
- throw new Error(); // can't be reached
+ throw new Error("invalid convertType:" + type ); // can't be reached
}
}
@@ -301,8 +302,9 @@ public class SVGFeComponentTransferElementBridge
* transfer function element.
*
* @param e the element that represents a component transfer function
+ * @param ctx the BridgeContext to use for error information
*/
- protected static float [] convertTableValues(Element e) {
+ protected static float [] convertTableValues(Element e, BridgeContext ctx) {
String s = e.getAttributeNS(null, SVG_TABLE_VALUES_ATTRIBUTE);
if (s.length() == 0) {
return null;
@@ -313,9 +315,9 @@ public class SVGFeComponentTransferElementBridge
for (int i = 0; tokens.hasMoreTokens(); ++i) {
v[i] = SVGUtilities.convertSVGNumber(tokens.nextToken());
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (e, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, e, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_TABLE_VALUES_ATTRIBUTE, s});
}
return v;
@@ -326,11 +328,12 @@ public class SVGFeComponentTransferElementBridge
* function element.
*
* @param e the element that represents a component transfer function
+ * @param ctx the BridgeContext to use for error information
*/
- protected static int convertType(Element e) {
+ protected static int convertType(Element e, BridgeContext ctx) {
String s = e.getAttributeNS(null, SVG_TYPE_ATTRIBUTE);
if (s.length() == 0) {
- throw new BridgeException(e, ERR_ATTRIBUTE_MISSING,
+ throw new BridgeException(ctx, e, ERR_ATTRIBUTE_MISSING,
new Object[] {SVG_TYPE_ATTRIBUTE});
}
if (SVG_DISCRETE_VALUE.equals(s)) {
@@ -348,7 +351,7 @@ public class SVGFeComponentTransferElementBridge
if (SVG_TABLE_VALUE.equals(s)) {
return ComponentTransferFunction.TABLE;
}
- throw new BridgeException(e, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ throw new BridgeException(ctx, e, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_TYPE_ATTRIBUTE, s});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeCompositeElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeCompositeElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeCompositeElementBridge.java
index 67b2dad..40afec3 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeCompositeElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeCompositeElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -34,7 +35,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feComposite> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeCompositeElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeCompositeElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGFeCompositeElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -79,7 +80,7 @@ public class SVGFeCompositeElementBridge
Map filterMap) {
// 'operator' attribute - default is 'over'
- CompositeRule rule = convertOperator(filterElement);
+ CompositeRule rule = convertOperator(filterElement, ctx);
// 'in' attribute
Filter in = getIn(filterElement,
@@ -137,8 +138,10 @@ public class SVGFeCompositeElementBridge
* filter primitive element.
*
* @param filterElement the feComposite filter element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static CompositeRule convertOperator(Element filterElement) {
+ protected static CompositeRule convertOperator(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_OPERATOR_ATTRIBUTE);
if (s.length() == 0) {
return CompositeRule.OVER; // default is over
@@ -159,13 +162,14 @@ public class SVGFeCompositeElementBridge
return CompositeRule.XOR;
}
if (SVG_ARITHMETIC_VALUE.equals(s)) {
- float k1 = convertNumber(filterElement, SVG_K1_ATTRIBUTE, 0);
- float k2 = convertNumber(filterElement, SVG_K2_ATTRIBUTE, 0);
- float k3 = convertNumber(filterElement, SVG_K3_ATTRIBUTE, 0);
- float k4 = convertNumber(filterElement, SVG_K4_ATTRIBUTE, 0);
+ float k1 = convertNumber(filterElement, SVG_K1_ATTRIBUTE, 0, ctx);
+ float k2 = convertNumber(filterElement, SVG_K2_ATTRIBUTE, 0, ctx);
+ float k3 = convertNumber(filterElement, SVG_K3_ATTRIBUTE, 0, ctx);
+ float k4 = convertNumber(filterElement, SVG_K4_ATTRIBUTE, 0, ctx);
return CompositeRule.ARITHMETIC(k1, k2, k3, k4);
}
- throw new BridgeException(filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_OPERATOR_ATTRIBUTE, s});
+ throw new BridgeException
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_OPERATOR_ATTRIBUTE, s});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeConvolveMatrixElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeConvolveMatrixElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeConvolveMatrixElementBridge.java
index 1fc2b60..75ed37e 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeConvolveMatrixElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeConvolveMatrixElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -36,7 +37,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feConvolveMatrix> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeConvolveMatrixElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeConvolveMatrixElementBridge.java 501922 2007-01-31 17:47:47Z dvholten $
*/
public class SVGFeConvolveMatrixElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -81,28 +82,28 @@ public class SVGFeConvolveMatrixElementBridge
Map filterMap) {
// 'order' attribute - default is [3, 3]
- int [] orderXY = convertOrder(filterElement);
+ int[] orderXY = convertOrder(filterElement, ctx);
// 'kernelMatrix' attribute - required
- float [] kernelMatrix = convertKernelMatrix(filterElement, orderXY);
+ float[] kernelMatrix = convertKernelMatrix(filterElement, orderXY, ctx);
// 'divisor' attribute - default is kernel matrix sum or 1 if sum is 0
- float divisor = convertDivisor(filterElement, kernelMatrix);
+ float divisor = convertDivisor(filterElement, kernelMatrix, ctx);
// 'bias' attribute - default is 0
- float bias = convertNumber(filterElement, SVG_BIAS_ATTRIBUTE, 0);
+ float bias = convertNumber(filterElement, SVG_BIAS_ATTRIBUTE, 0, ctx);
// 'targetX' and 'targetY' attribute
- int [] targetXY = convertTarget(filterElement, orderXY);
+ int[] targetXY = convertTarget(filterElement, orderXY, ctx);
// 'edgeMode' attribute - default is 'duplicate'
- PadMode padMode = convertEdgeMode(filterElement);
+ PadMode padMode = convertEdgeMode(filterElement, ctx);
// 'kernelUnitLength' attribute
- double [] kernelUnitLength = convertKernelUnitLength(filterElement);
+ double[] kernelUnitLength = convertKernelUnitLength(filterElement, ctx);
// 'preserveAlpha' attribute - default is 'false'
- boolean preserveAlpha = convertPreserveAlpha(filterElement);
+ boolean preserveAlpha = convertPreserveAlpha(filterElement, ctx);
// 'in' attribute
Filter in = getIn(filterElement,
@@ -158,8 +159,10 @@ public class SVGFeConvolveMatrixElementBridge
* filter primitive element.
*
* @param filterElement the feConvolveMatrix filter primitive element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static int [] convertOrder(Element filterElement) {
+ protected static int[] convertOrder(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_ORDER_ATTRIBUTE);
if (s.length() == 0) {
return new int[] {3, 3};
@@ -173,14 +176,14 @@ public class SVGFeConvolveMatrixElementBridge
} else {
orderXY[1] = orderXY[0];
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_ORDER_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_ORDER_ATTRIBUTE, s, nfEx });
}
if (tokens.hasMoreTokens() || orderXY[0] <= 0 || orderXY[1] <= 0) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_ORDER_ATTRIBUTE, s});
}
return orderXY;
@@ -192,15 +195,17 @@ public class SVGFeConvolveMatrixElementBridge
*
* @param filterElement the feConvolveMatrix filter primitive element
* @param orderXY the value of the 'order' attribute
+ * @param ctx the BridgeContext to use for error information
*/
- protected static
- float [] convertKernelMatrix(Element filterElement, int [] orderXY) {
+ protected static float[] convertKernelMatrix(Element filterElement,
+ int[] orderXY,
+ BridgeContext ctx) {
String s =
filterElement.getAttributeNS(null, SVG_KERNEL_MATRIX_ATTRIBUTE);
if (s.length() == 0) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_MISSING,
+ (ctx, filterElement, ERR_ATTRIBUTE_MISSING,
new Object[] {SVG_KERNEL_MATRIX_ATTRIBUTE});
}
int size = orderXY[0]*orderXY[1];
@@ -212,14 +217,14 @@ public class SVGFeConvolveMatrixElementBridge
kernelMatrix[i++]
= SVGUtilities.convertSVGNumber(tokens.nextToken());
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_KERNEL_MATRIX_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_KERNEL_MATRIX_ATTRIBUTE, s, nfEx });
}
if (i != size) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_KERNEL_MATRIX_ATTRIBUTE, s});
}
return kernelMatrix;
@@ -231,9 +236,11 @@ public class SVGFeConvolveMatrixElementBridge
*
* @param filterElement the feConvolveMatrix filter primitive element
* @param kernelMatrix the value of the 'kernelMatrix' attribute
+ * @param ctx the BridgeContext to use for error information
*/
- protected static
- float convertDivisor(Element filterElement, float [] kernelMatrix) {
+ protected static float convertDivisor(Element filterElement,
+ float[] kernelMatrix,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_DIVISOR_ATTRIBUTE);
if (s.length() == 0) {
@@ -242,14 +249,14 @@ public class SVGFeConvolveMatrixElementBridge
for (int i=0; i < kernelMatrix.length; ++i) {
sum += kernelMatrix[i];
}
- return (sum == 0) ? 1f : sum;
+ return (sum == 0) ? 1.0f : sum;
} else {
try {
return SVGUtilities.convertSVGNumber(s);
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_DIVISOR_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_DIVISOR_ATTRIBUTE, s, nfEx });
}
}
}
@@ -260,11 +267,12 @@ public class SVGFeConvolveMatrixElementBridge
*
* @param filterElement the feConvolveMatrix filter primitive element
* @param orderXY the value of the 'order' attribute
+ * @param ctx the BridgeContext to use for error information
*/
- protected static
- int [] convertTarget(Element filterElement, int [] orderXY) {
+ protected static int[] convertTarget(Element filterElement, int[] orderXY,
+ BridgeContext ctx) {
- int [] targetXY = new int[2];
+ int[] targetXY = new int[2];
// 'targetX' attribute - default is floor(orderX / 2)
String s = filterElement.getAttributeNS(null, SVG_TARGET_X_ATTRIBUTE);
if (s.length() == 0) {
@@ -274,14 +282,14 @@ public class SVGFeConvolveMatrixElementBridge
int v = SVGUtilities.convertSVGInteger(s);
if (v < 0 || v >= orderXY[0]) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_TARGET_X_ATTRIBUTE, s});
}
targetXY[0] = v;
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_TARGET_X_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_TARGET_X_ATTRIBUTE, s, nfEx });
}
}
// 'targetY' attribute - default is floor(orderY / 2)
@@ -293,14 +301,14 @@ public class SVGFeConvolveMatrixElementBridge
int v = SVGUtilities.convertSVGInteger(s);
if (v < 0 || v >= orderXY[1]) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_TARGET_Y_ATTRIBUTE, s});
}
targetXY[1] = v;
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_TARGET_Y_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_TARGET_Y_ATTRIBUTE, s, nfEx });
}
}
return targetXY;
@@ -311,8 +319,10 @@ public class SVGFeConvolveMatrixElementBridge
* feConvolveMatrix filter primitive element.
*
* @param filterElement the feConvolveMatrix filter primitive element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static double [] convertKernelUnitLength(Element filterElement) {
+ protected static double[] convertKernelUnitLength(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS
(null, SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE);
if (s.length() == 0) {
@@ -327,15 +337,15 @@ public class SVGFeConvolveMatrixElementBridge
} else {
units[1] = units[0];
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE, s});
}
if (tokens.hasMoreTokens() || units[0] <= 0 || units[1] <= 0) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_KERNEL_UNIT_LENGTH_ATTRIBUTE, s});
}
return units;
@@ -346,8 +356,10 @@ public class SVGFeConvolveMatrixElementBridge
* filter primitive element.
*
* @param filterElement the feConvolveMatrix filter primitive element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static PadMode convertEdgeMode(Element filterElement) {
+ protected static PadMode convertEdgeMode(Element filterElement,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, SVG_EDGE_MODE_ATTRIBUTE);
if (s.length() == 0) {
return PadMode.REPLICATE;
@@ -362,7 +374,7 @@ public class SVGFeConvolveMatrixElementBridge
return PadMode.ZERO_PAD;
}
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_EDGE_MODE_ATTRIBUTE, s});
}
@@ -371,8 +383,10 @@ public class SVGFeConvolveMatrixElementBridge
* filter primitive element.
*
* @param filterElement the feConvolveMatrix filter primitive element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static boolean convertPreserveAlpha(Element filterElement) {
+ protected static boolean convertPreserveAlpha(Element filterElement,
+ BridgeContext ctx) {
String s
= filterElement.getAttributeNS(null, SVG_PRESERVE_ALPHA_ATTRIBUTE);
if (s.length() == 0) {
@@ -385,7 +399,7 @@ public class SVGFeConvolveMatrixElementBridge
return false;
}
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_PRESERVE_ALPHA_ATTRIBUTE, s});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDiffuseLightingElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDiffuseLightingElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDiffuseLightingElementBridge.java
index c2ebc3a..1765a0f 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDiffuseLightingElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDiffuseLightingElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -30,7 +31,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feDiffuseLighting> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeDiffuseLightingElementBridge.java,v 1.16 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeDiffuseLightingElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGFeDiffuseLightingElementBridge
extends AbstractSVGLightingElementBridge {
@@ -76,11 +77,12 @@ public class SVGFeDiffuseLightingElementBridge
// 'surfaceScale' attribute - default is 1
float surfaceScale
- = convertNumber(filterElement, SVG_SURFACE_SCALE_ATTRIBUTE, 1);
+ = convertNumber(filterElement, SVG_SURFACE_SCALE_ATTRIBUTE, 1, ctx);
// 'diffuseConstant' attribute - default is 1
float diffuseConstant
- = convertNumber(filterElement, SVG_DIFFUSE_CONSTANT_ATTRIBUTE, 1);
+ = convertNumber(filterElement, SVG_DIFFUSE_CONSTANT_ATTRIBUTE, 1,
+ ctx);
// 'kernelUnitLength' attribute
// <!> FIXME: Why is it ignored ???
@@ -89,7 +91,7 @@ public class SVGFeDiffuseLightingElementBridge
Light light = extractLight(filterElement, ctx);
// 'kernelUnitLength' attribute
- double [] kernelUnitLength = convertKernelUnitLength(filterElement);
+ double[] kernelUnitLength = convertKernelUnitLength(filterElement, ctx);
// 'in' attribute
Filter in = getIn(filterElement,
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDisplacementMapElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDisplacementMapElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDisplacementMapElementBridge.java
index 6c2e3df..2806158 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDisplacementMapElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeDisplacementMapElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -35,7 +36,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feDisplacementMap> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeDisplacementMapElementBridge.java,v 1.15 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeDisplacementMapElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGFeDisplacementMapElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -80,15 +81,17 @@ public class SVGFeDisplacementMapElementBridge
Map filterMap) {
// 'scale' attribute - default is 0
- float scale = convertNumber(filterElement, SVG_SCALE_ATTRIBUTE, 0);
+ float scale = convertNumber(filterElement, SVG_SCALE_ATTRIBUTE, 0, ctx);
// 'xChannelSelector' attribute - default is 'A'
ARGBChannel xChannelSelector = convertChannelSelector
- (filterElement, SVG_X_CHANNEL_SELECTOR_ATTRIBUTE, ARGBChannel.A);
+ (filterElement, SVG_X_CHANNEL_SELECTOR_ATTRIBUTE, ARGBChannel.A,
+ ctx);
// 'yChannelSelector' attribute - default is 'A'
ARGBChannel yChannelSelector = convertChannelSelector
- (filterElement, SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE, ARGBChannel.A);
+ (filterElement, SVG_Y_CHANNEL_SELECTOR_ATTRIBUTE, ARGBChannel.A,
+ ctx);
// 'in' attribute
Filter in = getIn(filterElement,
@@ -152,11 +155,13 @@ public class SVGFeDisplacementMapElementBridge
*
* @param filterElement the feDisplacementMap filter primitive element
* @param attrName the name of the channel attribute
+ * @param ctx the BridgeContext to use for error information
*/
protected static
ARGBChannel convertChannelSelector(Element filterElement,
String attrName,
- ARGBChannel defaultChannel) {
+ ARGBChannel defaultChannel,
+ BridgeContext ctx) {
String s = filterElement.getAttributeNS(null, attrName);
if (s.length() == 0) {
@@ -174,7 +179,8 @@ public class SVGFeDisplacementMapElementBridge
if (SVG_B_VALUE.equals(s)) {
return ARGBChannel.B;
}
- throw new BridgeException(filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {attrName, s});
+ throw new BridgeException
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {attrName, s});
}
}
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeFloodElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeFloodElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeFloodElementBridge.java
index 3ac34b1..4c2feaf 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeFloodElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeFloodElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001,2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -30,7 +31,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feFlood> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeFloodElementBridge.java,v 1.12 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeFloodElementBridge.java 475477 2006-11-15 22:44:28Z cam $
*/
public class SVGFeFloodElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f690ea2f/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeGaussianBlurElementBridge.java
----------------------------------------------------------------------
diff --git a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeGaussianBlurElementBridge.java b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeGaussianBlurElementBridge.java
index c193250..e76cc9c 100644
--- a/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeGaussianBlurElementBridge.java
+++ b/modules/thirdparty/batik/sources/org/apache/flex/forks/batik/bridge/SVGFeGaussianBlurElementBridge.java
@@ -1,10 +1,11 @@
/*
- Copyright 2001-2003 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@@ -33,7 +34,7 @@ import org.w3c.dom.Element;
* Bridge class for the <feGaussianBlur> element.
*
* @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
- * @version $Id: SVGFeGaussianBlurElementBridge.java,v 1.18 2004/08/18 07:12:33 vhardy Exp $
+ * @version $Id: SVGFeGaussianBlurElementBridge.java 501922 2007-01-31 17:47:47Z dvholten $
*/
public class SVGFeGaussianBlurElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -78,12 +79,12 @@ public class SVGFeGaussianBlurElementBridge
Map filterMap) {
// 'stdDeviation' attribute - default is [0, 0]
- float [] stdDeviationXY = convertStdDeviation(filterElement);
+ float[] stdDeviationXY = convertStdDeviation(filterElement, ctx);
if (stdDeviationXY[0] < 0 || stdDeviationXY[1] < 0) {
- throw new BridgeException(filterElement,
+ throw new BridgeException(ctx, filterElement,
ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_STD_DEVIATION_ATTRIBUTE,
- "" + stdDeviationXY[0] +
+ String.valueOf( stdDeviationXY[ 0 ] ) +
stdDeviationXY[1]});
}
@@ -135,8 +136,10 @@ public class SVGFeGaussianBlurElementBridge
* filter primitive element.
*
* @param filterElement the feGaussianBlur filter primitive element
+ * @param ctx the BridgeContext to use for error information
*/
- protected static float [] convertStdDeviation(Element filterElement) {
+ protected static float[] convertStdDeviation(Element filterElement,
+ BridgeContext ctx) {
String s
= filterElement.getAttributeNS(null, SVG_STD_DEVIATION_ATTRIBUTE);
if (s.length() == 0) {
@@ -151,14 +154,14 @@ public class SVGFeGaussianBlurElementBridge
} else {
stdDevs[1] = stdDevs[0];
}
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException nfEx ) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
- new Object[] {SVG_STD_DEVIATION_ATTRIBUTE, s, ex});
+ (ctx, filterElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ new Object[] {SVG_STD_DEVIATION_ATTRIBUTE, s, nfEx });
}
if (tokens.hasMoreTokens()) {
throw new BridgeException
- (filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
+ (ctx, filterElement, ERR_ATTRIBUTE_VALUE_MALFORMED,
new Object[] {SVG_STD_DEVIATION_ATTRIBUTE, s});
}
return stdDevs;