xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Brandst├Ądter <r.brandstaed...@gmx.at>
Subject resizing SVGCanvas (and contained document)
Date Thu, 07 Aug 2003 10:43:17 GMT

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.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)


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

View raw message