Package edu.uci.ics.jung.graph

Examples of edu.uci.ics.jung.graph.Vertex.addUserDatum()


  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here


 
  private final void testChooseStatePairsInternal(DirectedSparseGraph g, String [] initialReds, String [][] expectedReds, List<PairScore> expectedPairs,InterfaceChooserToTest chooser)
  {
    for(String red:initialReds)
    {
      Vertex v = findVertex(JUConstants.LABEL, red, g);v.removeUserDatum("colour");v.addUserDatum("colour", "red", UserData.SHARED);
    }
    Stack<? extends StatePair> pairs = chooser.choosePairs();
    Map<Integer,Set<PairScore>> distribution = new HashMap<Integer,Set<PairScore>>();// maps scores to sets of states which should correspond to them. The aim is to verify the contents of the stack regardless of the order in which elements with the same score are arranged.

    Set<Set<String>> expectedRedsAsSet = new HashSet<Set<String>>();
View Full Code Here

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

  public static void numberVertices(DirectedSparseGraph pta){
    Iterator<Vertex> vertexIt = getBFSList(pta).iterator();
    while(vertexIt.hasNext()){
      Vertex v = vertexIt.next();
      v.removeUserDatum(JUConstants.LABEL);// since we'd like this method to run multiple times, once immediately after initialisation and subsequently when sPlus and sMinus are added.
      v.addUserDatum(JUConstants.LABEL, v.toString(), UserData.SHARED);
    }
  }

  public static List<Vertex> getBFSList(Graph g){
    List<Vertex> queue = new LinkedList<Vertex>();
View Full Code Here

                        UserData.SHARED);
        jungVertex.setUserDatum(GraphAttributeType.DEEPNESS, n.getDeepness(), UserData.SHARED);

        if (n.getMetricAttribute() != null && n.getMetricAttribute().size() > 0)
            if (n.getMetricAttribute().get(0).getName().equals("SIZE"))
                jungVertex.addUserDatum(
                        GraphAttributeType.SIZE,
                        n.getMetricAttribute().get(0).getValue(),
                        UserData.SHARED);
       
//        System.out.println("Converting " + n.getId()) ;
View Full Code Here

    Map vertexTopic = new HashMap();
    while (topicsIter.hasNext()) {
      Resource element = topicsIter.nextResource();
      Vertex vertex = (Vertex) g.addVertex(new DirectedSparseVertex());
      vertexTopic.put(element, vertex);
      vertex.addUserDatum("label", element.getURI(), UserData.SHARED);
    }
    Iterator vertexIter = vertexTopic.keySet().iterator();
    Map allTopicsAndItems = new HashMap();
    allTopicsAndItems.putAll(vertexTopic);
    while (vertexIter.hasNext()) {
View Full Code Here

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

      for (Iterator<?> iter = getGraph().getVertices().iterator(); iter.hasNext();) {
        Vertex v = (Vertex) iter.next();
        Coordinates coord = (Coordinates) v.getUserDatum(getBaseKey());
        if (coord == null) {
          coord = new Coordinates();
          v.addUserDatum(getBaseKey(), coord, UserData.REMOVE);
          initializeLocation(v, coord, getCurrentSize());
          initialize_local_vertex(v);
        }
      }
    } catch (ConcurrentModificationException cme) {
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.