You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Reinhard Brandstädter <r....@gmx.at> on 2003/08/07 12:43:17 UTC

resizing SVGCanvas (and contained document)

Hi!

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   r.brandstaedter@gmx.at  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: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org