Package org.eclipse.swt.graphics

Examples of org.eclipse.swt.graphics.Path.moveTo()


        PathIterator pit = shape.getPathIterator(null);
        while (!pit.isDone()) {
            type = pit.currentSegment(coords);
            switch (type) {
                case (PathIterator.SEG_MOVETO):
                    path.moveTo(coords[0], coords[1]);
                    break;
                case (PathIterator.SEG_LINETO):
                    path.lineTo(coords[0], coords[1]);
                    break;
                case (PathIterator.SEG_QUADTO):
View Full Code Here


        PathIterator pit = shape.getPathIterator(null);
        while (!pit.isDone()) {
            type = pit.currentSegment(coords);
            switch (type) {
                case (PathIterator.SEG_MOVETO):
                    path.moveTo(coords[0], coords[1]);
                    break;
                case (PathIterator.SEG_LINETO):
                    path.lineTo(coords[0], coords[1]);
                    break;
                case (PathIterator.SEG_QUADTO):
View Full Code Here

    // otherwise the path is not drawn at all (same happens
    // RoundedRectangles)
    if (cornerHeight <= 0 || cornerWidth <= 0) {
      path.addRectangle(x, y, width, height);
    } else {
      path.moveTo(x, y);
      path.addArc(x, y, cornerWidth, cornerHeight, 90, 90);
      path.addArc(x, bottom - cornerHeight, cornerWidth, cornerHeight, 180, 90);
      path.addArc(right - cornerWidth, bottom - cornerHeight, cornerWidth, cornerHeight, 270, 90);
      path.addArc(right - cornerWidth, y, cornerWidth, cornerHeight, 0, 90);
      path.close();
View Full Code Here

    points.addAll(origPoints);

    // Draw simple lines, as bezier-curve doesn't make sense
    if (points.size() < 3 || !hasBezierDistance(origPoints)) {
      if (points.size() != 0) {
        path.moveTo(points.get(0).getX(), points.get(0).getY());
        for (int i = 1; i < points.size(); i++) {
          path.lineTo(points.get(i).getX(), points.get(i).getY());
        }
      }
    } else { // Draw bezier curve
View Full Code Here

      // If not closed, draw the first line from the first point to r,
      // otherwise move to r
      determineBezierPoints(c, q, r, s, points.get(0).getBezierDistanceAfter(), points.get(1).getBezierDistanceBefore());
      if (!isClosed) {
        path.moveTo(points.get(0).getX(), points.get(0).getY());
        path.lineTo(r.x, r.y);
      } else {
        path.moveTo(r.x, r.y);
      }
View Full Code Here

      determineBezierPoints(c, q, r, s, points.get(0).getBezierDistanceAfter(), points.get(1).getBezierDistanceBefore());
      if (!isClosed) {
        path.moveTo(points.get(0).getX(), points.get(0).getY());
        path.lineTo(r.x, r.y);
      } else {
        path.moveTo(r.x, r.y);
      }

      for (int index = 2; index < points.size(); index++) {
        // Move c and q one position forward
        c.setLocation(q);
View Full Code Here

    // adjust corner for the inner path (formula found by experimenting)
    double zoomedCorner = (getPositionedContextButton().getCornerRadius() * zoom);
    int corner = (int) Math.max(1, zoomedCorner - (((shrinkLines - 1) * lw) + zoomedCorner / 64));

    Path path = new Path(null);
    path.moveTo(r.x, r.y);
    path.addArc(r.x, r.y, corner, corner, 90, 90);
    path.addArc(r.x, r.y + r.height - corner, corner, corner, 180, 90);
    path.addArc(r.x + r.width - corner, r.y + r.height - corner, corner, corner, 270, 90);
    path.addArc(r.x + r.width - corner, r.y, corner, corner, 0, 90);
    path.close();
View Full Code Here

      gc.setForegroundPattern(pattern);
    }

    // draw the shape
    Path path = new Path(device);
    path.moveTo(width / 2, 25);
    path.lineTo(2 * width / 3, height / 3);
    path.lineTo(width - 25, height / 2);
    path.lineTo(2 * width / 3, 2 * height / 3);
    path.lineTo(width / 2, height - 25);
    path.lineTo(width / 3, 2 * height / 3);
View Full Code Here

    path.dispose();
    gc.setTransform(null);

    // shape on right
    path = new Path(device);
    path.moveTo(3 * (width - 250) / 4 - 25 + 250, height / 2);
    path.lineTo(3 * (width - 250) / 4 + 50 + 250, height / 2 - 200);
    path.lineTo(3 * (width - 250) / 4 + 50 + 250, height / 2 + 50);
    path.lineTo(3 * (width - 250) / 4 - 25 + 250, height / 2 + 150);
    path.lineTo(3 * (width - 250) / 4 + 25 + 250, height / 2 + 50);
    if (closeButton.getSelection())
View Full Code Here

      return;
    Device device = gc.getDevice();

    // top triangle
    Path path = new Path(device);
    path.moveTo(width / 2, 0);
    path.lineTo(width / 2 + 100, 173);
    path.lineTo(width / 2 - 100, 173);
    path.lineTo(width / 2, 0);

    // bottom triangle
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.