使用 Java 进行树可视化
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7108287/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tree Visualisation with Java
提问by Johannes
I am looking for a libary to generate Graphs or Trees like Organizations Charts. This library should be able to generate plain Images from this graphs.
我正在寻找一个库来生成图形或树,如组织图表。这个库应该能够从这个图中生成普通图像。
Does anyone knows a good, hopefully open source, library for Graph Visualization?
有谁知道一个好的,希望是开源的图形可视化库?
采纳答案by Reverend Gonzo
回答by Terran
Graphstream Project looks incredible and is open source. The best about it, it's not Swing based:
Graphstream 项目看起来不可思议并且是开源的。最棒的是,它不是基于 Swing 的:
Graph graph = new SingleGraph("Tutorial 1");
graph.setStrict(false);
graph.setAutoCreate(true); // optionally have it create nodes for you automatically
graph.addEdge("AB", "A", "B");
graph.addEdge("BC", "B", "C");
graph.addEdge("CA", "C", "A");
graph.display();
Or a tree:
或者一棵树: