Package com.ojn.gexf4j.core

Examples of com.ojn.gexf4j.core.Node


    Attribute attFrog = attrListStatic.createAttribute("1", AttributeType.BOOLEAN, "frog")
      .setDefaultValue("true");
   
    Attribute attIndegree = attrListDynamic.createAttribute("2", AttributeType.FLOAT, "indegree");
   
    Node gephi = gexf.getGraph().createNode("0");
    gephi
      .setLabel("Gephi")
      .setStartDate(toDate("2009-03-01"))
      .getAttributeValues()
        .addValue(attUrl, "http://gephi.org")
        .addValue(attIndegree, "1");
   
    Node webatlas = gexf.getGraph().createNode("1");
    webatlas
      .setLabel("Webatlas")
      .getAttributeValues()
        .addValue(attUrl, "http://webatlas.fr");
     
    webatlas.getAttributeValues().createValue(attIndegree, "1")
      .setEndDate(toDate("2009-03-01"));
    webatlas.getAttributeValues().createValue(attIndegree, "2")
      .setStartDate(toDate("2009-03-01"))
      .setEndDate(toDate("2009-03-10"));
    webatlas.getAttributeValues().createValue(attIndegree, "1")
      .setStartDate(toDate("2009-03-10"));
     
    Node rtgi = gexf.getGraph().createNode("2");
    rtgi
      .setLabel("RTGI")
      .getAttributeValues()
        .addValue(attUrl, "http://rtgi.fr");
   
    rtgi.getAttributeValues().createValue(attIndegree, "0")
      .setEndDate(toDate("2009-03-01"));
    rtgi.getAttributeValues().createValue(attIndegree, "1")
      .setStartDate(toDate("2009-03-01"));
   
    rtgi.getSlices().add(new SliceImpl()
      .setEndDate(toDate("2009-03-01")));
    rtgi.getSlices().add(new SliceImpl()
      .setStartDate(toDate("2009-03-05"))
      .setEndDate(toDate("2009-03-10")));
   
    Node blab = gexf.getGraph().createNode("3");
    blab
      .setLabel("BarabasiLab")
      .getAttributeValues()
        .addValue(attUrl, "http://barabasilab.com")
        .addValue(attFrog, "false");
       
    blab.getAttributeValues().createValue(attIndegree, "0")
      .setEndDate(toDate("2009-03-01"));
    blab.getAttributeValues().createValue(attIndegree, "1")
      .setStartDate(toDate("2009-03-01"));
   
    gephi.connectTo("0", webatlas)
      .setStartDate(toDate("2009-03-01"));
   
View Full Code Here


   
    gexf.getGraph()
      .setMode(Mode.STATIC)
      .setDefaultEdgeType(EdgeType.DIRECTED);
   
    Node kb = gexf.getGraph().createNode("a");
    kb.setLabel("Kevin Bacon");
   
    Node god = kb.createNode("b");
    god.setLabel("God");
   
    Node c = god.createNode("c");
    c.setLabel("human1");
   
    Node d = god.createNode("d");
    d.setLabel("human2");
   
    Node me = kb.createNode("e");
    me.setLabel("Me");
   
    Node f = me.createNode("f");
    f.setLabel("frog1");
   
    Node g = me.createNode("g");
    g.setLabel("frog2");
   
    god.connectTo("0", me);
    c.connectTo("1", d);
    g.connectTo("2", god);
    f.connectTo("3", kb);
   
    return gexf;
  }
View Full Code Here

   
    gexf.getGraph()
      .setMode(Mode.STATIC)
      .setDefaultEdgeType(EdgeType.DIRECTED);
   
    Node g = gexf.getGraph().createNode("g");
    g.setLabel("frog2")
      .setPID("e");
   
    Node a = gexf.getGraph().createNode("a");
    a.setLabel("Kevin Bacon");
   
    Node c = gexf.getGraph().createNode("c");
    c.setLabel("human1")
      .setPID("b");
   
        Node b = gexf.getGraph().createNode("b");
    b.setLabel("God")
      .setPID("a");
   
        Node e = gexf.getGraph().createNode("e");
    e.setLabel("Me")
      .setPID("a");
       
        Node d = gexf.getGraph().createNode("d");
    d.setLabel("human2")
      .setPID("b");
   
        Node f = gexf.getGraph().createNode("f");
    f.setLabel("frog1")
      .setPID("e");
   
   
    b.connectTo("0", e);
    c.connectTo("1", d);
    g.connectTo("2", b);
    f.connectTo("3", a);
   
    return gexf;
  }
View Full Code Here

  @Override
  public Gexf buildGexf() {
    Gexf gexf = new GexfImpl();
    Graph g = gexf.getGraph();
   
    Node hello = g.createNode("0")
      .setLabel("Hello");
    Node world = g.createNode("1")
      .setLabel("World");
   
    hello.connectTo("0", world);
   
    return gexf;
View Full Code Here

    Attribute attUrl = attrList.createAttribute("0", AttributeType.STRING, "url");
    Attribute attIndegree = attrList.createAttribute("1", AttributeType.FLOAT, "indegree");
    Attribute attFrog = attrList.createAttribute("2", AttributeType.BOOLEAN, "frog")
      .setDefaultValue("true");
   
    Node gephi = gexf.getGraph().createNode("0");
    gephi
      .setLabel("Gephi")
      .getAttributeValues()
        .addValue(attUrl, "http://gephi.org")
        .addValue(attIndegree, "1");
   
    Node webatlas = gexf.getGraph().createNode("1");
    webatlas
      .setLabel("Webatlas")
      .getAttributeValues()
        .addValue(attUrl, "http://webatlas.fr")
        .addValue(attIndegree, "2");
   
    Node rtgi = gexf.getGraph().createNode("2");
    rtgi
      .setLabel("RTGI")
      .getAttributeValues()
        .addValue(attUrl, "http://rtgi.fr")
        .addValue(attIndegree, "1");
   
    Node blab = gexf.getGraph().createNode("3");
    blab
      .setLabel("BarabasiLab")
      .getAttributeValues()
        .addValue(attUrl, "http://barabasilab.com")
        .addValue(attIndegree, "1")
        .addValue(attFrog, "false");
View Full Code Here

 
  @Override
  public Gexf buildGexf() {
    Gexf gexf = new GexfImpl();
   
    Node a = gexf.getGraph().createNode("a");
    a.setLabel("cheese");
   
    Node b = gexf.getGraph().createNode("b");
    b.setLabel("cherry");
   
    Node c = gexf.getGraph().createNode("c");
    c.setLabel("cake");
    c.getParentForList().add(a);
    c.getParentForList().add(b);
   
    return gexf;
  }
View Full Code Here

    // do nothing
  }

  @Override
  protected void onEndElement() {
    Node n = graph.createNode(id);
    n.setLabel(label);
  }
View Full Code Here

  @Override
  public Node createNode(String id) {
    checkArgument(id != null, "ID cannot be null.");
    checkArgument(!id.trim().isEmpty(), "ID cannot be empty or blank.");
       
    Node rv = new NodeImpl(id);
    nodes.add(rv);
    return rv;
  }
View Full Code Here

  @Override
  public Node createNode(String id) {
    checkArgument(id != null, "ID cannot be null.");
    checkArgument(!id.trim().isEmpty(), "ID cannot be empty or blank.");
   
    Node rv = new NodeImpl(id);
    nodes.add(rv);
    return rv;
  }
View Full Code Here

TOP

Related Classes of com.ojn.gexf4j.core.Node

Copyright © 2018 www.massapicom. 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.