Element rectElement = svgCanvas.getSVGDocument().getElementById("myRectElement");
SVGRect bbox = SVGLocatableSupport.getBBox(rectElement);
The first line returns the expected element, but I have no idea why the second line is aways returning null, no matter if I try several types of elements. Are there any especial ways or situations where the getBBox() will not work correctly?
Anyway, do you have one piece of code to illustrate your suggestion of combining getBBox() with getScreenCMT() to get the screen location of the element?
Thanks.
Charles
On 7/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi Charles,
You might also want to look at the standard SVG DOM.
Which includes a method 'getBBox()' that returns the bounding
box of the element in the element's user coordinate system.
If this is paired with 'getScreenCTM()' you can fairly easily calculate
the location on the screen of any element in the DOM (and these
are standard SVG as opposed to Batik specific).
"Charles Abreu" <[EMAIL PROTECTED] > wrote on 07/10/2006 05:13:27 PM:
> What I want to do is to zoom in and to center the SVGCanvas on to an
arbitrary
> graphics element. Looking at the svg browser code, I saw a code fragment
where
> the zooming and centering task is done for text search, but it works
begining
> from a selected GraphicsNode object. In that case, a GVTTreeWalker was
used to
> walk down the tree looking for TextNode's whose text property match the
user
> entered string. In my case, the use will not provide any input. An
internal
> event in my system will trigger a search for an specific element in the
DOM
> tree and I need to highlight it when it is found.
>
> Can somebody help?
>
> Thanks in advance.
>
> Charles
> On 7/10/06, Charles Abreu <[EMAIL PROTECTED] > wrote:
> Hi,
>
> How I obtain a GraphicsNode from an Element object?
>
> Thanks,
>
> Charles
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
