I changed my sources so that if the old property value is null then it
considers it as a change (rather than throwing a null pointer exception).
Now changing the attribute seems to work.  However, it seems very very very
slow to refresh when changing class attributes that result in simple style
changes.  In my case, the class change only results in changing the fill
color - which shouldn't effect the bounds of the elements.  Changing the
class for about 25 tspan elements (making up one short line of text) takes
about 1.5 seconds.  I ran OptimizeIt on the code and it appears that each
time the class property is changed on one tspan element the glyphs go
through relayout down in the gvt layer.  This results in the creation of
around 27,000 points during the process.

Any tips for speeding up changing the color of text runs?  For example, is
there some way to batch changes to the DOM?

Thanks,
  Denis

----- Original Message ----- 
From: "Denis Bohm" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
Sent: Thursday, August 21, 2003 8:26 AM
Subject: Re: tspan.setAttributeNS(null, "class", "normal") null pointer
exception


> I've attached a standalone version that shows the problem.
>
> ----- Original Message ----- 
> From: "Thomas DeWeese" <[EMAIL PROTECTED]>
> To: "Batik Users" <[EMAIL PROTECTED]>
> Sent: Thursday, August 21, 2003 5:19 AM
> Subject: Re: tspan.setAttributeNS(null, "class", "normal") null pointer
> exception
>
>
> > Denis Bohm wrote:
> > > Setting color to the Shadow?When I try to append a tspan to a text
> element
> > > and then set the tspan class:
> > >
> > >         Element tspan = document.createElementNS(
> > >             SVGDOMImplementation.SVG_NAMESPACE_URI, "tspan"
> > >         );
> > >         tspan.appendChild(document.createCDATASection(text));
> > >         text.appendChild(tspan);
> > >         tspan.setAttributeNS(null, "class", "normal");
> > >
> > > I get a null pointer exception:
> >
> >      Can you provide a standalone version of this problem?
> > Looking at the line indicated below it isn't real clear why you
> > would get an NPE.
> >
> > > In Event
> > > java.lang.NullPointerException
> > >         at
> > >
>
org.apache.batik.css.engine.CSSEngine.invalidateProperties(CSSEngine.java:18
> > > 91)
> > >         at
> > >
>
org.apache.batik.css.engine.CSSEngine$DOMAttrModifiedListener.handleEvent(CS
> > > SEngine.java:2280)
> > >         at
> > >
>
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.jav
> > > a:268)
> > >         at
> > >
>
org.apache.batik.dom.events.EventSupport.dispatchEvent(EventSupport.java:240
> > > )
> > >         at
> > > org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:455)
> > >         at
> > >
>
org.apache.batik.dom.AbstractElement.fireDOMAttrModifiedEvent(AbstractElemen
> > > t.java:544)
> > >         at
> > >
>
org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItem(AbstractE
> > > lement.java:725)
> > >         at
> > >
>
org.apache.batik.dom.AbstractElement$NamedNodeHashMap.setNamedItemNS(Abstrac
> > > tElement.java:672)
> > >         at
> > >
>
org.apache.batik.dom.AbstractElement.setAttributeNS(AbstractElement.java:271
> > > )
> > >         at
com.hp.hpl.epc.evaluator.DemoUI.appendTSpan(DemoUI.java:209)
> > >         at com.hp.hpl.epc.evaluator.DemoUI.mouseMove(DemoUI.java:409)
> > >         at
> com.hp.hpl.epc.evaluator.DemoUI$2.handleEvent(DemoUI.java:276)
> > >         at
> > >
>
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.jav
> > > a:268)
> > >         at
> > >
>
org.apache.batik.dom.events.EventSupport.dispatchEvent(EventSupport.java:240
> > > )
> > >         at
> > > org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:455)
> > >         at
> > >
>
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(Bridg
> > > eEventSupport.java:372)
> > >         at
> > >
>
org.apache.batik.bridge.BridgeEventSupport$Listener.mouseMoved(BridgeEventSu
> > > pport.java:286)
> > >         at
> > >
>
org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(AWTEventDisp
> > > atcher.java:538)
> > >         at
> > >
>
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(AWTEventDis
> > > patcher.java:502)
> > >         at
> > >
>
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(AWTEventDispatch
> > > er.java:391)
> > >         at
> > >
>
org.apache.batik.gvt.event.AWTEventDispatcher.mouseMoved(AWTEventDispatcher.
> > > java:244)
> > >         at
> > >
>
org.apache.batik.swing.svg.JSVGComponent$1MouseMovedRunnable.run(JSVGCompone
> > > nt.java:1989)
> > >         at
> org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:204)
> > >         at java.lang.Thread.run(Thread.java:534)
> > >
> > >
> > > Am I doing something wrong?
> > >
> > > Thanks,
> > >   Denis
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


----------------------------------------------------------------------------
----


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


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

Reply via email to