You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Ytai Ben-Tsvi <Yt...@cti2.com> on 2002/07/28 20:46:09 UTC

using getBBox()

Hi everybody.

Could someone please tell me in what stage of a SVG DOM lifetime, the
getBBox() function becomes available. When I call it just after I
generate the DOM, I get exceptions, should there be a stage where I tell
batik to calculate length or something?

Ytai  Ben-Tsvi
C T I Squared


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


using getBBox()

Posted by Thomas E Deweese <th...@kodak.com>.
>>>>> "YB" == Ytai Ben-Tsvi <Yt...@cti2.com> writes:

YB> Could someone please tell me in what stage of a SVG DOM lifetime,
YB> the getBBox() function becomes available. When I call it just
YB> after I generate the DOM, I get exceptions, should there be a
YB> stage where I tell batik to calculate length or something?

    I'm not the expert on this, but I think you need to have built the
associated rendering structures (GVT tree) to be able to ask these
sorts of questions.  This is done by the Bridge class in Batik, you
can look at what batik.apps.slideshow does to build the GVT tree for
rendering (you will need to tell it to be dynamic).

    Once you have done this it will keep the GVT tree in sync with the
DOM tree. So theoretically you could create the GVT tree from a DOM
that consists of just the root SVG element and then do your normal DOM
build.  Of course there is a performance hit for updating the GVT tree
everytime you do anything in the DOM tree.  So if your building a DOM
then asking questions about it I would suggest that you build the DOM
then construct the GVT then ask your questions, but if your questions
are interleaved with the building then you are probably better off
linking the GVT tree up front.

    I hope this helps...

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org