Search in sources :

Example 21 with MultiGraph

use of org.graphstream.graph.implementations.MultiGraph in project gs-ui-javafx by graphstream.

the class TestStrokeMode method run.

private void run() {
    MultiGraph graph = new MultiGraph("stroke");
    graph.setAttribute("ui.quality");
    graph.setAttribute("ui.antialias");
    graph.setAttribute("ui.stylesheet", styleSheet);
    graph.display();
    graph.addNode("A");
    graph.addNode("B");
    graph.addNode("C");
    graph.addNode("D");
    graph.addEdge("AB", "A", "B");
    graph.addEdge("BC", "B", "C");
    graph.addEdge("CA", "C", "A");
    graph.addEdge("AD", "A", "D");
    graph.forEach(node -> node.setAttribute("ui.label", node.getId()));
}
Also used : MultiGraph(org.graphstream.graph.implementations.MultiGraph)

Aggregations

MultiGraph (org.graphstream.graph.implementations.MultiGraph)21 Node (org.graphstream.graph.Node)12 FxViewer (org.graphstream.ui.fx_viewer.FxViewer)12 ViewerPipe (org.graphstream.ui.view.ViewerPipe)10 Scene (javafx.scene.Scene)9 FxGraphRenderer (org.graphstream.ui.javafx.FxGraphRenderer)9 FxDefaultView (org.graphstream.ui.fx_viewer.FxDefaultView)8 Viewer (org.graphstream.ui.view.Viewer)8 DorogovtsevMendesGenerator (org.graphstream.algorithm.generator.DorogovtsevMendesGenerator)5 Edge (org.graphstream.graph.Edge)4 Graph (org.graphstream.graph.Graph)4 WindowEvent (javafx.stage.WindowEvent)3 FxViewPanel (org.graphstream.ui.fx_viewer.FxViewPanel)3 SpriteManager (org.graphstream.ui.spriteManager.SpriteManager)3 ThreadProxyPipe (org.graphstream.stream.thread.ThreadProxyPipe)2 IOException (java.io.IOException)1 GridPane (javafx.scene.layout.GridPane)1 StackPane (javafx.scene.layout.StackPane)1 Stage (javafx.stage.Stage)1 RandomWalk (org.graphstream.algorithm.randomWalk.RandomWalk)1