hillion     02/02/07 00:01:06

  Modified:    samples/tests/spec/scripting xyModifOnClick.svg
               sources/org/apache/batik/bridge BridgeEventSupport.java
               sources/org/apache/batik/dom DocumentWrapper.java
  Log:
  - Fixed the bug which caused xyModifOnClick.svg to throw an exception.
  - xyModifOnClick.svg now use Ecmascript-style DOM calls.
  
  Revision  Changes    Path
  1.3       +3 -3      xml-batik/samples/tests/spec/scripting/xyModifOnClick.svg
  
  Index: xyModifOnClick.svg
  ===================================================================
  RCS file: /home/cvs/xml-batik/samples/tests/spec/scripting/xyModifOnClick.svg,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xyModifOnClick.svg        29 Jan 2002 16:19:00 -0000      1.2
  +++ xyModifOnClick.svg        7 Feb 2002 08:01:06 -0000       1.3
  @@ -14,7 +14,7 @@
   <!-- Modification of a rect's x attribute in an 'onclick' event handler.       -->
   <!--                                                                           -->
   <!-- @author [EMAIL PROTECTED]                                                 -->
  -<!-- @version $Id: xyModifOnClick.svg,v 1.2 2002/01/29 16:19:00 deweese Exp $  -->
  +<!-- @version $Id: xyModifOnClick.svg,v 1.3 2002/02/07 08:01:06 hillion Exp $  -->
   <!-- ========================================================================= -->
   <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>  
   <svg id="body" width="450" height="500" viewBox="0 0 450 500">
  @@ -25,8 +25,8 @@
       <script type="text/ecmascript">
   
       function moveToX(evt, target, val){
  -        var r = evt.getTarget();
  -        var doc = r.getOwnerDocument();
  +        var r = evt.target;
  +        var doc = r.ownerDocument;
           var t = doc.getElementById(target);
           t.setAttribute('x', val);
       }
  
  
  
  1.19      +5 -4      
xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java
  
  Index: BridgeEventSupport.java
  ===================================================================
  RCS file: 
/home/cvs/xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BridgeEventSupport.java   21 Dec 2001 14:40:31 -0000      1.18
  +++ BridgeEventSupport.java   7 Feb 2002 08:01:06 -0000       1.19
  @@ -56,7 +56,7 @@
    * on the GVT root to propagate GVT events to the DOM.
    * @author <a href="mailto:[EMAIL PROTECTED]>Christophe Jolif</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: BridgeEventSupport.java,v 1.18 2001/12/21 14:40:31 hillion Exp $
  + * @version $Id: BridgeEventSupport.java,v 1.19 2002/02/07 08:01:06 hillion Exp $
    */
   class BridgeEventSupport implements SVGConstants {
       private static final String[] EVENT_ATTRIBUTES_GRAPHICS = {
  @@ -540,9 +540,10 @@
                               // use the String version to enable caching mechanism
                               interpreter.evaluate(script);
                           } catch (InterpreterException e) {
  -                            if (ua != null)
  -                                ua.displayError(new Exception("scripting error: "+
  -                                                              e.getMessage()));
  +                            Exception ex = e.getException();
  +                            if (ua != null) {
  +                                ua.displayError((ex != null) ? ex : e);
  +                            }
                           }
                       }
                   });
  
  
  
  1.4       +2 -2      xml-batik/sources/org/apache/batik/dom/DocumentWrapper.java
  
  Index: DocumentWrapper.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/dom/DocumentWrapper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DocumentWrapper.java      21 Dec 2001 14:40:31 -0000      1.3
  +++ DocumentWrapper.java      7 Feb 2002 08:01:06 -0000       1.4
  @@ -37,7 +37,7 @@
    * of the underlying document are called in a single thread.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Stephane Hillion</a>
  - * @version $Id: DocumentWrapper.java,v 1.3 2001/12/21 14:40:31 hillion Exp $
  + * @version $Id: DocumentWrapper.java,v 1.4 2002/02/07 08:01:06 hillion Exp $
    */
   public class DocumentWrapper
       extends NodeWrapper
  @@ -444,7 +444,7 @@
           Element result = (Element)getNode(e);
           if (result == null) {
               result = new ElementWrapper(this, e);
  -            nodes.put(e, result);
  +            nodes.put(e, new WeakReference(result));
           }
           return result;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to