Hi guys. Ivan Andjelkovic: > >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?
Jasleen Singh: > 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. Yeah, I think that’s fine. > >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. Yeah, I believe you are working on a workaround for this. In the future, <use> element shadow trees will be done properly, and this shouldn’t be a problem. > >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. There is indeed already an interface for controlling the Squiggle application: org.apache.batik.apps.svgbrowser.Application. You could extend this to provide a method to open the DOM Viewer on a certain element for a given JSVGViewerFrame. Or, you might like to have a separate interface (DOMViewerController or whatever), that the JSVGViewerFrame could implement. -- Cameron McCormack, http://mcc.id.au/ xmpp:[EMAIL PROTECTED] ▪ ICQ 26955922 ▪ MSN [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
