Package org.graphstream.graph.implementations

Examples of org.graphstream.graph.implementations.MultiGraph.addEdge()


    Node A = graph.addNode("A");
    Node B = graph.addNode("B");
    Node C = graph.addNode("C");

    graph.addEdge("AB", "A", "B");
    graph.addEdge("BC", "B", "C");
    graph.addEdge("CA", "C", "A");

    A.addAttribute("xyz", 0, 1, 0);
    B.addAttribute("xyz", 1, 0, 0);
    C.addAttribute("xyz", -1, 0, 0);
View Full Code Here


  public void testMulti() {
    MultiGraph graph = new MultiGraph("g");
    MultiNode A = graph.addNode("A");
    MultiNode B = graph.addNode("B");

    graph.addEdge("AB1", "A", "B");
    graph.addEdge("AB2", "A", "B");

    assertEquals(2, A.getDegree());
    assertEquals(2, B.getDegree());
   
View Full Code Here

    Node B = graph.addNode("B");
    Node C = graph.addNode("C");

    graph.addEdge("AB", "A", "B");
    graph.addEdge("BC", "B", "C");
    graph.addEdge("CA", "C", "A");

    A.addAttribute("xyz", 0, 1, 0);
    B.addAttribute("xyz", 1, 0, 0);
    C.addAttribute("xyz", -1, 0, 0);
View Full Code Here

    MultiGraph graph = new MultiGraph("g");
    MultiNode A = graph.addNode("A");
    MultiNode B = graph.addNode("B");

    graph.addEdge("AB1", "A", "B");
    graph.addEdge("AB2", "A", "B");

    assertEquals(2, A.getDegree());
    assertEquals(2, B.getDegree());
   
    // loop edges
View Full Code Here

    assertEquals(2, A.getDegree());
    assertEquals(2, B.getDegree());
   
    // loop edges
    graph.addEdge("AA1", "A", "B");
    graph.addEdge("AA2", "A", "B", true);
   
    assertEquals(4, A.getDegree());
  }
View Full Code Here

    assertEquals(2, A.getDegree());
    assertEquals(2, B.getDegree());
   
    // loop edges
    graph.addEdge("AA1", "A", "B");
    graph.addEdge("AA2", "A", "B", true);
   
    assertEquals(4, A.getDegree());
  }

  @Test
View Full Code Here

    // We modify the graph in the main thread.

    Node A = main.addNode("A");
    Node B = main.addNode("B");
    Node C = main.addNode("C");
    main.addEdge("AB", "A", "B");
    main.addEdge("BC", "B", "C");
    main.addEdge("CA", "C", "A");

    SpriteManager sman = new SpriteManager(main);
    Sprite S1 = sman.addSprite("S1");
View Full Code Here

    Node A = main.addNode("A");
    Node B = main.addNode("B");
    Node C = main.addNode("C");
    main.addEdge("AB", "A", "B");
    main.addEdge("BC", "B", "C");
    main.addEdge("CA", "C", "A");

    SpriteManager sman = new SpriteManager(main);
    Sprite S1 = sman.addSprite("S1");
    Sprite S2 = sman.addSprite("S2");
View Full Code Here

    Node A = main.addNode("A");
    Node B = main.addNode("B");
    Node C = main.addNode("C");
    main.addEdge("AB", "A", "B");
    main.addEdge("BC", "B", "C");
    main.addEdge("CA", "C", "A");

    SpriteManager sman = new SpriteManager(main);
    Sprite S1 = sman.addSprite("S1");
    Sprite S2 = sman.addSprite("S2");
    Sprite S3 = sman.addSprite("S3");
View Full Code Here

    g.addAttribute("ui.antialias", true);
    g.addAttribute("layout.stabilization-limit", 0);
    for (int i = 0; i < 500; i++) {
      g.addNode(i + "");
      if (i > 0) {
        g.addEdge(i + "-" + (i - 1), i + "", (i - 1) + "");
        g.addEdge(i + "--" + (i / 2), i + "", (i / 2) + "");
      }
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.