Arvinder Singh wrote:
I haven't used an svg Document in my code. I have an acutal svg file that I display on the JSVGCanvas. So how can I appendChild() to that?
Any sample code would really help.
Hi Arvinder,
You might want to read the docs for JSVGComponent (baseclass of JSVGCanvas):
http://xml.apache.org/batik/javadoc/org/apache/batik/swing/svg/JSVGComponent.html
It is important that you wait until the 'documentLoadingCompleted' event is generated before this the document will be null.
From here you need to learn/understand the standard W3C DOM. Using 'createElementNS', setAttribute/setAttributeNS and the like to create/configure and add elements to the Document.
You also need to take care to only modify the document in the UpdateManagers runnable Queue otherwise the changes will not be properly tracked.
You should be able to search this list for lots of info on the UpdateManager.
Good luck!
Thanks,
-Arvinder
On Mon, 5 Jan 2004, Jean-Christophe ARNU wrote:
Le Mon, 5 Jan 2004 02:56:12 -0500 (EST) Arvinder Singh <[EMAIL PROTECTED]> me disait que :
I'm new to Batik/SVG, and i'm trying to develop a java application using batik that will load a svg file, display it, and then display a dot (or any other simple graphic) on top of that svg at specified co- ordinates. Upto now i have been sucessful in gettign the SVG file to display, but i don't know how to add something on top of that. Any information would be appreciated.
Hi, You can appendChild (the child is your "dots or other SVG object" you want the document to be decorated) to root node of your DOM document.(That's the way I do it). Don't forget to set the document ALWAYS_DYNAMIC if you apply changes to it!
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
