Thanks, I find the problem

here is the old code (within the constructor of my JFrame) which causes my problem:

  ....
  getContentPane().add(toolBarPanel, BorderLayout.NORTH);
  getContentPane().add(editorScrollPane,BorderLayout.CENTER);
  getContentPane().add(statusBar,BorderLayout.SOUTH);
  editorScrollPane.getViewport().setLayout(new BorderLayout());
  editorScrollPane.getViewport().add(canvas, BorderLayout.CENTER);
  ....

my problem was my common methode to use a LayoutManager even for the viewport from 
scrollpane
(default for viewport's is FlowLayout).

her is the new code which works fine:

  ....
  editorScrollPane.getViewport().add(canvas);
  getContentPane().add(toolBarPanel, BorderLayout.NORTH);
  getContentPane().add(editorScrollPane,BorderLayout.CENTER);
  getContentPane().add(statusBar,BorderLayout.SOUTH);
  ....

Jan

-----Ursprüngliche Nachricht-----
Von: Thomas E Deweese [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 19. Februar 2003 12:26
An: Batik Users
Betreff: RE: [JSVGCanvas] repaint-mechanics


>>>>> "JL" == Lolling, Jan <[EMAIL PROTECTED]> writes:

JL> How can I avoid invokating the auto-layout-methode from canvas.
JL> As a result from zoom i need scrollbars and not only a new view to
JL> the image.

JL> My first attempt:

JL> 1. add the JSVGCanvas into a viewport from scrollpane 

IL> 2. overwrite JSVGCanvas to implement Scollable-interface with
JL> getScrollableTracksViewportWidth() returns false (same for height)
JL> and getPreferredScrollableViewportSize() returns
JL> canvas.getPreferredSize();

JL> It doesn´t work.  The canvas do not paint the area outside the
JL> initial painting area even if you scroll down/up.

    The JSVGCanvas actually renders to a BufferedImage the size of
the component (in your case getPreferredSize()).  You will need to
implement/handle some of the scroll notifications (or you can trigger
a repaint with the new scroll parameters on paint with a translation - 
so some background will show for a little bit before the new rendering 
fills the area).

    Doing this well given the potentially expensive cost of rendering
the SVG content is tricky...

JL> With kind regards Mit freundlichen Grüssen

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