What type of changes are you doing in the GVT component? Why not do the changes to the objects in the DOM and catch the UpdateManager to be sure the modifications are ready before saving.
I have to assume that you are doing Java2D modifications, beacuse if not, then i do not see the reason to do your modifications in the GVT, you can do all modifications in the DOM, by changing the attributes of the Elements in your DOM.
If the modification was triggered by a element.EventListener (i.r OnClickAction), then you are already in the JSCGCanvas runnable queue, if not, then you need to invoke the runnable queue and do your attribute changes there.
To invoke the runnable queue, you need to do several things:
1. in JSVGCanvas.gvtRenderingCompeted(GVTTreeRenderEvent) {
UpdateManager updateM = JSVGCanvas.getUpdateManager();
}
2. to call the runnable queue:
updateM.getUpdateRunnableQueue().invokelater(new Runnable() {
public void run() {
//////////////////////////All the Element attribute changes here
//For example
SVGDocument doc = JSCGCanvas.getSVGDocument();
SVGOMSVGElement docElt = (SVGOMSVGElement) doc.getDocumentElement();
Element group = docElt.getElementById("some id tag");
Element theElement = (Element) group.getFirstChild();
//// The attribute changes here:
theElement.setAttribute("width","200");
}
} );
Hope this helps,
Andres.
On Jul 7, 2004, at 12:29 PM, Roger I Martin PhD wrote:
Hi,
I've learned to add, remove, modify the JSVGCanvas displayed svg DOM, save it back to a file with the changes. Also learned how to modify a gvt component on the canvas with user keyboard and mouse interaction (i.e. mouseDragged(org.apache.batik.gvt.event.GraphicsNodeMouseEvent evt);). What I don't have is how to "bridge" the results of the gvt modifications back to the DOM and subsequently save the results back to an svg doc. After the change is back in the DOM I could then save it. Anybody have a hint to how it can be done?
--Roger