DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42075>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42075

           Summary: Re-parenting an element with a SET element causes
                    NullPointerExceptions
           Product: Batik
           Version: 1.7
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: GVT
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


In order to move an element to the "top", I use the following script, which
removes an element from its parent, and inserts it as the last child of the root
element (thereby ensuring it gets draw last).

function raise(e) {
  if
(document.documentElement.childNodes.item(document.documentElement.childNodes.length-1)
!= e) {
    e.parentNode.removeChild(e);
    document.documentElement.appendChild(e);
  }

However, if the element in question has a SET sub-element, something in the
event processing gets confused, and each subsequent event causes a
NullPointerException like this:

     [java]     at
org.apache.batik.anim.timing.TimedElement.eventOccurred(Unknown Source)
     [java]     at
org.apache.batik.anim.timing.EventbaseTimingSpecifier.handleEvent(Unknown 
Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.fireEventListeners(Unknown Source)
     [java]     at
org.apache.batik.dom.events.EventSupport.dispatchEvent(Unknown Source)
     [java]     at org.apache.batik.dom.AbstractNode.dispatchEvent(Unknown 
Source)
     [java]     at
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Unknown
Source)
     [java]     at
org.apache.batik.bridge.BridgeEventSupport$Listener.mouseEntered(Unknown Source)
     [java]     at
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.processMouseEvent(Unknown
Source)
     [java]     at
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchMouseEvent(Unknown
Source)
     [java]     at
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.dispatchEvent(Unknown 
Source)
     [java]     at
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(Unknown Source)
     [java]     at
org.apache.batik.gvt.event.AbstractAWTEventDispatcher.mouseMoved(Unknown Source)
     [java]     at
org.apache.batik.swing.svg.AbstractJSVGComponent$SVGListener$1MouseMovedRunnable.run(Unknown
Source)
     [java]     at org.apache.batik.util.RunnableQueue.run(Unknown Source)
     [java]     at java.lang.Thread.run(Thread.java:595)


The following SVG demonstrates the effect: click the rectangle to trigger the
raise function, and then observe the exceptions:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg";
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:sbthd="http://www.selvaag.no/2007/sbthd"; viewBox="-0.50 -1.00 11.00 22.00"
font-family="Verdana" font-size="50.0">

<title>
House Designer SVG Output
</title>
<defs>
<script type="text/ecmascript">
<![CDATA[function raise(e) {
  if
(document.documentElement.childNodes.item(document.documentElement.childNodes.length-1)
!= e) {
    e.parentNode.removeChild(e);
    document.documentElement.appendChild(e);
  }
}]]>
</script>
</defs>

<rect x="0.0" y="0.0" width="10.0" height="20.0" fill="blue" opacity="0.9"
stroke="black" stroke-width="1.0" onclick="raise(evt.target)">
  <set attributeName="stroke-width" to="5.0" begin="mouseover" end="mouseout" />
</rect>
</svg>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to