Package org.graphstream.graph

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


    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 < 50; 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


  String style = "node{fill-mode:plain;fill-color:#567;size:6px;}";
  graph.addAttribute("stylesheet", style);
  graph.addAttribute("ui.antialias", true);
  graph.addAttribute("layout.stabilization-limit", 0);
  for (int i = 0; i < 500; i++) {
      graph.addNode(i + "");
      if (i > 0) {
    graph.addEdge(i + "-" + (i - 1), i + "", (i - 1) + "");
    graph.addEdge(i + "--" + (i / 2), i + "", (i / 2) + "");
      }
  }
View Full Code Here

    g.addSink(sender);

    g.addAttribute("id", workspace);

    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", workspace);

    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

    g.addAttribute("id", workspace);

    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

    JSONSender sender = new JSONSender("localhost", 8080,
      "workspace0");

    g.addSink(sender);

    Node node0 = g.addNode("node0");
    Edge edge = g.addEdge("edge", "node0", "node1", true);
    /*
     * node0.addAttribute("nodeAttribute", 0);
     * node0.changeAttribute("nodeAttribute", 1);
     * node0.removeAttribute("nodeAttribute");
 
View Full Code Here

  JSONSender sender = new JSONSender("localhost", 8080, "workspace0");
  sender.setDebug(true);
  graph.addSink(sender);

  graph.addNode("A");
  graph.addNode("B");
  graph.addNode("C");
  sleep();
  graph.addEdge("AB", "A", "B");
  graph.addEdge("BC", "B", "C");
View Full Code Here

  JSONSender sender = new JSONSender("localhost", 8080, "workspace0");
  sender.setDebug(true);
  graph.addSink(sender);

  graph.addNode("A");
  graph.addNode("B");
  graph.addNode("C");
  sleep();
  graph.addEdge("AB", "A", "B");
  graph.addEdge("BC", "B", "C");
  graph.addEdge("CA", "C", "A");
View Full Code Here

  sender.setDebug(true);
  graph.addSink(sender);

  graph.addNode("A");
  graph.addNode("B");
  graph.addNode("C");
  sleep();
  graph.addEdge("AB", "A", "B");
  graph.addEdge("BC", "B", "C");
  graph.addEdge("CA", "C", "A");
  sleep();
View Full Code Here

    copyAttributes(g, copy);

    for (int i = 0; i < g.getNodeCount(); i++) {
      Node source = g.getNode(i);
      Node target = copy.addNode(source.getId());

      copyAttributes(source, target);
    }

    for (int i = 0; i < g.getEdgeCount(); i++) {
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.