maria teresa wrote:

Hello everybody,
I am trying to develop a Java application where
many different layers need to be added dynamically
upon an svg file.
I am thinking to achieve this by dynamically adding
<g> elements upon the SVGDocument, once I have extracted it
from my JSVGCanvas.
 From Batik Javadoc I see that there is an SVGOMGElement class
that maybe could be useful, but I don't have the least idea about
how to use it efficiently.
Could anybody help me?
Any suggestion would be really appreciated!

With DOM you create new elements by using the Document object as a factory. So to get a new SVG 'g' element you would call:

   Document svgDoc = canvas.getSVGDocument();
   Element g = svgDoc.createElementNS(SVGConstants.SVG_NAMESPACE_URI, "g");




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to