Examples of addNode()


Examples of org.gephi.graph.api.Graph.addNode()

    Graph graph  = model.getGraph(sourceView);
    Graph vgraph = model.getGraph(currentView);
    for (Node n : graph.getNodes().toArray()) {
      TimeInterval ti = (TimeInterval)n.getNodeData().getAttributes().getValue(DynamicModel.TIMEINTERVAL_COLUMN);
                        if(ti == null && !vgraph.contains(n))
                                vgraph.addNode(n);
                        else if(ti != null && ti.getValue(interval, estimator) == null && vgraph.contains(n))
        vgraph.removeNode(n);
      else if (ti != null && ti.getValue(interval, estimator) != null && !vgraph.contains(n))
        vgraph.addNode(n);
    }
View Full Code Here

Examples of org.gephi.graph.api.HierarchicalDirectedGraph.addNode()

        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = graphController.getModel();
        HierarchicalDirectedGraph graph = graphModel.getHierarchicalDirectedGraph();

        Node n1 = graphModel.factory().newNode("n1");
        graph.addNode(n1);
        Node n2 = graphModel.factory().newNode("n2");
        graph.addNode(n2);
        Node n3 = graphModel.factory().newNode("n3");
        graph.addNode(n3);
        Node n4 = graphModel.factory().newNode("n4");
View Full Code Here

Examples of org.gephi.graph.api.HierarchicalGraph.addNode()

        //Nodes
        for (int i = 0; i < 5; i++) {
            Node node = factory.newNode();
            node.getNodeData().setLabel("Node " + i);
            graph.addNode(node);
        }

        for (Node n : graph.getTopNodes().toArray()) {
            Node newC = factory.newNode();
            graph.addNode(newC, n);
View Full Code Here

Examples of org.gephi.graph.api.UndirectedGraph.addNode()

        Node node3=graphModel.factory().newNode("2");
        Node node4=graphModel.factory().newNode("3");
        Node node5=graphModel.factory().newNode("4");
        Node node6=graphModel.factory().newNode("5");
        Node node7=graphModel.factory().newNode("6");
        undirectedGraph.addNode(node1);
        undirectedGraph.addNode(node2);
        undirectedGraph.addNode(node3);
        undirectedGraph.addNode(node4);
        undirectedGraph.addNode(node5);
        undirectedGraph.addNode(node6);
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalDirectedGraphImpl.addNode()

        Node node2 = factory.newNode();
        Node node3 = factory.newNode();
        Node node4 = factory.newNode();
        Node node5 = factory.newNode();
        Node node6 = factory.newNode();
        graph.addNode(node1);
        graph.addNode(node4);
        graph.addNode(node2, node1);
        graph.addNode(node3, node1);
        graph.addNode(node5, node4);
        graph.addNode(node6);
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl.addNode()

        GraphFactoryImpl factory = dhns.factory();

        Node node1 = factory.newNode();
        Node node2 = factory.newNode();
        Node node3 = factory.newNode();
        graph.addNode(node1);
        graph.addNode(node2);
        graph.addNode(node3);

        //Test normal edge
        graph.addEdge(node1, node2);
View Full Code Here

Examples of org.gephi.layout.plugin.force.quadtree.QuadTree.addNode()

    }

    @org.junit.Test
    public void testLeafTree() {
        QuadTree tree = new QuadTree(0, 0, 10, 10);
        tree.addNode(new TestNode(1, 1));
        BarnesHut barnesHut = new BarnesHut(new TestForce());

        ForceVector f = barnesHut.calculateForce(tree, tree);
        assertNotNull(f);
        assertEquals(f.x(), 1, eps);
View Full Code Here

Examples of org.gephi.visualization.hull.ConvexHull.addNode()

                if (parent != null) {
                    Group group = (Group) parent;
                    Model hullModel = group.getGroupData().getHullModel();
                    if (hullModel != null && hullModel.isCacheMatching(cacheMarker)) {
                        ConvexHull hull = (ConvexHull) hullModel.getObj();
                        hull.addNode(n);
                        hull.setModel(hullModel);
                    } else if (hullModel != null) {
                        //Its not the first time the hull exist
                        ConvexHullModel model = (ConvexHullModel) hullModel;
                        model.setScale(1f);
View Full Code Here

Examples of org.gephi.visualization.octree.Octree.addNode()

            for (Node node : graph.getNodes()) {
                int id = node.getStoreId();
                if (id >= nodes.length || nodes[id] == null) {
                    growNodes(id);
                    NodeModel model = nodeModeler.initModel(node);
                    octree.addNode(model);
                    nodes[id] = model;
                    addedNodes++;
                }
            }
            for (int i = 0; i < edges.length; i++) {
View Full Code Here

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
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.