Visualize vector graphics in Java, which library?

假装没事ソ 提交于 2019-12-01 06:39:20

问题


I need to visualize a large vector graphic. It's a map of roads, the roads are just lines. Is there a library for that? It would be nice if that library had support for zoom-in/zoom-out and would be easy to extend. E.g. to implement selection of roads or some nice mouse-over effects. The licence should permit usage in a commercial project.

Thanks, Philip

Edit: Is there a reason not to go with Graphics2D or SWT Graphics? (The project is on SWT and doesn't involve any SVGs.)


回答1:


Have a look at Apache Batik

Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation. Another possibility is to use Batik’s modules to convert SVG to various formats, such as raster images (JPEG, PNG or TIFF) or other vector formats (EPS or PDF, the latter two due to the transcoders provided by Apache FOP). The latest revision of Batik, release 1.7, is a conformant static SVG implementation and supports interactivity, linking and scripting features of the SVG specification.

Another good alternatives are FreeHEP and VectorGraphics2D




回答2:


If you're talking about SVG-like graphics, i think Batik is the way.



来源:https://stackoverflow.com/questions/4875301/visualize-vector-graphics-in-java-which-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!