You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Thierry Kormann <tk...@ilog.fr> on 2002/01/03 13:13:14 UTC

Re: out of memory problem

On Wednesday 26 December 2001 23:39, Jenny Liu wrote:

> Thank you so much for your help! I appreciate it.
>
> I know my problem is our svg document is too big, but that's the business
> requirement, so I have to solve it. I thought about your suggestion to use
> Scrollable interface, but I am not sure what exactly you mean.
>
> In actuality, components that implement the Scrollable interface, like
> JList or JTable, have special scrolling needs. JScrollPane will still be
> needed to create the scroll bar, i.e., the view associated with a viewport
> may still contain a large image/a lot of data.

correct.

> One way I can think of not to scroll on a large view is to use JScrollBar,
> i.e., to inverse the Swing scrolling model by manually scrolling
> (repainting) a fixed-size view. So I set the svgCanvas size to be the
> viewport size, then when I slide the scrollbar, I do translation on the svg
> document, and rerender the svg document. However, the performance of this
> approach would be very bad because the user will have to wait another
> document rendering time even he just slides the scroll bar for a unit. So
> that's not pratical.

well, this is the solution I recommend. I agree that the performance will not 
be the same. Translating the document will generate a new rendering of the 
document and that will take some times but batik provides some really smart 
caches and the performance should not be so bad. Futher more, it's the only 
way to display huge documents using scrollbar.

To see what the performance will be, you can pan in our browser. The 
performance will be the same as the browser uses the svg canvas.

> The batik svg browser (batik-1.1.1) doesn't have the memory problem because
> you guys set the max size of svgCanvas to be the screen size, but then
> there is no way for the users to view the whole image if the image is
> larger than the screen.

do you think that is a problem?

> Could you explain to me more about your idea to use Scrollable interface?
> or is there anything else that rings the bell in your mind?

You can have a look at:

http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html

but it seems that you already know that :)

Basically, the idea is to fix the size for the svgcanvas to the size of the 
viewport and change the rendering transform each time the scrollbars are 
activated (translating to the left, right, top or bottom).

You can also modify the scrollbar increments to do a 10 or whatever pixel 
scrolling instead of a 1px scroll.

Hope that helps.

BTW: we are interested in implementation feedback and samples code if you 
manage to implement such a behavior for the svgcanvas :)

Regards,
Thierry.


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