tags:

views:

288

answers:

5

Hello, to do some visualization of data I would like to include rectangles, circles and text within my graphs. Does anyone know a Java based framework (maybe similar to very basic Powerpoint functionality) that can export SVG graphics?

+3  A: 

Have a look at Java Advanced Imaging (JAI) and Batik SVG toolkit:

Magnus
+2  A: 

There is an interesting article on SVG & Java here. Towards the end it discusses creating SVG elements programatically (using DOM manipulation).

Harry Lime
A: 

You could use the built in java.awt package for basic drawing functionality.

http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics2D.html

extend your class from the java.awt.Drawable interface and implement the :

public void draw(Graphics graphicsIn) function.

Edit: I didn't read that you needed SVG export. My suggestion might be stupid in that case.

Nailer
+1  A: 

Another solution I've used (albeit only to display SVG files, in my case), is Salamander:

It is lightweight and easy to use together with swing. It contains a class SVGIcon that makes it trivial to add SVG images to an application.

Because it supports animation, you can modify the DOM of the SVG file and the changes will be displayed on screen.

The requirement of being able to export to SVG easily can only be met if it is SVG to start with... :D

Mario Ortegón
A: 

A possible solution is to use Cairo which has Java bindings and can export to a number of formats, including SVG.

PhiLho