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 sh...@agilent.com on 2003/04/01 00:11:03 UTC

JSVGCanvas.setURI() vs. JSVGCanvas.setSVGDocument()?

Hi All,
	Is there any particular difference between JSVGCanvas.setURI() vs. JSVGCanvas.setSVGDocument() in terms of dynamic DOM updates?  
	Some background....   In my application, the user can choose between 2 SVG displays.  Upon startup, I use setURI() to load in the SVG files.  Once I've loaded in the SVG files by using setURI(), I cache the SVG Documents that are generated.  So the next time the user wants a particular SVG display, I just use setSVGDocument() with the parameter being one of my cached SVGDocument objects.  I do this to avoid redoing time consuming tasks, such as reading in the SVG from file.
	My problem is the following...   When I use setURI(), dynamic DOM updates are correctly being reflected in the JSVGCanvas.  However, when I use setSVGDocument(), dynamic DOM updates are not being reflected in the JSVGCanvas.  In particular, changing the "fill" attribute of text nodes is not updating correctly for me when I use setSVGDocument().  Any insights?  Thanks!

-Shawn

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


Re: JSVGCanvas.setURI() vs. JSVGCanvas.setSVGDocument()?

Posted by Vincent Hardy <vi...@sun.com>.
Hello Shawn,

Did you try:

JSVGComponent.setDocumentState(JSVGComponent.ALWAYS_DYNAMIC);

That should ensure dynamic updtes are always done and that will avoid 
that your DOM is scanned everytime you do a setSVGDocument to detect 
whether it is dynamic or not (see what AUTODETECT does).

Vincent.

shawn_hwang@agilent.com wrote:
> Hi All,
> 	Is there any particular difference between JSVGCanvas.setURI() vs. JSVGCanvas.setSVGDocument() in terms of dynamic DOM updates?  
> 	Some background....   In my application, the user can choose between 2 SVG displays.  Upon startup, I use setURI() to load in the SVG files.  Once I've loaded in the SVG files by using setURI(), I cache the SVG Documents that are generated.  So the next time the user wants a particular SVG display, I just use setSVGDocument() with the parameter being one of my cached SVGDocument objects.  I do this to avoid redoing time consuming tasks, such as reading in the SVG from file.
> 	My problem is the following...   When I use setURI(), dynamic DOM updates are correctly being reflected in the JSVGCanvas.  However, when I use setSVGDocument(), dynamic DOM updates are not being reflected in the JSVGCanvas.  In particular, changing the "fill" attribute of text nodes is not updating correctly for me when I use setSVGDocument().  Any insights?  Thanks!
> 
> -Shawn
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 



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