Package edu.uci.ics.jung.graph.impl

Examples of edu.uci.ics.jung.graph.impl.SparseVertex.addUserDatum()


    private BufferedImage buildGraphFromCollection(Map<String, String> graph) {
        edu.uci.ics.jung.graph.UndirectedGraph g = new edu.uci.ics.jung.graph.impl.UndirectedSparseGraph();
        Set<Entry<String, String>> entries = graph.entrySet();
        for (Entry<String, String> entry : entries) {
            Vertex v1 = new SparseVertex();
            v1.addUserDatum("name", entry.getKey(), new UserDataContainer.CopyAction.Clone());
            g.addVertex(v1);
            Vertex v2 = new SparseVertex();
            v2.addUserDatum("name", entry.getValue(), new UserDataContainer.CopyAction.Clone());
            g.addVertex(v2);
            Edge e = new UndirectedSparseEdge(v1, v2);
View Full Code Here


        for (Entry<String, String> entry : entries) {
            Vertex v1 = new SparseVertex();
            v1.addUserDatum("name", entry.getKey(), new UserDataContainer.CopyAction.Clone());
            g.addVertex(v1);
            Vertex v2 = new SparseVertex();
            v2.addUserDatum("name", entry.getValue(), new UserDataContainer.CopyAction.Clone());
            g.addVertex(v2);
            Edge e = new UndirectedSparseEdge(v1, v2);
            g.addEdge(e);
        }
        FRLayout l = new FRLayout(g);
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.