xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: dynamic change of display rendering
Date Fri, 04 Feb 2005 11:34:37 GMT
Hi Rémy

Rémy Brousset wrote:

> you'right tonny there are no graphics node associated with the defs 
> elements (that's why i had a null return). i will thus try the leo 
> solution with a dynamic insert of <use>. but, got i to reload the gvt 
> tree, or to reconstruct it? if yes, how? what's your "favorite" method?

    I would suggest going with Andres suggestion of putting all the
content in separate svg elements under the main document SVG:

  <svg width=".." height="..." xmlns:svg="...">
       <svg id="symbol-1">
          <...>
       </svg>
       <svg id="symbol-2">
          <...>
       </svg>
</svg>

     You can then build the GVT tree for the whole document,
then use, to get the individual graphics nodes:

     Element e = document.getElementById("symbol-1");
     GraphicsNode sym1 = ctx.getGraphicsNode(e);

> i can also try what andres suggest. in that case, i'll have to change 
> the visibility attribute to hidden/visible i guess.In that case too, 
> will the gvt nodes apply the changes?

    They will if the BridgeContext is setup to be dynamic.
However it will be more or less up to you to handle the repaints
that will be needed when you modify the DOM (which BTW isn't
much different from what you will have to do when you 'swap'
GVT tree's).

> Is anyone at-his-ease with the DOM/GVT junggle? 

     Yes ;)

> in particular i'm in pain with the bridge context manipulation.
> is the method bind(GraphicsNode, Element) util or necessary to retrieve 
> later my elements?

     Well, the problem is that you are going in at a lower level
than most people.  For most people they don't even know or care
if the GVT Tree exists or not.  The just use the JSVGCanvas for
display, and do the graphical manipulations on the W3C specified
DOM.  Is there a really good reason why you can't use the existing
JSVGCanvas for display?  It does lots of nice things for you.



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


Mime
View raw message