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

Examples of edu.uci.ics.jung.graph.impl.SparseVertex


   * @return The vertex
   */
  private Vertex getVertex(String dataType) {
    Vertex vertex = (SparseVertex) dataTypeToVertex.get(dataType);
    if (vertex== null) {
      vertex = new SparseVertex();
      vertex.addUserDatum("label",
          dataType,
          new UserDataContainer.CopyAction.Shared());
      graph.addVertex(vertex);
      dataTypeToVertex.put(dataType, vertex);
View Full Code Here


    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);
            g.addEdge(e);
        }
        FRLayout l = new FRLayout(g);
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.impl.SparseVertex

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.