Esempio n. 1
0
  /**
   * Adds the specified JGraphT vertex to be reflected by this graph model. To be called only for
   * edges that already exist in the JGraphT graph.
   *
   * @param jtVertex a JGraphT vertex to be reflected by this graph model.
   */
  void handleJGraphTAddedVertex(V jtVertex) {
    DefaultGraphCell vertexCell = cellFactory.createVertexCell(jtVertex);
    vertexCell.add(new DefaultPort());

    vertexToCell.put(jtVertex, vertexCell);
    cellToVertex.put(vertexCell, jtVertex);

    internalInsertCell(vertexCell, createVertexAttributeMap(vertexCell), null);
  }
Esempio n. 2
0
  /**
   * Adds the specified JGraphT edge to be reflected by this graph model. To be called only for
   * edges that already exist in the JGraphT graph.
   *
   * @param jtEdge a JGraphT edge to be reflected by this graph model.
   */
  void handleJGraphTAddedEdge(E jtEdge) {
    DefaultEdge edgeCell = cellFactory.createEdgeCell(jtEdge);
    edgeToCell.put(jtEdge, edgeCell);
    cellToEdge.put(edgeCell, jtEdge);

    ConnectionSet cs = new ConnectionSet();
    cs.connect(
        edgeCell,
        getVertexPort(jtGraph.getEdgeSource(jtEdge)),
        getVertexPort(jtGraph.getEdgeTarget(jtEdge)));

    internalInsertCell(edgeCell, createEdgeAttributeMap(edgeCell), cs);
  }