Java 2d graphic library

819 views Asked by At

Hi I am trying to create simple 2d graphic editor. I need some library which will create shape from given points(draw lines between these points) and then user can move this shape with mouse or scale this shape with mouse. I need points, because I have Oracle Jgeometry shape saved in database and I need to visualize it. Could you please help me?

I found jGraph but I don't know, how to create shape from points, or get these points from shape

1

There are 1 answers

0
Scheintod On

Instead of reinventing the wheel I would suggest using svg. There is a pretty nice implementation from Apache: https://xmlgraphics.apache.org/batik/

You could generate svg from your data (which is pretty easy) and pass it on to batik to show in a component or you can use their bindings to Java2D to draw.

As a bonus you can use existing tools like Inkscape to edit you drawings further.

There are existing projects which use this to do simmilar things like you want: https://xmlgraphics.apache.org/batik/uses.html