Package java.awt.geom

Examples of java.awt.geom.GeneralPath.quadTo()


    public void createBasicFigure() {
        FigureLayer layer = graphicsPane.getForegroundLayer();
        GeneralPath path = new GeneralPath();
        path.moveTo(120, 240);
        path.lineTo(240, 240);
        path.quadTo(180, 120, 120, 240);
        path.closePath();

        Figure semi = new BasicFigure(path, Color.green);
        layer.add(semi);
    }
View Full Code Here


    // Fill background
    GeneralPath clipTop = new GeneralPath();
    clipTop.moveTo(0, 0);
    clipTop.lineTo(width, 0);
    clipTop.lineTo(width, height / 2);
    clipTop.quadTo(width / 2, height / 4, 0, height / 2);
    clipTop.lineTo(0, 0);

    rgraphics.setClip(clipTop);
    LinearGradientPaint gradientTop = new LinearGradientPaint(0, 0, width,
        0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] {
View Full Code Here

    GeneralPath clipBottom = new GeneralPath();
    clipBottom.moveTo(0, height);
    clipBottom.lineTo(width, height);
    clipBottom.lineTo(width, height / 2);
    clipBottom.quadTo(width / 2, height / 4, 0, height / 2);
    clipBottom.lineTo(0, height);

    rgraphics.setClip(clipBottom);
    LinearGradientPaint gradientBottom = new LinearGradientPaint(0, 0,
        width, 0, new float[] { 0.0f, 0.5f, 1.0f }, new Color[] {
View Full Code Here

    rgraphics.setPaint(gradientBottom);
    rgraphics.fillRect(0, 0, width, height);

    GeneralPath mid = new GeneralPath();
    mid.moveTo(width, height / 2);
    mid.quadTo(width / 2, height / 4, 0, height / 2);
    // rgraphics.setClip(new Rectangle(0, 0, width / 2, height));
    // rgraphics
    // .setClip(new Rectangle(width / 2, 0, width - width / 2, height));
    rgraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
View Full Code Here

        System.out.println("Point at 3000 = " + pl.pointAtLength(3000f));

        path = new GeneralPath();
        path.moveTo(100f, 100f);
        path.lineTo(200f, 150f);
        path.quadTo(450f, 525f, 400f, 250f);
        path.closePath();
        pl = new PathLength(path);

        System.out.println("Path Length = " + pl.lengthOfPath());
        System.out.println("Point at 0 = " + pl.pointAtLength(0f));
View Full Code Here

        System.out.println("Point at 300 = " + pl.pointAtLength(300f));

        path = new GeneralPath();
        path.moveTo(100f, 100f);
        path.lineTo(200f, 150f);
        path.quadTo(450f, 525f, 400f, 250f);
        path.lineTo(300f, 200f);
        path.closePath();

        pl = new PathLength(path);
        System.out.println("Path Length = " + pl.lengthOfPath());
View Full Code Here

    public void render(int w, int h, Graphics2D g2) {
        GeneralPath p = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        p.moveTo(w*.2f, h*.25f);
        p.curveTo(w*.4f, h*.5f, w*.6f, 0.0f, w*.8f, h*.25f);
        p.moveTo(w*.2f, h*.6f);
        p.quadTo(w*.5f, h*1.0f, w*.8f, h*.6f);
        g2.setColor(LIGHT_GRAY);
        g2.fill(p);
        g2.setColor(BLACK);
        g2.draw(p);
        g2.drawString("curveTo", (int) (w*.2), (int) (h*.25f)-5);
 
View Full Code Here

          double ny2 = dy * Math.min(arcSize, dist / 2) / dist;

          double x2 = tmp.getX() + nx2;
          double y2 = tmp.getY() + ny2;

          path.quadTo((float) tmp.getX(), (float) tmp.getY(),
              (float) x2, (float) y2);
          tmp = new mxPoint(x2, y2);
        }
        else
        {
View Full Code Here

     */
    public static Shape createSwatchShape() {
        if (jdk12beta4()) {
            GeneralPath p = new GeneralPath();
            p.moveTo(10, 30);
            p.quadTo(30, 10, 85, 15);

            Stroke str = new BasicStroke(35, BasicStroke.CAP_BUTT,
                    BasicStroke.JOIN_ROUND);

            Shape s = str.createStrokedShape(p);
View Full Code Here

            if (point.onCurve && !nextPoint1.onCurve && nextPoint2.onCurve)
            {
                if (nextPoint1.endOfContour)
                {
                    // use the starting point as end point
                    path.quadTo(nextPoint1.x, nextPoint1.y, startingPoint.x, startingPoint.y);
                }
                else
                {
                    path.quadTo(nextPoint1.x, nextPoint1.y, nextPoint2.x, nextPoint2.y);
                }
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.