Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.PointList.addPoint()


            points.addPoint(bp.getLocation());
        }

        A_POINT.setLocation(conn.getTargetAnchor().getLocation(ref2));
        conn.translateToRelative(A_POINT);
        points.addPoint(A_POINT);
        conn.setPoints(points);
    }
}
View Full Code Here


    int x, y;

    for (int i = 0; i < rawPoints.length; i += 2) {
      x = scaleMaintainPosition(anchor.x, rawPoints[i], sx);
      y = scaleMaintainPosition(anchor.y, rawPoints[i + 1], sy);
      ps.addPoint(x, y);
    }
    return ps;
  }

  /**
 
View Full Code Here

   * @return
   */
  protected PointList getDefaultPoints(Rectangle bounds) {
    // let's add a vertical line if no points provided (i.e. drag and drop)
    PointList points = new PointList();
    points.addPoint(bounds.x, bounds.y);
    points.addPoint(bounds.x, bounds.y + bounds.height);
    return points;
  }

  /**
 
View Full Code Here

   */
  protected PointList getDefaultPoints(Rectangle bounds) {
    // let's add a vertical line if no points provided (i.e. drag and drop)
    PointList points = new PointList();
    points.addPoint(bounds.x, bounds.y);
    points.addPoint(bounds.x, bounds.y + bounds.height);
    return points;
  }

  /**
   * Returns a AttributeRecord or SetRecord to change the points attribute
View Full Code Here

  protected PointList getNormalizedPointList(PointList points) {
    PointList ps = new PointList(points.size());
    int[] rawPoints = points.toIntArray();
    if (rawPoints.length == 0)
      return ps;
    ps.addPoint(rawPoints[0], rawPoints[1]);
    if (rawPoints.length == 2)
      return ps;
    ps.addPoint(rawPoints[2], rawPoints[3]);
    if (rawPoints.length == 4) {
      return ps;
View Full Code Here

    if (rawPoints.length == 0)
      return ps;
    ps.addPoint(rawPoints[0], rawPoints[1]);
    if (rawPoints.length == 2)
      return ps;
    ps.addPoint(rawPoints[2], rawPoints[3]);
    if (rawPoints.length == 4) {
      return ps;
    }

    int p1 = 0, p2 = 2, p3 = 4;
View Full Code Here

    int p1 = 0, p2 = 2, p3 = 4;

    while (true) {
      if (!collinear(rawPoints, p1, p2, p3, getPixelTolerance())) {
        ps.addPoint(rawPoints[p1], rawPoints[p1 + 1]);
        p1 = p2;
      } else {
        // even if collinear we have to check whether p1 and p3 are on
        // different sides
        if (rawPoints[p1] < rawPoints[p2]
View Full Code Here

            || rawPoints[p1 + 1] < rawPoints[p2 + 1]
            && rawPoints[p3 + 1] < rawPoints[p2 + 1]
            || rawPoints[p1 + 1] > rawPoints[p2 + 1]
            && rawPoints[p3 + 1] > rawPoints[p2 + 1]) {
          // if so, add the middle point and increment a first time
          ps.addPoint(rawPoints[p2], rawPoints[p2 + 1]);
          p1 = p3;
          p2 = p3;
          p3 += 2;
          if (p3 >= rawPoints.length)
            break;
View Full Code Here

        break;
    }
    // If the last check was collinear (if and only if p2-p1>4) we still
    // have to add p1
    if (p2 - p1 > 4) {
      ps.addPoint(rawPoints[p1], rawPoints[p1 + 1]);
    }
    ps.addPoint(rawPoints[p2], rawPoints[p2 + 1]);

    return ps;
  }
View Full Code Here

    // If the last check was collinear (if and only if p2-p1>4) we still
    // have to add p1
    if (p2 - p1 > 4) {
      ps.addPoint(rawPoints[p1], rawPoints[p1 + 1]);
    }
    ps.addPoint(rawPoints[p2], rawPoints[p2 + 1]);

    return ps;
  }

  /**
 
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.