I'm wondering how to dynamically resize a SVGCanvas so that I can scroll a dynamically growing svg document.
I create the Canvas as follows and add it to a JScrollPanel:
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI; Document doc = impl.createDocument(svgNS, "svg", null);
Element svgRoot = doc.getDocumentElement(); svgRoot.setAttributeNS(null, "overflow", "visible"); jSVGCanvas.setDocumentState(JSVGComponent.ALWAYS_DYNAMIC); jSVGCanvas.setSVGDocument( (SVGDocument) doc); JSVGCanvas jSVGCanvas = new JSVGCanvas(); ... jScrollPane1.getViewport().add(jSVGCanvas, null);
The scrollpanel has a initial size and during the application i draw into the SVGCanvas wich grows as a consequence. But how can I resize the Canvas to reflect the whole document in the scrollpanel? At some point the grapic still gets cut off (even though I specified the overflow to be visible)
Cheers, Reinhard
-- Reinhard Brandstaedter [EMAIL PROTECTED] GPG: 0x033B81DB - Student of Computer Science - J.K. University of Linz - - <ICQ: 73059068> <Mobile: +43 699 12419541> - - http://adelaide.dnsalias.net -
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]