For modification, you must make updates to the document in the JSVGCanvas's UpdateManager's Runnable Queue:
jsvgCanvas.getUpdateManager().getRunnableQueue().invokeLater(new Runnable() {
public void run() { // modifications here } };);
This queue is available after the JSVGCanvas's GVT tree has rendered; you can
register for a render complete event on the JSVGCanvas.
Michael Bishop
From: Gérald Quintana
Sent: Wed 2/27/2008 8:22 AM
To: [email protected]
Subject: Load, modify and display
Dear Batik user,
I am trying to do something very simple:
1) Load an existing SVG
2) Display it in a Swing frame
3) Modify it
But, the SVG is displayed without being modified.
Here is what I did:
// Load SVG
parser = XMLResourceDescriptor.getXMLParserClassName();
svgDocumentFactory=new SAXSVGDocumentFactory(parser);
svgDocument = svgDocumentFactory.createSVGDocument(svgFile.toURI().toString());
// Display SVG
svgCanvas = new JSVGCanvas();
svgCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
svgCanvas.setSVGDocument(svgDocument);
// Alter SVG
path =(SVGGraphicsElement)
svgDocument.getElementById("path12545");
pathStyle=path.getStyle();
pathStyle.setProperty(CSSConstants.CSS_STROKE_PROPERTY,getColor(i),"important");
What should I do?
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature
