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 Sebastian Janisch <se...@me.com> on 2012/06/15 12:17:40 UTC

Transforming a SVGGraphicsElement

Hey there, 

I am trying to figure out how to transform an existing SVGGraphicsElement.

what I have is the following:

String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
		
StringReader reader = new StringReader(circle);
String circle = "<svg> ... a circle ... </svg>";
		
try {
	SVGDocument doc = factory.createSVGDocument("http://dialoguemaps.org", reader);
	SVGGraphicsElement element = (SVGGraphicsElement) doc.getFirstChild().getFirstChild();
			
} catch (IOException e) {
	e.printStackTrace();
}


This works fine. What I want to do now with the SVGGraphicsElement is to do a transformation like this:

SVGTransform transform = new SVGOMTransform();
transformTranslate(20, 20);

What I cannot figure out though is how to apply this transformation to the existing SVGGraphicsElement.


Hope somebody can help. I'd really appreciate it.


Best regards

Sebastian