xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: [Newbie] JSVGScrollPane problem
Date Mon, 28 Nov 2005 18:20:53 GMT
Hi Laurent,

   The 'no scrollbar' problem is now  fixed in SVN.

Laurent Caron <laurent.caron@gmail.com> wrote on 11/28/2005 05:43:17 AM:

> Hi Thomas,
> 
> Thank you for your help. I delayed the call to setURI, and I noticed 
I've made
> a big mistake : I've switch the called "f.setVisible(true)" and "f.
> setSize()"... Bad, bad bad
> 
> Now my code is the following :
> 
> import java.awt.*;
> import java.io.File;
> 
> import org.apache.batik.swing.*;
> 
> public class AWTSVG {
> 
>     public static void main(String[] args) {
>         final Frame f = new Frame("Batik");
> 
>         final MyCanvas canvas = new MyCanvas();
>         canvas.setDocumentState(JSVGCanvas.ALWAYS_STATIC);
> 
>         final JSVGScrollPane scrollPane = new JSVGScrollPane(canvas);
>         scrollPane.setBackground(new Color(22, 22, 22));
>         f.add(scrollPane);
> 
>         f.addWindowListener(new WindowAdapter() {
>             public void windowClosing(WindowEvent e) {
>                 System.exit(0);
>             }
>         });
> 
>         f.setSize(800, 600);
>         f.setVisible(true);
>     canvas.setURI(new 
File("C://eclipse//workspace//test.svg").toURI().toString()); 
> 
>     }
> 
> }
> 
> 
> public class MyCanvas extends JSVGCanvas {
> 
>     protected AffineTransform calculateViewingTransform(String 
fragIdent, 
> SVGSVGElement svgElt) {
>         return new AffineTransform();
>     }
> 
> }
> 
> Unfortunately, it still does not work. I can see my image when the frame 
is 
> opened, but I need to resize my frame two times if I want to see the 
scrollbars
> Please help, I'm desperate :(

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message