Hi till,
till varoquaux wrote:
I forgot to mention that I won't be changing those images (only
displaying them) which makes the problem simpler.
Yes.
I still have a couple of questions though:
_I can't see the Document (|org.w3c.dom.Document) in Batik's javadoc. Am
I totally wrong again?
Well, we don't have the source for dom.Document in Batik, but
there should be org.w3c.dom.svg.SVGDocument.
_How do you create a GVT tree form a document exactly? Should I create a
JSVGCanvas extract the the GVT tree via |JGVTComponent.|*getGraphicsNode
<http://xml.apache.org/batik/javadoc/org/apache/batik/swing/gvt/JGVTComponent.html#getGraphicsNode%28%29>
Yes.
and then inject it in all of my other JSVGCanvas via setGraphicNode.
Replace JSVGCanvas with JGVTComponent and the answer is yes.
If I am not mistaken this seems a little unclean... But I don't see any
other ways....
Yes, it is a little unclean, but we do support it as this is
how the thumbnail view currently works in Squiggle
(batik.apps.svgbrowser.ThumbnailDialog).
_If I do so, will I still be able to redimension my JCanvases without
any problems or loss (not changing the image just changing the size it
is displayed...)?
Sure for an example play with the thumbnail window in squiggle.
*||Thanks
Till
|
Thomas DeWeese wrote:
till varoquaux wrote:
I'm currently working (for university) on a project where I would
have to display a lot of "views" of the same SVG image.
Batik is create however te only way I have found to display svg
images is to pass there URL to a JSVGCanvas. This means I have to
reload,reparse.. the file if I want another "view" (i.e.: a
JSVGCanvas). Is there an any way to avoid that (remenber I'm a
beginner).
You can build an SVGDocument using the
batik.dom.svg.SAXSVGDocumentFactory class, and provide the document
with the 'setSVGDocument' call. However multiple JSVGCanvas's can
not share the same document (there are issues with the SVGDOM
because it allows script to access the screen transform which is
generally different for each canvas).
In some cases you can get away using the GVT tree from a document
with the JGVTComponent. These would be strictly static views of
the document (if the document changes they would not update
automatically).
Also is there a way to preload(and preparse..) the images I would
want to use?
Well you can load the SVG into the DOM (as I note above). In
theory you could also prebuild the GVT tree but I don't think you
can easily insinuate these into the Canvas.
Sorry if my questions are really dumb... I must admit I'm rather lost.
It's a big toolkit.
---------------------------------------------------------------------
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]