Package diva.graph.modular

Examples of diva.graph.modular.Node


                g = factory.createGraph();
                root = (CompositeNode) g.getRoot();
            }

            public void run() throws Exception {
                Node first = g.createNode(null);
                g.addNode(this, first, root);

                for (int i = 1; i < 32; i++) {
                    Node n = g.createNode(null);
                    g.addNode(this, n, root);

                    Edge e = g.createEdge(null);
                    g.connectEdge(this, e, first, n);
                }
View Full Code Here


                g = factory.createGraph();
                root = (CompositeNode) g.getRoot();
            }

            public void run() throws Exception {
                Node first = g.createNode(null);
                g.addNode(this, first, root);

                //nodes[0] = first;
                for (int i = 1; i < 65536; i++) {
                    Node n = g.createNode(null);
                    g.addNode(this, n, root);

                    //nodes[i] = n;
                    Edge e = g.createEdge(null);
                    g.connectEdge(this, e, first, n);
View Full Code Here

        //       / \
        //      B   C
        //
        BasicGraphModel model = new BasicGraphModel();
        CompositeNode root = (CompositeNode) model.getRoot();
        Node a = model.createNode("a");
        Node b = model.createNode("b");
        Node c = model.createNode("c");
        model.addNode(this, a, root);
        model.addNode(this, b, root);
        model.addNode(this, c, root);

        Edge x = model.createEdge("x");
View Full Code Here

        //        A
        //       / \
        //      B   C
        //
        BasicGraphModel model = new BasicGraphModel();
        Node a = model.createNode("a");
        Node b = model.createNode("b");
        CompositeNode c = model.createComposite("c");
        CompositeNode c2 = model.createComposite("c2");
        Node d = model.createNode("d");
        Node d2 = model.createNode("d2");
        model.addNode(this, a, model.getRoot());
        model.addNode(this, c, model.getRoot());
        model.addNode(this, b, model.getRoot());
        model.addNode(this, c2, model.getRoot());
        model.addNode(this, d, c);
View Full Code Here

        set0.add(o3);
        set0.add(o4);
        set0.add(o5);

        Graph root = (Graph) model.getRoot();
        Node s0 = model.createNode(set0);
        Node n1 = model.createNode(o1);
        Node n2 = model.createNode(o2);
        Node n3 = model.createNode(o3);
        Node n4 = model.createNode(o4);
        Node n5 = model.createNode(o5);
        model.addNode(this, s0, root);
        model.addNode(this, n1, root);
        model.addNode(this, n2, root);
        model.addNode(this, n3, root);
        model.addNode(this, n4, root);
        model.addNode(this, n5, root);

        Edge e1 = model.createEdge("e1");
        Edge e2 = model.createEdge("e2");
        Edge e3 = model.createEdge("e3");
        Edge e4 = model.createEdge("e4");
        Edge e5 = model.createEdge("e5");
        model.connectEdge(this, e1, s0, n1);
        model.connectEdge(this, e2, s0, n2);
        model.connectEdge(this, e3, s0, n3);
        model.connectEdge(this, e4, s0, n4);
        model.connectEdge(this, e5, s0, n5);

        // another cluster
        ArrayList set1 = new ArrayList();
        Object o11 = Integer.valueOf(15);
        Object o12 = Integer.valueOf(15);
        Node s1 = model.createNode(set1);
        Node n11 = model.createNode(o11);
        Node n12 = model.createNode(o12);
        model.addNode(this, s1, root);
        model.addNode(this, n11, root);
        model.addNode(this, n12, root);

        Edge e6 = model.createEdge("e6");
        Edge e7 = model.createEdge("e7");
        model.connectEdge(this, e6, s1, n11);
        model.connectEdge(this, e7, s1, n12);

        // an empty cluster
        ArrayList set2 = new ArrayList();
        Node s2 = model.createNode(set2);
        model.addNode(this, s2, root);

        return model;
    }
View Full Code Here

TOP

Related Classes of diva.graph.modular.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.