在Graphstream中显示平行边

我有一个多图,我希望能够清楚地看到从一个顶点到另一个顶点的每条边。 例如,当我有一个带有2个顶点的图形,以及从第一个到第二个的2个边缘时,我希望看到从第一个节点到第二个节点的2个箭头,而不是重叠的箭头。

这是我目前的代码,您可以看到我正在尝试连接A和B的2条边:

import org.graphstream.graph.*; import org.graphstream.graph.implementations.*; import org.graphstream.ui.swingViewer.Viewer; public class Tutorial1 { public static void main(String args[]) { Graph graph = new MultiGraph("Test"); graph.addNode("A"); graph.addNode("B"); graph.addEdge("1", "A", "B", true); graph.addEdge("2", "A", "B", true); Viewer viewer = graph.display(); } } 

谢谢你的帮助。

添加系统属性:

 System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer"); 

资源

Interesting Posts