Package java.awt.geom

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


        // gPath.lineTo(vec.x, vec.y);
        // System.out.println(i + " curveTo " + vec + " " + bc1.c1 + " "
        // + bc1.c2+ " " + bc2.c1 + " " + bc2.c2);
        //gPath.lineTo(nextVec.x, nextVec.y);

        gPath.curveTo(curVec.getControlPoint2().x,
            curVec.getControlPoint2().y,
            nextVec.getControlPoint1().x,
            nextVec.getControlPoint1().y, nextVec.x, nextVec.y);
      } else {
        // System.out.println(i + "lineTo " + vec );
View Full Code Here


     * Draw a line from specified source to specified destination
     */
    private void drawCurvedRelationship(double srcX, double srcY, double control1X, double control1Y, double control2X, double control2Y, double destX, double destY, Graphics g) {
      GeneralPath shape = new GeneralPath();
      shape.moveTo((float) srcX, (float) srcY);
      shape.curveTo((float) control1X, (float) control1Y, (float) control2X, (float) control2Y, (float) destX, (float) destY);
      g.setColor(RELATIONSHIP_NORMAL_COLOR);
      ((Graphics2D) g).draw(shape);
    }

    /**
 
View Full Code Here

            final float cv = (float)(4.0 / 3.0 * a * b / c);
            */
            final float cv = 0.5522848f;
            path.moveTo(x + hw, y);
            // Top right
            path.curveTo(x + hw + hw * cv, y, x + w, y + hh - hh * cv, x + w, y + hh);
            // Bottom right
            path.curveTo(x + w, y + hh + hh * cv, x + hw + hw * cv, y + h, x + hw, y + h);
            // Bottom left
            path.curveTo(x + hh - hh * cv, y + h, x, y + hh + hh * cv, x, y + hh);
            // Top left
View Full Code Here

            final float cv = 0.5522848f;
            path.moveTo(x + hw, y);
            // Top right
            path.curveTo(x + hw + hw * cv, y, x + w, y + hh - hh * cv, x + w, y + hh);
            // Bottom right
            path.curveTo(x + w, y + hh + hh * cv, x + hw + hw * cv, y + h, x + hw, y + h);
            // Bottom left
            path.curveTo(x + hh - hh * cv, y + h, x, y + hh + hh * cv, x, y + hh);
            // Top left
            path.curveTo(x, y + hh - hh * cv, x + hh - hh * cv, y, x + hw, y);
            return path;
View Full Code Here

            // Top right
            path.curveTo(x + hw + hw * cv, y, x + w, y + hh - hh * cv, x + w, y + hh);
            // Bottom right
            path.curveTo(x + w, y + hh + hh * cv, x + hw + hw * cv, y + h, x + hw, y + h);
            // Bottom left
            path.curveTo(x + hh - hh * cv, y + h, x, y + hh + hh * cv, x, y + hh);
            // Top left
            path.curveTo(x, y + hh - hh * cv, x + hh - hh * cv, y, x + hw, y);
            return path;
        }

View Full Code Here

            // Bottom right
            path.curveTo(x + w, y + hh + hh * cv, x + hw + hw * cv, y + h, x + hw, y + h);
            // Bottom left
            path.curveTo(x + hh - hh * cv, y + h, x, y + hh + hh * cv, x, y + hh);
            // Top left
            path.curveTo(x, y + hh - hh * cv, x + hh - hh * cv, y, x + hw, y);
            return path;
        }

        protected void draw(Graphics g, Shape shape, Color[] colors) {
            final float[] coords = new float[6];
View Full Code Here

    path.quadTo(1, 2, 3, 4);
    pt.setLocation(3, 4);
    harness.check(pt.equals(path.getCurrentPoint()));

    // Check 7
    path.curveTo(5, 6, 7, 8, 9, 10);
    pt.setLocation(9, 10);
    harness.check(pt.equals(path.getCurrentPoint()));

    // Check 8
    path.closePath();
View Full Code Here

    path.moveTo(1.1f, 1.2f);
    path.lineTo(2.1f, 2.2f);
    path.quadTo(3.1f, 3.2f, 4.1f, 4.2f);
    path.closePath();
    path.moveTo(5.1f, 5.2f);
    path.curveTo(6.1f, 6.2f, 7.1f, 7.2f, 8.1f, 8.2f);

  }


  private static final float EPSILON_F = 1e-6f;
View Full Code Here

    path.moveTo(10, 11);
    path.lineTo(20, 21);
    path.closePath();
    path.moveTo(30, 31);
    path.quadTo(40, 41, 42, 43);
    path.curveTo(50, 51, 52, 53, 54, 55);
   
    pit = path.getPathIterator(null);
    h.check(pit.getWindingRule(), PathIterator.WIND_EVEN_ODD); // 1
    h.check(!pit.isDone());                                    // 2
    h.check(pit.currentSegment(f), PathIterator.SEG_MOVETO);   // 3
View Full Code Here

    path.moveTo(10, 11);
    path.lineTo(20, 21);
    path.closePath();
    path.moveTo(30, 31);
    path.quadTo(40, 41, 42, 43);
    path.curveTo(50, 51, 52, 53, 54, 55);
   
    tx = new AffineTransform();
    tx.translate(2, 3);
    tx.scale(10, 10);
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.