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 Denis Bohm <de...@fireflydesign.com> on 2000/12/15 21:10:50 UTC

How to find a graphic node built from a particular element?

Hi,

I would like to use an elements class property to find a GraphicNode.  For
example, if my svg xml is:

    <svg width="10" height="10" viewBox="-5 -5 10 10">
      <circle class="outline" style="fill-opacity:0; stroke:#000000" cx="0"
cy="0" r="5" />
      <path class="color" style="fill:#ff0000; fill-rule:nonzero"
d="m0.0,-5.0 2.935,9.045 -7.695,-5.59 9.51,0.0 -7.69,5.59 z" />
      <text class="text" style="text-anchor:middle; font-family:Verdana;
font-size:1pt" x="0" y="0">host</text>
    </svg>

I would like to be able to walk over the GraphicNode hierarchy that was
created by the bridge and find the element class of each graphic node
("outline", "color", "text" in the example above).  I've looked over the
code, but don't see how the correspondence between the Element and
GraphicNode is represented.  Can someone point me in the right direction?

Thanks,
  Denis



Re: How to find a graphic node built from a particular element?

Posted by Denis Bohm <de...@fireflydesign.com>.
Hi,

I think I found what I was looking for:
BridgeContext.getGraphicsNode(Element)

Denis

----- Original Message -----
From: "Denis Bohm" <de...@fireflydesign.com>
To: <ba...@xml.apache.org>
Sent: Friday, December 15, 2000 12:10 PM
Subject: How to find a graphic node built from a particular element?


> Hi,
>
> I would like to use an elements class property to find a GraphicNode.  For
> example, if my svg xml is:
>
>     <svg width="10" height="10" viewBox="-5 -5 10 10">
>       <circle class="outline" style="fill-opacity:0; stroke:#000000"
cx="0"
> cy="0" r="5" />
>       <path class="color" style="fill:#ff0000; fill-rule:nonzero"
> d="m0.0,-5.0 2.935,9.045 -7.695,-5.59 9.51,0.0 -7.69,5.59 z" />
>       <text class="text" style="text-anchor:middle; font-family:Verdana;
> font-size:1pt" x="0" y="0">host</text>
>     </svg>
>
> I would like to be able to walk over the GraphicNode hierarchy that was
> created by the bridge and find the element class of each graphic node
> ("outline", "color", "text" in the example above).  I've looked over the
> code, but don't see how the correspondence between the Element and
> GraphicNode is represented.  Can someone point me in the right direction?
>
> Thanks,
>   Denis
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>