Hi,

I agree that this question should be best asked at the Batik 
mailinglist.

If it takes 20 secs to update 100 text elements then there is 
something seriously wrong in your application. Either you are running 
at the memory limit (per default Java apps only get 64MB of memory) 
or there is something else in your code that is slowing down the 
application.

In my experience updating 100 text elements usually happens in <1 
second if you do it correctly.

If you update the same text elements again and again I would also 
consider to cache references to those elements and not use 
getElementById().getFirstChild() again and again.

But please post your example on the Batik mailinglist. I am sure they 
are able to help.

Andreas

--- In [email protected], "Minimoi" <[EMAIL PROTECTED]> 
wrote:
>
> Hello,
> 
> I am working on a Batik based java application and I've got to deal 
with
> a matter of performance.
> 
> My problem is that I need to update the text content of some node 
of my
> svg document.
> 
> In order to do this, i got a bunch of SVGOMTextElement with ids and 
I
> just use a loop in my java code to change the content of the 
element.
> 
> Java Code :
> // I take the text node in a list
> SVGOMTextElement elt2 = ((SVGOMTextElement) elt);
> //I'll update the first child
> SVGOMTSpanElement span = (SVGOMTSpanElement)elt2.getFirstChild();
> //Setting the new value
> elt2.setTextContent("test");
> 
> Sample from SVG file
> <g id="TM20" transform="translate(381.35498051840341
> ,438.75609706960131) rotate(0)">
> <path fill="rgb(160,0,0)" stroke-width="0.2" d="M-5.5,-3 L5.5,-3 
L5.5,3
> z" stroke="rgb(160,0,0)"/>
> <text style="text-anchor: middle; font-size: 3.3" id="TMTEXT20"
> transform="translate(0,11) scale(1,-1)">
> <tspan>5.2</tspan>
> <tspan dx="2">O</tspan>
> </text>
> 
> This loop is about 100 itérations and take around 20 seconds to
> complete. Then modification are displayed on my Canvas.
> 
> My question is quite simple : Is there a thing i did wrong and a 
way to
> get the same result faster ?
> 
> Thank you in advance for your help
> 
> 
> 
> [Non-text portions of this message have been removed]
>



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

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to