Package org.eclipse.swt.graphics

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


            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


        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) {
       double v0[] = {x1, y1, 0};
View Full Code Here

            // Calculate gap/2
            int offset = Math.max(1, g.getFontHeight());

            // End first segment before mid-point
            Point p = offset(current, next, -offset);
            path.lineTo(p.x, p.y);
            paths.add(path);

            // Create second segment
            path = new Path(display);
View Full Code Here

            path.moveTo(p.x, p.y);

        }

        // Close path
        path.lineTo(next.x, next.y + (bold ? 0 : lw));
        paths.add(path);
        lines.add(new Line(paths, bold ? 2 * lw : lw));

        // Finished
        return gap ? offset(current, next, 0) : next;
View Full Code Here

            // Calculate gap/2
            int offset = Math.max(1, g.getFontHeight());

            // End first segment before mid-point
            Point p = offset(current, next, -offset);
            path.lineTo(p.x, p.y);
            paths.add(path);

            // Create second segment
            path = new Path(display);
View Full Code Here

            path.moveTo(p.x, p.y);

        }

        // Close path
        path.lineTo(next.x - (bold ? 2 * lw : lw), next.y);
        paths.add(path);
        lines.add(new Line(paths, bold ? 2 * lw : lw));

        // Finished
        return gap ? offset(current, next, 0) : next;
View Full Code Here

            switch( result ) {
            case PathIterator.SEG_CLOSE:
                path.close();
                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:
View Full Code Here

          final int x = (int) ((lon.getVal() - cm.getLon()) / cm.getLonInc());
          final int y = (int) ((cm.getLat() - lat.getVal()) / cm.getLatInc());
          if (first)
            path.moveTo(x, y);
          else
            path.lineTo(x, y);
          first = false;
        }
        gc.setForeground(black);
        gc.setLineWidth(5);
        gc.drawPath(path);
View Full Code Here

    int w = rectangle.width;
    int h = rectangle.height;
    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();
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.