Hi Ivan, Cameron,
Jasleen, I have tried your patch and browsed a little through the ErrorConsole. I noticed that, the ErrorConsole needs the JSVGCanvas passed in order to get its parent frame. I guess keeping it there just in case we want to edit the element isn't the best way to do it. Maybe to get that info through an interface?
The JSVGCanvas is passed as an ordinary Component so that that the error console can use the component's parent frame as it own parent (since the error console is a dialog) (and so that it could position itself relative to it), and not for anything else. Its similar in other places where the error console is invoked, like in JSVGViewerFrame.UserAgent.
Then the element that caused the error should be found and passed to DOMViewer along with the DocumentUpdater, to allow editing of that element.
There is a small point here that may cause problems. It is to do with the <use> element in SVG. When Batik constructs the GVT tree from an SVGDocument, it creates copies of elements that are referenced from a <use> element. So, if the DOMViewer uses object equality to locate the element, then the comparison would fail for elements whose copy is being used. But this problem is there only when <use> elements are present. So it could be ignored for now.
I also think that creating the DOMViewer to edit the element should be implemented somehow as in squiggle, since we don't want to create new DOMViewer instance each time we edit the element from the ErrorConsole (or we do?) Any thoughts?
I agree. One way this could be done is to pass the action object used by the application (in JSVGViewerFrame) to the error console which would add it as the action listener for the view DOM button. But then you can't get a reference to the DOMViewer object to set the element to edit. I don't think we should pass the DOMViewer instance to the ErrorConsole as that would not be possible if the JSVGViewerFrame no longer contains the user agent as an inner class. I don't know if there is some obvious and clean way to do this. Will let you know if I can come up with something. Jasleen --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
