Programming a simple drawing application

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

+1


source to share


5 answers


Take a look at Java Advanced Imaging ( JAI ) and Batik SVG Toolkit:



+3


source


There is an interesting article on SVG and Java here . Towards the end, he discusses creating SVG elements programmatically (using DOM manipulation).



+2


source


Another solution I used (albeit for displaying SVG files, in my case) is Salamander :

Lightweight and easy to use with the swing. It contains an SVGIcon class that makes it trivial to add SVG images to your application.

Since it supports animation, you can change the DOM of the SVG file and the changes will be reflected on the screen.

The requirement to easily export to SVG can only be met if the SVG starts with ...: D

+1


source


You can use the built-in java.awt package for basic drawing functions.

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

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

public void draw (Graphics graphicsIn) function .

Edit: I haven't read that you need SVG exports. In this case, my proposal might be silly.

0


source


A possible solution is to use Cairo , which has Java bindings and can be exported in several formats, including SVG.

0


source







All Articles