Hi,

You should use definitely the JSVGScrollPane provided by Batik instead of a ordinary Swing ScrollPane, in order to acurately display in the scroll bars the extent of your document, specially since Batik does allow you to zoom in or out, you need to translate that zoom level (affineTransform) into the equivalent document size. JSVGScrollCanvas does that for you. So you can do a "fit in frame" scale and the JSVGScrollCanvas reflects that.

Hope this helps,

Andres.


On May 25, 2015, at 11:49 PM, Tonny Kohar wrote:

Hi,

On Tue, 2004-05-25 at 22:37, [EMAIL PROTECTED] wrote:
where my frame is 800 by 600,
my svg file is 1024 by 800 and has a viewbox of 2000 by 1000 pretend,
even though i place the svg doc from that file into a JScrollpane, it resizes the frame to be 1024 by 800 instead of the 800 by 600 which it should be.
SVGCanvas.setSize() doesnt seem to do anything as well. Batiks behavior eludes me here as well and i dont think its the Layout i use, as i have tried placing it in different Layouts to stop this behavior.

I haven't tried yet, but batik included its own JSVGScrollPane (org.apache.batik.swing.JSVGScrollPane) for its canvas, maybe you can use that instead of using JScrollPane by Swing.

There are methods in  JSVGCanvas
- JSVGCanvas.getDocumentSize()
- JSVGCanvas.setRecenterOnResize(boolean)
- JSVGCanvas.getViewBoxTransform()
- JSVGCanvas.setMySize(Dimension)

which you may utilize to properly layout the component,
check the source / doc for the definition of each method.

Regards
Tonny Kohar
--
Sketsa
SVG Graphics Editor
http://www.kiyut.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to