Examples of curveTo()


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

     */
    public void testGeneralPathSerialization() {
        GeneralPath g1 = new GeneralPath();
        g1.moveTo(1.0f, 2.0f);
        g1.lineTo(3.0f, 4.0f);
        g1.curveTo(5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f);
        g1.quadTo(1.0f, 2.0f, 3.0f, 4.0f);
        g1.closePath();
        GeneralPath g2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
View Full Code Here

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

                            break;
                        case PathIterator.SEG_LINETO :
                            gp.lineTo(args[0], args[1]);
                            break;
                        case PathIterator.SEG_CUBICTO :
                            gp.curveTo(args[0], args[1], args[2],
                                    args[3], args[4], args[5]);
                            break;
                        case PathIterator.SEG_QUADTO :
                            gp.quadTo(args[0], args[1], args[2], args[3]);
                            break;
View Full Code Here

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

        g2.fillRect(0, 0, w, h);

        // create the curve shape
        GeneralPath curveShape = new GeneralPath(GeneralPath.WIND_NON_ZERO);
        curveShape.moveTo(0, h * .6f);
        curveShape.curveTo(w * .167f, h * 1.2f, w * .667f, h * -.5f, w,
                h * .75f);
        curveShape.lineTo(w, h);
        curveShape.lineTo(0, h);
        curveShape.lineTo(0, h * .8f);
        curveShape.closePath();
View Full Code Here

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

                                cp2Y = (float)( scaleY * ( vpY + mr.ElementAt( j*6+6 ).intValue()));

                                endX = (float)( scaleX * ( vpX + mr.ElementAt( j*6+7 ).intValue()));
                                endY = (float)( scaleY * ( vpY + mr.ElementAt( j*6+8 ).intValue()));

                                gp.curveTo( cp1X, cp1Y, cp2X, cp2Y, endX, endY );
                                _startX = endX;
                                _startY = endY;
                            }
                                //gp.closePath();
                            g2.setStroke( solid );
View Full Code Here

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

                                cp2Y = (float)( scaleY * ( vpY + mr.ElementAt( j*6+6 ).intValue()));

                                endX = (float)( scaleX * ( vpX + mr.ElementAt( j*6+7 ).intValue()));
                                endY = (float)( scaleY * ( vpY + mr.ElementAt( j*6+8 ).intValue()));

                                gp.curveTo( cp1X, cp1Y, cp2X, cp2Y, endX, endY );
                                _startX = endX;
                                _startY = endY;
                            }
                                //gp.closePath();
                            g2.setStroke( solid );
View Full Code Here

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

                                break;
                            case java.awt.geom.PathIterator.SEG_QUADTO:
                                s.quadTo(coords[0], coords[1], coords[2], coords[3]);
                                break;
                            case java.awt.geom.PathIterator.SEG_CUBICTO:
                                s.curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]);
                                break;
                            }
                        }
                        break;
                    }
View Full Code Here

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

            final float y1 = in.readFloat();
            final float x2 = in.readFloat();
            final float y2 = in.readFloat();
            final float x3 = in.readFloat();
            final float y3 = in.readFloat();
            gp.curveTo(x1, y1, x2, y2, x3, y3);
            break;
          }
        case PathIterator.SEG_CLOSE:
          {
            break;
View Full Code Here

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

          path.closePath();
          break;
        }
        case PathIterator.SEG_CUBICTO:
        {
          path.curveTo(segments[i].getX1(), segments[i].getY1(),
              segments[i].getX2(), segments[i].getY2(),
              segments[i].getX3(), segments[i].getY3());
          break;
        }
        case PathIterator.SEG_LINETO:
View Full Code Here

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

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

     * 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
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.