Package java.awt.geom

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


      for (int i = 0; i < 6; i++)
    coordinates[i] = in.readFloat();

      switch (segmentType) {
    case PathIterator.SEG_MOVETO:
        path.moveTo(coordinates[0], coordinates[1]);
                  break;

        case PathIterator.SEG_LINETO:
        path.lineTo(coordinates[0], coordinates[1]);
              break;
View Full Code Here


            Point2D ur = crop.getUpperRight();
            Point2D ll = crop.getLowerLeft();
            Point2D lr = crop.getLowerRight();

            GeneralPath path = new GeneralPath();
            path.moveTo((float) ul.getX(), (float) ul.getY());
            path.lineTo((float) ur.getX(), (float) ur.getY());
            path.lineTo((float) lr.getX(), (float) lr.getY());
            path.lineTo((float) ll.getX(), (float) ll.getY());
            path.closePath();
View Full Code Here

        Point2D ur = crop.getUpperRight();
        Point2D ll = crop.getLowerLeft();
        Point2D lr = crop.getLowerRight();

        GeneralPath path = new GeneralPath();
        path.moveTo((float) ul.getX(), (float) ul.getY());
        path.lineTo((float) ur.getX(), (float) ur.getY());
        path.lineTo((float) lr.getX(), (float) lr.getY());
        path.lineTo((float) ll.getX(), (float) ll.getY());
        path.closePath();
View Full Code Here

                int zeroY = s.yscale(0);
                float xstep = (width+1) / numBins;

                GeneralPath gp = new GeneralPath();

                gp.moveTo(minx, zeroY);
                float lastx = minx;
                float lasty = zeroY;
                for (int i = 0; i < numBins; i++) {
                    int y = s.yscale(bins[c][i]);
                    float x = xstep * i + minx;
View Full Code Here

        float[] start = new float[6];
        ne.getPathIterator(null).currentSegment(start);

        GeneralPath path = new GeneralPath();
        path.moveTo(start[0], start[1]);
        path.append(ne, true);
        path.append(sw, true);
        path.closePath();

        shape = path;
View Full Code Here

            x, y, Color.GREEN, x + 50, y, Color.WHITE);
        g2.setPaint(gradient);
        int[] xcoords = { x + 25, x, x + 50 };
        int[] ycoords = { y, y + 50, y + 50 };
        GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
        polygon.moveTo(x + 25, y);
        for (int i = 0; i < xcoords.length; i++)
        {
            polygon.lineTo(xcoords[i], ycoords[i]);
        }
        polygon.closePath();
View Full Code Here

                x, y, Color.GREEN, x + 50, y, Color.WHITE);
            g2.setPaint(gradient);
            int[] xcoords = { x + 25, x, x + 50 };
            int[] ycoords = { y, y + 50, y + 50 };
            GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
            polygon.moveTo(x + 25, y);
            for (int i = 0; i < xcoords.length; i++)
            {
                polygon.lineTo(xcoords[i], ycoords[i]);
            }
            polygon.closePath();
View Full Code Here

                x, y, Color.YELLOW, x + 50, y, Color.WHITE);
            g2.setPaint(gradient);
            int[] xcoords = { x + 10, x, x + 50, x + 40 };
            int[] ycoords = { y, y + 50, y + 50, y };
            GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, xcoords.length);
            polygon.moveTo(x + 25, y);
            for (int i = 0; i < xcoords.length; i++)
            {
                polygon.lineTo(xcoords[i], ycoords[i]);
            }
            polygon.closePath();
View Full Code Here

  private GeneralPath toShape(LineString lineString)
  {
    GeneralPath shape = new GeneralPath();
    Point2D viewPoint = toPoint(lineString.getCoordinateN(0));
    shape.moveTo((float) viewPoint.getX(), (float) viewPoint.getY());

    for (int i = 1; i < lineString.getNumPoints(); i++) {
      viewPoint = toPoint(lineString.getCoordinateN(i));
      shape.lineTo((float) viewPoint.getX(), (float) viewPoint.getY());
    }
View Full Code Here

    /**
     * Some checks for the serialization of a GeneralPath instance.
     */
    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;
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.