Package org.graphstream.graph

Examples of org.graphstream.graph.Graph.addNode()


public class TestElement {
  @Test(expected=NullAttributeException.class)
  public void testElementSimpleAttributes() {
    Graph graph = new MultiGraph("g1");

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

    assertEquals("A", A.getId());
    assertEquals(0, A.getAttributeCount());

    // Simple attributes.
View Full Code Here


  @Test
  public void testElementValueAttributes() {
    Graph graph = new MultiGraph("g1");

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

    assertEquals("A", A.getId());
    assertEquals(0, A.getAttributeCount());

    // Label attributes.
View Full Code Here

  @Test
  public void testElementMultiAttributes() {
    Graph graph = new MultiGraph("g1");

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

    assertEquals("A", A.getId());
    assertEquals(0, A.getAttributeCount());

    // Arrays
View Full Code Here

        String style = "node{fill-mode:plain;fill-color:#567;size:6px;}";
        g.addAttribute("stylesheet", style);
        g.addAttribute("ui.antialias", true);
        g.addAttribute("layout.stabilization-limit", 0);
        for (int i = 0; i < 5000; 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

  @Test
  public void testElementUtilityMethods() {
    Graph graph = new MultiGraph("g1");

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

    assertEquals("A", A.getId());
    assertEquals(0, A.getAttributeCount());

    // First attribute of.
View Full Code Here

  @Test
  public void testElementIterables() {
    Graph graph = new MultiGraph("g1");

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

    assertEquals("A", A.getId());
    assertEquals(0, A.getAttributeCount());

    // First attribute of.
View Full Code Here

    out2.begin("TestSinkGML.dgml");
   
    graph.addSink(out1);
    graph.addSink(out2);
   
    graph.addNode("A");
    graph.getNode("A").addAttribute("s", "foo bar");
    graph.addNode("B");
    graph.stepBegins(1);
    graph.addEdge("AB", "A", "B", true);
    graph.getEdge("AB").addAttribute("n", 1);
View Full Code Here

    graph.addSink(out1);
    graph.addSink(out2);
   
    graph.addNode("A");
    graph.getNode("A").addAttribute("s", "foo bar");
    graph.addNode("B");
    graph.stepBegins(1);
    graph.addEdge("AB", "A", "B", true);
    graph.getEdge("AB").addAttribute("n", 1);
    graph.stepBegins(2);
    graph.addAttribute("b", true);
View Full Code Here

        g.addSink(nsc);

        g.addAttribute("id", id);

        for (int i = 0; i < 30; i++) {
          g.addNode(prefix + i + "_1");
          g.addNode(prefix + i + "_0");
          g.addNode(prefix + i + "_2");
          try {
            Thread.sleep(1);
          } catch (InterruptedException e) {
View Full Code Here

        g.addAttribute("id", id);

        for (int i = 0; i < 30; i++) {
          g.addNode(prefix + i + "_1");
          g.addNode(prefix + i + "_0");
          g.addNode(prefix + i + "_2");
          try {
            Thread.sleep(1);
          } catch (InterruptedException e) {
            e.printStackTrace();
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.