Most of this can be done in straight DOM without much use of Batik. I've spent the last couple of years working on an SVG whiteboard application which started as what you describe. Collect data from user's input. For instance, if you're going to drag a rectangle with the mouse, capture the starting mouse press coordinates and the mouse release coordinates (AWT). Transform these points through the inverse of the viewing transform of the JSVGCanvas (AWT/Batik). Create a new element in the SVG namespace and set the appropriate attributes (x, y, width, height) using DOM. Append the element to the <g> group (DOM) in a thread run in the JSVGCanvas's update manager (Batik).
________________________________ From: [email protected] on behalf of Mathieu Pedrero Sent: Mon 7/6/2009 7:46 AM To: [email protected] Subject: Adding basic shapes to an existing document. Hello! I've got a svg document displayed on a JSVGCanvas. I would like to add some basic shapes (as circles, rectangles) by an action of the user, on this document, into a g group called "Layer1", for example. I know i have to modify the document, but i'm a little bit lost with the different types of trees and elements which are used in the batik project, and related in the javadoc API (node, element, SVGElement, SVGOMElement and so on...). Can you make me a quick summary of the different types of trees used in the Batik project, tell me which one i have to study in my case? Thank you for your help! -- Mathieu
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
