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


        ex /= abs_e;
        ey /= abs_e;

        // Creating arrowhead
        Path arrowHead = new Path(gc.getDevice());
        arrowHead.moveTo(endx, endy);       
        arrowHead.lineTo(endx + (ey-ex)*adjSize, endy - (ex + ey)*adjSize);
        arrowHead.moveTo(endx, endy);
        arrowHead.lineTo(endx - (ey + ex)*adjSize, endy + (ex - ey)*adjSize);
        gc.drawPath(arrowHead);
    }
View Full Code Here

        // Creating arrowhead
        Path arrowHead = new Path(gc.getDevice());
        arrowHead.moveTo(endx, endy);       
        arrowHead.lineTo(endx + (ey-ex)*adjSize, endy - (ex + ey)*adjSize);
        arrowHead.moveTo(endx, endy);
        arrowHead.lineTo(endx - (ey + ex)*adjSize, endy + (ex - ey)*adjSize);
        gc.drawPath(arrowHead);
    }

    private double[] computeCrossProduct (double x1, double  y1, double x2, double y2) {
View Full Code Here

    if (debug)
      System.err.println("endShape1:" + r.size());
    TypedPoint q = r.get(0);
    if (q.curved != TypedPoint.kind.CURVED)
      r.remove(0);
    p.moveTo((float) q.x, (float) q.y);
    if (debug)
      System.err.println("q=(" + q.x + "," + q.y + " " + q.curved + ")");
    if (arg0 == CLOSE) {
      r.add(new TypedPoint(q.x, q.y, TypedPoint.kind.NORMAL));
    }
View Full Code Here

        // Create first segment
        Path path = new Path(display);

        // Move to last point
        path.moveTo(current.x, current.y - (bold ? 2 * lw : lw));

        // Insert gap?
        if (gap) {

            // Calculate gap/2
View Full Code Here

            // Create second segment
            path = new Path(display);

            // Move past mid-point
            p = offset(current, next, offset);
            path.moveTo(p.x, p.y);

        }

        // Close path
        path.lineTo(next.x, next.y + (bold ? 0 : lw));
View Full Code Here

        // Create first segment
        Path path = new Path(display);

        // Move to last point
        path.moveTo(current.x, current.y);

        // Insert gap?
        if (gap) {

            // Calculate gap/2
View Full Code Here

            // Create second segment
            path = new Path(display);

            // Move past mid-point
            p = offset(current, next, offset);
            path.moveTo(p.x, p.y);

        }

        // Close path
        path.lineTo(next.x - (bold ? 2 * lw : lw), next.y);
View Full Code Here

                break;
            case PathIterator.SEG_LINETO:
                path.lineTo(current[0], current[1]);
                break;
            case PathIterator.SEG_MOVETO:
                path.moveTo(current[0], current[1]);
                break;
            case PathIterator.SEG_QUADTO:
                path.quadTo(current[0],   current[1],  current[2],
                         current[3]);
                break;
View Full Code Here

    else {
      int width = p2.x - p1.x;

      // Ersetzen der Kurven unten? Versuch!
      Path path = new Path(SwtConsts.display);
      path.moveTo(p1.x, p1.y);
      path.cubicTo(p1.x + width / 2, p1.y, p2.x - width / 2, p2.y, p2.x, p2.y);
      gc.drawPath(path);
      path.dispose();
    }
  }
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.