Package edu.uci.ics.jung.graph

Examples of edu.uci.ics.jung.graph.Graph.addEdge()


    Edge e12 = new DirectedSparseEdge(v1, v2);
    e12.setUserDatum("ID", "12", UserData.SHARED);
    e12.setUserDatum("Name", "myEdge12", UserData.SHARED);
    e12.setUserDatum("Description", "myEdge 12 description", UserData.SHARED);
    e12.setUserDatum("Deepness", 2, UserData.SHARED);
    g.addEdge(e12);
    Edge e23 = new DirectedSparseEdge(v2, v3);
    e23.setUserDatum("ID", "23", UserData.SHARED);
    e23.setUserDatum("Name", "myEdge23", UserData.SHARED);
    e23.setUserDatum("Description", "myEdge 23 description", UserData.SHARED);
    e23.setUserDatum("Deepness", 1, UserData.SHARED);
View Full Code Here


    Edge e23 = new DirectedSparseEdge(v2, v3);
    e23.setUserDatum("ID", "23", UserData.SHARED);
    e23.setUserDatum("Name", "myEdge23", UserData.SHARED);
    e23.setUserDatum("Description", "myEdge 23 description", UserData.SHARED);
    e23.setUserDatum("Deepness", 1, UserData.SHARED);
    g.addEdge(e23);
    Edge e13 = new DirectedSparseEdge(v1, v3);
    e13.setUserDatum("ID", "13", UserData.SHARED);
    e13.setUserDatum("Name", "myEdge13", UserData.SHARED);
    e13.setUserDatum("Description", "myEdge 13 description", UserData.SHARED);
    e13.setUserDatum("Deepness", 1, UserData.SHARED);
View Full Code Here

    Edge e13 = new DirectedSparseEdge(v1, v3);
    e13.setUserDatum("ID", "13", UserData.SHARED);
    e13.setUserDatum("Name", "myEdge13", UserData.SHARED);
    e13.setUserDatum("Description", "myEdge 13 description", UserData.SHARED);
    e13.setUserDatum("Deepness", 1, UserData.SHARED);
    g.addEdge(e13);
    Edge e34= new DirectedSparseEdge(v3,v4);
    e34.setUserDatum("ID", "34", UserData.SHARED);
    e34.setUserDatum("Name", "myEdge34", UserData.SHARED);
    e34.setUserDatum("Description", "myEdge 34 description", UserData.SHARED);
    e34.setUserDatum("Deepness", 1, UserData.SHARED);
View Full Code Here

    Edge e34= new DirectedSparseEdge(v3,v4);
    e34.setUserDatum("ID", "34", UserData.SHARED);
    e34.setUserDatum("Name", "myEdge34", UserData.SHARED);
    e34.setUserDatum("Description", "myEdge 34 description", UserData.SHARED);
    e34.setUserDatum("Deepness", 1, UserData.SHARED);
    g.addEdge(e34);
    return g;
  }

  /**
   *
 
View Full Code Here

        }
        Resource target = currentRelations.getProperty(KNOBOT.target)
            .getResource();
        Vertex targetVertex = (Vertex) vertexTopic.get(target);
        if (targetVertex != null) {
          DirectedEdge e = (DirectedEdge) g
              .addEdge(new DirectedSparseEdge(
                  (Vertex) vertexTopic.get(currentSource),
                  targetVertex));
        } else {
          //is an item
View Full Code Here

                .addVertex(new DirectedSparseVertex());
            vertex.addUserDatum("label", target.getURI(),
                UserData.SHARED);
            allTopicsAndItems.put(target, vertex);
          }
          DirectedEdge e = (DirectedEdge) g
              .addEdge(new DirectedSparseEdge(
                  (Vertex) vertexTopic.get(currentSource),
                  vertex));
        }
      }
View Full Code Here

            Pair endpoints = inGraph.getEndpoints(e);
            // don't add edges whose endpoints are both in the cluster
            if(cluster.containsAll(endpoints) == false) {

                if(cluster.contains(endpoints.getFirst())) {
                  graph.addEdge(e, clusterGraph, endpoints.getSecond(), inGraph.getEdgeType(e));

                } else if(cluster.contains(endpoints.getSecond())) {
                  graph.addEdge(e, endpoints.getFirst(), clusterGraph, inGraph.getEdgeType(e));

                } else {
View Full Code Here

                if(cluster.contains(endpoints.getFirst())) {
                  graph.addEdge(e, clusterGraph, endpoints.getSecond(), inGraph.getEdgeType(e));

                } else if(cluster.contains(endpoints.getSecond())) {
                  graph.addEdge(e, endpoints.getFirst(), clusterGraph, inGraph.getEdgeType(e));

                } else {
                  graph.addEdge(e,endpoints.getFirst(), endpoints.getSecond(), inGraph.getEdgeType(e));
                }
            }
View Full Code Here

                } else if(cluster.contains(endpoints.getSecond())) {
                  graph.addEdge(e, endpoints.getFirst(), clusterGraph, inGraph.getEdgeType(e));

                } else {
                  graph.addEdge(e,endpoints.getFirst(), endpoints.getSecond(), inGraph.getEdgeType(e));
                }
            }
        }
        return graph;
    }
View Full Code Here

        // put all clusterGraph vertices and edges into the new Graph
        for(Object v : cluster) {
            graph.addVertex(v);
            for(Object edge : clusterGraph.getIncidentEdges(v)) {
                Pair endpoints = clusterGraph.getEndpoints(edge);
                graph.addEdge(edge, endpoints.getFirst(), endpoints.getSecond(), clusterGraph.getEdgeType(edge));
            }
        }
        // add all the vertices from the current graph except for
        // the cluster we are expanding
        for(Object v : inGraph.getVertices()) {
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.