Hi Michael.
Bishop, Michael W. CTR USJFCOM JFL:
> I have a lightweight API that creates a Document that contains SVG. It
> uses Java's core DOM model. I'm going to start working on a UI that
> displays this information. The API doesn't rely on Batik and I don't
> want it to have to in order to keep it small. It basically just puts
> supplied information into a template to produce its output. The UI,
> of course, will use Batik to display the content. Is there a way to
> easily go from the Document produced by the API to an SVGDocument that
> can be used with Batik UI components?
You’ll need to clone the whole document as Batik’s DOM objects for it
to work in the JSVGCanvas. The JSVGComponent.setDocument() method will
do that if you pass in a Document object that isn’t an SVGOMDocument,
but you can do it yourself with the same code that’s in that method:
Document myNonBatikDOMDocument = …;
Document myBatikDOMDocument = DOMUtilities.deepCloneDocument
(myNonBatikDOMDocument, SVGDOMImplementation.getDOMImplementation());
--
Cameron McCormack ≝ http://mcc.id.au/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]