Package org.eclipse.swt.graphics

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


    int d = radius << 1;

    path.addArc(l, t, d, d, -180, -90); // topleft
    path.lineTo(l + radius, t);
    path.lineTo(l + w, t);
    path.lineTo(l + w, t + h);
    path.lineTo(l, t + h);
    path.lineTo(l, t + radius);
    path.close();

    return path;
View Full Code Here


    path.addArc(l, t, d, d, -180, -90); // topleft
    path.lineTo(l + radius, t);
    path.lineTo(l + w, t);
    path.lineTo(l + w, t + h);
    path.lineTo(l, t + h);
    path.lineTo(l, t + radius);
    path.close();

    return path;
  }
View Full Code Here

    path.addArc(l, t, d, d, -180, -90); // topleft
    path.lineTo(l + radius, t);
    path.lineTo(l + w, t);
    path.lineTo(l + w, t + h);
    path.lineTo(l, t + h);
    path.lineTo(l, t + radius);
    path.close();

    return path;
  }
View Full Code Here

    int w = rectangle.width;
    int h = rectangle.height;
    int d = radius << 1;

    path.moveTo(l, t); // topleft
    path.lineTo(l + w - radius, t);
    path.addArc(l + w - d, t, d, d, -270, -90); // topright
    path.lineTo(l + w, t + radius);
    path.lineTo(l + w, t + h);
    path.lineTo(l, t + h);
    path.lineTo(l, t);
View Full Code Here

            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):
                    path.quadTo(coords[0], coords[1], coords[2], coords[3]);
                    break;
                case (PathIterator.SEG_CUBICTO):
View Full Code Here

            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):
                    path.quadTo(coords[0], coords[1], coords[2], coords[3]);
                    break;
                case (PathIterator.SEG_CUBICTO):
View Full Code Here

            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):
                    path.quadTo(coords[0], coords[1], coords[2], coords[3]);
                    break;
                case (PathIterator.SEG_CUBICTO):
View Full Code Here

      path.addArc(top.getBottomLeft().x, top.getBottomLeft().y - corner, corner, corner, 180, 90);
    } else if (hasAppendageTop) {
      // curved line around top(top-left) -> top(bottom-left)
      int appendageCorner = Math.min(corner, top.height * 2); // adjust for small sizes
      path.addArc(top.getTopLeft().x, top.getTopLeft().y, appendageCorner, appendageCorner, 90, 90);
      path.lineTo(top.getBottomLeft().x, top.getBottomLeft().y);
    } else { // !hasTop
      // curved line around right(top-left)
      path.addArc(right.getTopLeft().x, right.getTopLeft().y, corner, corner, 90, 90);
    }

View Full Code Here

      path.addArc(right.getBottomRight().x - corner, right.getBottomRight().y - corner, corner, corner, 270, 90);
      path.addArc(right.getTopRight().x - corner, right.getTopRight().y, corner, corner, 0, 90);
    } else if (hasAppendageRight) {
      // curved line around right(bottom-left) -> right(bottom-right)
      int appendageCorner = Math.min(corner, right.width * 2); // adjust for small sizes
      path.lineTo(right.getBottomLeft().x, right.getBottomLeft().y);
      path.addArc(right.getBottomRight().x - appendageCorner, right.getBottomRight().y - appendageCorner, appendageCorner,
          appendageCorner, 270, 90);
    } else { // !hasRight
      // close curved rectangle around top (bottom-right)
      path.addArc(top.getBottomRight().x - corner, top.getBottomRight().y - corner, corner, corner, 270, 90);
View Full Code Here

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

      // Idea for the closed bezier curve:
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.