Hello,
I'm interested in cache mechanisms implemented in Batik. I would like to know
what solutions are available now, and how can I extend them.
The users of my application use about 100 diagrams which are based on about 10
SVG documents. The change between different screens based on the same document
is for example different label, or different data which is changing dynamically.
The user can open or close any document in the same or different tab at any time
(so I can have many JSVGCanvases sometimes based on the document from the same
URI). My problem is that any time he/she does it I read the whole document from
a file, then i parse it to a DOM tree, then I put it in a JSVGCanvas component
which generates and renders a GVT tree.
1. It would be nice to cache DOM tree somehow.
I figured out that the DocumentLoader uses some kind of uri cache, but as far as
I understand loadSVGDocument method in JSVGComponent, the new DocumentLoader is
used any time I use setURI method. Moreover the cache is not shared among many
JSVGCanvas instances.
This kind of cache could be really nice, but how could I use it when my document
is changing dynamically on SVGScreen. I have thought about puting document in
its begining state in cache, and then get it out of cache cloning the DOM tree.
But would it be faster then parsing document from a file?
2. Could you give me any hints how could I cache font definitions available in
svg files?
The font definitions are often the big part of my svg documents so I would like
to cache them (SVGGVTFont objects?), but I have no idea how to integrate such
kind of cache with batik.
Because, as far as I understand, the text rendering mechanism is the slowest
part of Batik it would be also great to create some kind of simplified text tag,
less powerful than original one but faster. Any hints how to do it?
3. Would it be possible to serialize DOM or GVT tree somehow, or maybe the whole
JSVGCanvas and put it on the disk?
4. Is there any progress in implementing SVG 1.2 static css hint?
I have problems in splitting my documents in two parts dynamic (transparent
JSVGCanvas) and static, because:
a) The both parts should use the same definitions of gradients, fonts or css
styles. So how to do it effectively (memory usage is important)?
b) To implement such layers I have to use two JSVGCanvas instances, so I cannot
use SVGScrollPane with them and I have two big image buffers.
Regards,
Lukasz Matuszczak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]