Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.Path


    }

    while (iter.hasNext()) {
      Connection conn = (Connection) iter.next();

      Path path = (Path) connectionToPaths.get(conn);
      if (path == null) {
        path = new Path(conn);
        connectionToPaths.put(conn, path);
        algorithm.addPath(path);
      }

      List constraint = (List) getConstraint(conn);
      if (constraint == null)
        constraint = Collections.EMPTY_LIST;

      Point start = conn.getSourceAnchor().getReferencePoint().getCopy();
      Point end = conn.getTargetAnchor().getReferencePoint().getCopy();

      container.translateToRelative(start);
      container.translateToRelative(end);

      path.setStartPoint(start);
      path.setEndPoint(end);

      if (!constraint.isEmpty()) {
        PointList bends = new PointList(constraint.size());
        for (int i = 0; i < constraint.size(); i++) {
          Bendpoint bp = (Bendpoint) constraint.get(i);
          bends.addPoint(bp.getLocation());
        }
        path.setBendPoints(bends);
      }
      else
        path.setBendPoints(null);

      isDirty |= path.isDirty;
    }
    staleConnections.clear();
  }
View Full Code Here


  public void remove(Connection connection) {
    staleConnections.remove(connection);
    constraintMap.remove(connection);
    if (connectionToPaths == null)
      return;
    Path path = (Path) connectionToPaths.remove(connection);
    algorithm.removePath(path);
    isDirty = true;
    if (connectionToPaths.isEmpty()) {
      unhookAll();
      connectionToPaths = null;
View Full Code Here

      processStaleConnections();
      isDirty = false;
      List updated = algorithm.solve();
      Connection current;
      for (int i = 0; i < updated.size(); i++) {
        Path path = (Path) updated.get(i);
        current = (Connection) path.data;
        current.revalidate();

        PointList points = path.getPoints().getCopy();
        Point ref1, ref2, start, end;
        ref1 = new PrecisionPoint(points.getPoint(1));
        ref2 = new PrecisionPoint(points.getPoint(points.size() - 2));
        current.translateToAbsolute(ref1);
        current.translateToAbsolute(ref2);
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.graph.Path

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.