Package edu.uci.ics.jung.graph

Examples of edu.uci.ics.jung.graph.Vertex


   
    for (int converterCount = 0;
        converterCount < allConverterServices.length;
        converterCount++) {

      Vertex sourceNode, targetNode;

      ServiceReference currentConverterServiceReference =
        allConverterServices[converterCount];

      String sourceNodeKey =
View Full Code Here


 
  private Vertex updateNode(String currentNodeKey) {
   
    for (Iterator nodeIterator = outputGraph.getVertices().iterator();
        nodeIterator.hasNext();) {
      Vertex currentVertex = (Vertex) nodeIterator.next();
      if (currentVertex.getUserDatum("label").toString()
          .equalsIgnoreCase(currentNodeKey)) {
        int currentVertexStrength =
          ((Integer) currentVertex.getUserDatum("strength")).intValue();
        currentVertex.setUserDatum("strength", new Integer(++currentVertexStrength),
            new UserDataContainer.CopyAction.Shared());
        return currentVertex;
      }
    }
    return new DirectedSparseVertex();
View Full Code Here

  }

  private Vertex createNode(String nodeKey) {
    nodeCount++;
   
    Vertex node = new DirectedSparseVertex();
    node.addUserDatum("strength", new Integer(1), new UserDataContainer.CopyAction.Shared());
    node.addUserDatum("label", nodeKey, new UserDataContainer.CopyAction.Shared());
   
    outputGraph.addVertex(node);
    nodeLabels.add(nodeKey);
   
    return node;
View Full Code Here

   * @param inType The source data type
   * @param outType The target data type
   * @return Single converter path, or null if no path can be found
   */
  private ConverterImpl getConverter(String inType, String outType) {
    Vertex sourceVertex = dataTypeToVertex.get(inType);
    Vertex targetVertex = dataTypeToVertex.get(outType);

    if (sourceVertex != null && targetVertex != null) {
      DijkstraShortestPath shortestPathAlg =
          new DijkstraShortestPath(graph);
     
View Full Code Here

   */
  private void removeServiceReference(String sourceDataType,
      String targetDataType,
      ServiceReference<?> serviceReference) {
    if (sourceDataType != null && targetDataType != null) {
      Vertex sourceVertex = (Vertex) dataTypeToVertex.get(sourceDataType);
      Vertex targetVertex = (Vertex) dataTypeToVertex.get(targetDataType);
      String pid =
          (String) serviceReference.getProperty(Constants.SERVICE_PID);

      if (sourceVertex != null && targetVertex != null) {
        Edge edge = sourceVertex.findEdge(targetVertex);
View Full Code Here

  private void addServiceReference(String sourceDataType,
      String targetDataType,
      ServiceReference<?> serviceReference) {
    if (sourceDataType != null && sourceDataType.length() > 0
        && targetDataType != null && targetDataType.length() > 0) {
      Vertex sourceVertex = getVertex(sourceDataType);
      Vertex targetVertex = getVertex(targetDataType);

      removeServiceReference(
          sourceDataType,  targetDataType, serviceReference);

      Edge directedEdge = sourceVertex.findEdge(targetVertex);
View Full Code Here

   * if one does not exist
   * @param dataType Datatype representing the node
   * @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

            }
            Point2D ip = vv.inverseViewTransform(p);

            PickSupport picksupport = vv.getPickSupport();
            final PickedState pickedstate = vv.getPickedState();
            Vertex v = picksupport.getVertex(ip.getX(), ip.getY());
            if (v != null && info.hasSomethingToDisplay(v)) {
                info.refreshInfo(v);
                info.moveTo(v);
                info.setVisible(true);
            } else {
View Full Code Here

                double dx = graphPoint.getX()-graphDown.getX();
                double dy = graphPoint.getY()-graphDown.getY();
                PickedState ps = vv.getPickedState();
               
                for(Iterator iterator=ps.getPickedVertices().iterator(); iterator.hasNext(); ) {
                    Vertex v = (Vertex)iterator.next();
                    Point2D vp = layout.getLocation(v);
                    if (!layout.isLocked(v)) {
                        layout.forceMove(v, vp.getX()+dx, vp.getY()+dy);
                    }
                }
View Full Code Here

            final Graph graph = vv.getGraphLayout().getGraph();
            Point2D ip = vv.inverseViewTransform(p);

            PickSupport picksupport = vv.getPickSupport();
            final PickedState pickedstate = vv.getPickedState();
            Vertex v = picksupport.getVertex(ip.getX(), ip.getY());
            if (v != null && hasSomethingToDisplay(v, vv)) {
                String hostname = getGraphManager().getLabel(v);
               
                // open the new window
                GraphEvent ge = new GraphEvent(this);
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.graph.Vertex

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.