I'm currently working on my thesis and looking for a way to render many different arbitrary grapical Objects to a screen.
I'm not too deep into SVG and Batik (just spent the day reading through documents and tutorials) but I think there are some interesting aspects I can't ignore.
Maybe you can help me with my decision. Here the facts what I want to do and what I need:
1.) easy to read but powerful description of graphical objects
that's why I thought of SVG, my framework also uses XML for configuration (quite a lot to be honest) and the graphical objects are part of this configuration. This is a main point: easy but yet powerful specification of graphical objects.
Generally SVG meets this description. Some people who are doing things in your space may consider
SVG an abstraction level or so "too low" (they want things like connection points for lines that move
with groups for example).
2.) ability to modify these graphical objects during runtime.
What I'm especially interested in is adding text information when reading the SVG definition from a file and then change (maybe predefined) or add text.
This is pretty simple to do with Batik. The Biggest FAQ is that modificaitons to the SVG DOM
must be done in 'the update thread'. Just search the archives for what this means.
3.) the ability to display many different graphical objects on one display (Canvas, Window,..)
Imagine a sequential stream of such graphical objects and a process just decided where to place and "draw" this object, how long it should be shown, etc.
This can be done using 'image' element's however this may conflict with you desire to modify the
SVG 'graphical objects'.
4.) since I'll generate lot's of (small) objects to display, this should be reasonably fast...
Batik does the best it can. As a general purpose engine it may not be as fast as a purpose built
one, but by the same token it has some fairly sophisticated dirty region tracking abilities, that many
'purpose built' engines might not invest in.
As for Point 3.) rendering SVGs to a display I read about SVGCanvas but as far as I understood this Canvas is exactly for one Object. I would need much more than one. Some objects might "appear", be displayed for some time and dissapear again. I thought of combining/merging and tearing SVGs apart again but this seems to be the most ugly and slowest way.
I don't think this is as bad as you think. It is true that JSVGCanvas only displays one document
but you can fairly quickly add and remove subtree's from this document for your other 'objects'.
You can also reference the other objects with the SVG image element (which let's you place and size
them) but the referenced document is "mostly" opaque.
The easiest way to describe what I want might be:
read SVGs from file, modify them during runtime (add/cahnge text), decide where on the screen and for how long to display them, and then delete them again. (basically generate a animation with interacting graphical objects on one display)
This would probably be best done using one main document that you add/remove/modify subtrees for
each 'external' document.
What do you think? Is this a possible way to go? Is this concept too slow or too complicated?
I think this is likely your best bet.
Just for interest: is there a way to convert a SVG DOM structure into a Java Swing Component?
This is exactly what JSVGCanvas is. Did you really mean a BufferedImage? that can be done
with the 'StaticRenderer' class.
Thanks for your opinions and hints!
Good luck!
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
