I am not sure what your exact problems were, but we have had pretty good
luck with the JSVGScrollCanvas.  To zoom we simply do

AffineTransform transform =
(AffineTransform)canvas.getRenderingTransform().clone();
double newScale = <<whatever>>
transform.scale(newScale, newScale);            
scrollCanvas.setRenderingTransform(transform);

The JSVGScrollCanvas we used was by Jan Lolling, which can be found in
the Batik mail archives.

Mark




> -----Original Message-----
> From: Thomas DeWeese [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, August 14, 2003 12:34 PM
> To: Batik Users
> Subject: Re: JSVGCanvas in a JScrollPane again....
> 
> 
> Michael Mikic wrote:
> > Hello!
> > 
> > I want to put the JSVGCanvas into a JScrollPane. I'm using 
> batik-1.5b5
> > (should be a CVS Version from 2 days ago). I'm using the class 
> > JSVGViewerFrame and modified it a little because I do not need all 
> > functions apart from zooming, panning and printing. I've 
> done a subclass 
> > extending the JSVGCanvas and implemented the Scrollable 
> Interface. All 
> > works fine as long I just do nothing else than scrolling 
> with the thumbs 
> > of the JScrollPane.
> > 
> > My problem now is to update the thumbs of the JScrollPane whenever I
> > zoom into/out of the canvas or whenever I pan the canvas.
> 
>      I would guess that if you override setMySize to call 
> setPreferredSize(...), invalidate(), and then 
> window.validate() [or perhaps pack()] would update the thumbs 
> (one would hope).
> 
>      For scrolling/panning I think you need to make sure you 
> don't use Batik's pan (which updates the rendering transform) 
> but use the JSVGScrollPane to change the canvas's location 
> under the JViewport.
> 
> > I've noticed some approachs here but I cannot get it work for my 
> > panel.
> > Does anyone have a solution? Maybe a code sample?
> 
>     Sorry no prepped solution, or code.
> 
> > 
> > Thanks in advance,
> > 
> > Michael
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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]
> 


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

Reply via email to