Package org.graphstream.graph

Examples of org.graphstream.graph.Node.addAttribute()


    Edge e = g.addEdge("AB", "A", "B");
    e.addAttribute("attribute", "foo");
    e.changeAttribute("attribute", false);
    Node n = e.getNode0();
    n.addAttribute("attribute", "foo");
    n.changeAttribute("attribute", false);

      }
  }.start();
View Full Code Here


    for (Node node : graph) {
      Node n = this.graph.addNode(node.getId());

      if (node.getAttributeKeySet() != null) {
        for (String key : node.getAttributeKeySet()) {
          n.addAttribute(key, node.getAttribute(key));
        }
      }
    }

    // Replay all edges and their attributes.
View Full Code Here

      Node node = g.getNode(nodeId);
      if (node != null) {
        passYourWay = true;

        try {
          node.addAttribute(attribute, value);
        } finally {
          passYourWay = false;
        }

        sendNodeAttributeAdded(sourceId, timeId, nodeId, attribute,
View Full Code Here

  public static void main(String... args) throws Exception {
    Graph g1 = new AdjacencyListGraph("g1");
    Graph g2 = new AdjacencyListGraph("g2");

    Node a1 = g1.addNode("A");
    a1.addAttribute("attr1", "test");
    a1.addAttribute("attr2", 10.0);
    a1.addAttribute("attr3", 12);

    Node a2 = g2.addNode("A");
    a2.addAttribute("attr1", "test1");
View Full Code Here

    Graph g1 = new AdjacencyListGraph("g1");
    Graph g2 = new AdjacencyListGraph("g2");

    Node a1 = g1.addNode("A");
    a1.addAttribute("attr1", "test");
    a1.addAttribute("attr2", 10.0);
    a1.addAttribute("attr3", 12);

    Node a2 = g2.addNode("A");
    a2.addAttribute("attr1", "test1");
    a2.addAttribute("attr2", 10.0);
View Full Code Here

    Graph g2 = new AdjacencyListGraph("g2");

    Node a1 = g1.addNode("A");
    a1.addAttribute("attr1", "test");
    a1.addAttribute("attr2", 10.0);
    a1.addAttribute("attr3", 12);

    Node a2 = g2.addNode("A");
    a2.addAttribute("attr1", "test1");
    a2.addAttribute("attr2", 10.0);
    g2.addNode("B");
View Full Code Here

    a1.addAttribute("attr1", "test");
    a1.addAttribute("attr2", 10.0);
    a1.addAttribute("attr3", 12);

    Node a2 = g2.addNode("A");
    a2.addAttribute("attr1", "test1");
    a2.addAttribute("attr2", 10.0);
    g2.addNode("B");
    g2.addNode("C");

    GraphDiff diff = new GraphDiff(g2, g1);
View Full Code Here

    a1.addAttribute("attr2", 10.0);
    a1.addAttribute("attr3", 12);

    Node a2 = g2.addNode("A");
    a2.addAttribute("attr1", "test1");
    a2.addAttribute("attr2", 10.0);
    g2.addNode("B");
    g2.addNode("C");

    GraphDiff diff = new GraphDiff(g2, g1);
    System.out.println(diff);
View Full Code Here

        if (A != null)
          A.addAttribute("xyz", 4, 3, 2);
        if (B != null)
          B.addAttribute("xyz", 2, 1, 0);
        if (C != null)
          C.addAttribute("xyz", 3, 2, 1);

        GraphicSprite S1 = graphic.getSprite("S1");
        GraphicSprite S2 = graphic.getSprite("S2");

        if (S2 != null) {
View Full Code Here

    Edge BC1 = g1.addEdge("BC", "B", "C");
    Edge CA1 = g1.addEdge("CA", "C", "A");

    A1.addAttribute("string", "an example");
    B1.addAttribute("double", 42.0);
    C1.addAttribute("array", new int[] { 1, 2, 3 });

    AB1.addAttribute("string", "an example");
    BC1.addAttribute("double", 42.0);
    CA1.addAttribute("array", new int[] { 1, 2, 3 });
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.