hillion 02/03/22 02:59:26 Modified: sources/org/apache/batik/bridge ScriptingEnvironment.java sources/org/apache/batik/dom/svg SVGLocatableSupport.java sources/org/apache/batik/script InterpreterPool.java Log: SVG DOM method getBBox() implemented. Revision Changes Path 1.17 +12 -1 xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java Index: ScriptingEnvironment.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ScriptingEnvironment.java 21 Mar 2002 15:26:51 -0000 1.16 +++ ScriptingEnvironment.java 22 Mar 2002 10:59:25 -0000 1.17 @@ -29,7 +29,7 @@ * This class contains the informations needed by the SVG scripting. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: ScriptingEnvironment.java,v 1.16 2002/03/21 15:26:51 hillion Exp $ + * @version $Id: ScriptingEnvironment.java,v 1.17 2002/03/22 10:59:25 hillion Exp $ */ public class ScriptingEnvironment extends BaseScriptingEnvironment { @@ -403,12 +403,20 @@ script = s; } public void run() { + if (error) { + return; + } count--; try { interpreter.evaluate(script); } catch (InterpreterException ie) { handleInterpreterException(ie); error = true; + } catch (Exception e) { + if (userAgent != null) { + userAgent.displayError(e); + } + error = true; } } } @@ -429,6 +437,9 @@ runnable = r; } public void run() { + if (error) { + return; + } count--; try { runnable.run(); 1.2 +33 -2 xml-batik/sources/org/apache/batik/dom/svg/SVGLocatableSupport.java Index: SVGLocatableSupport.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/svg/SVGLocatableSupport.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SVGLocatableSupport.java 10 Sep 2001 12:26:07 -0000 1.1 +++ SVGLocatableSupport.java 22 Mar 2002 10:59:26 -0000 1.2 @@ -8,6 +8,7 @@ package org.apache.batik.dom.svg; +import org.w3c.dom.DOMException; import org.w3c.dom.Element; import org.w3c.dom.svg.SVGElement; import org.w3c.dom.svg.SVGException; @@ -18,7 +19,7 @@ * This class provides support for the SVGLocatable interface. * * @author <a href="mailto:[EMAIL PROTECTED]">Stephane Hillion</a> - * @version $Id: SVGLocatableSupport.java,v 1.1 2001/09/10 12:26:07 hillion Exp $ + * @version $Id: SVGLocatableSupport.java,v 1.2 2002/03/22 10:59:26 hillion Exp $ */ public class SVGLocatableSupport { /** @@ -48,7 +49,37 @@ * org.w3c.dom.svg.SVGLocatable#getBBox()}. */ public static SVGRect getBBox(Element elt) { - throw new RuntimeException(" !!! TODO: getBBox()"); + final SVGOMElement svgelt = (SVGOMElement)elt; + return new SVGRect() { + public float getX() { + return (float)svgelt.getSVGContext().getBBox().getX(); + } + public void setX(float x) throws DOMException { + throw new DOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); + } + public float getY() { + return (float)svgelt.getSVGContext().getBBox().getY(); + } + public void setY(float y) throws DOMException { + throw new DOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); + } + public float getWidth() { + return (float)svgelt.getSVGContext().getBBox().getWidth(); + } + public void setWidth(float width) throws DOMException { + throw new DOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); + } + public float getHeight() { + return (float)svgelt.getSVGContext().getBBox().getHeight(); + } + public void setHeight(float height) throws DOMException { + throw new DOMException + (DOMException.NO_MODIFICATION_ALLOWED_ERR, ""); + } + }; } /** 1.9 +2 -3 xml-batik/sources/org/apache/batik/script/InterpreterPool.java Index: InterpreterPool.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/script/InterpreterPool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- InterpreterPool.java 12 Feb 2002 15:14:37 -0000 1.8 +++ InterpreterPool.java 22 Mar 2002 10:59:26 -0000 1.9 @@ -27,7 +27,7 @@ * files).</p> * * @author <a href="mailto:[EMAIL PROTECTED]">Christophe Jolif</a> - * @version $Id: InterpreterPool.java,v 1.8 2002/02/12 15:14:37 tkormann Exp $ + * @version $Id: InterpreterPool.java,v 1.9 2002/03/22 10:59:26 hillion Exp $ */ public class InterpreterPool { @@ -101,8 +101,7 @@ try { interpreter = factory.createInterpreter(); if (document != null) { - interpreter.bindObject("document", - createDocumentProxy(document)); + interpreter.bindObject("document", document); } } catch (Throwable t) { // may append if the batik interpreters class is here but
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]