Package java.awt

Examples of java.awt.Polygon.addPoint()


        //}

      // Add the polygon
      polygon = new Polygon();
      polygon.addPoint((int) left[0][0], (int) left[0][1]);
      polygon.addPoint((int) left[1][0], (int) left[1][1]);
      polygon.addPoint((int) right[1][0], (int) right[1][1]);
      polygon.addPoint((int) right[0][0], (int) right[0][1]);
      this.polygons.add(polygon);

      // Remember current left/right points
View Full Code Here


      // Add the polygon
      polygon = new Polygon();
      polygon.addPoint((int) left[0][0], (int) left[0][1]);
      polygon.addPoint((int) left[1][0], (int) left[1][1]);
      polygon.addPoint((int) right[1][0], (int) right[1][1]);
      polygon.addPoint((int) right[0][0], (int) right[0][1]);
      this.polygons.add(polygon);

      // Remember current left/right points
      left[1] = left[0];
View Full Code Here

      // Add the polygon
      polygon = new Polygon();
      polygon.addPoint((int) left[0][0], (int) left[0][1]);
      polygon.addPoint((int) left[1][0], (int) left[1][1]);
      polygon.addPoint((int) right[1][0], (int) right[1][1]);
      polygon.addPoint((int) right[0][0], (int) right[0][1]);
      this.polygons.add(polygon);

      // Remember current left/right points
      left[1] = left[0];
      right[1] = right[0];
View Full Code Here

    Vector2D.vector(p[3], p[0][0], p[0][1], p[1][0], p[1][1]);
    projectEdges(p, left, right);
   
    // Add the last polygon
    polygon = new Polygon();
    polygon.addPoint((int) left[0][0], (int) left[0][1]);
    polygon.addPoint((int) left[1][0], (int) left[1][1]);
    polygon.addPoint((int) right[1][0], (int) right[1][1]);
    polygon.addPoint((int) right[0][0], (int) right[0][1]);
    this.polygons.add(polygon);
   
View Full Code Here

    projectEdges(p, left, right);
   
    // Add the last polygon
    polygon = new Polygon();
    polygon.addPoint((int) left[0][0], (int) left[0][1]);
    polygon.addPoint((int) left[1][0], (int) left[1][1]);
    polygon.addPoint((int) right[1][0], (int) right[1][1]);
    polygon.addPoint((int) right[0][0], (int) right[0][1]);
    this.polygons.add(polygon);
   
    return -1;
View Full Code Here

   
    // Add the last polygon
    polygon = new Polygon();
    polygon.addPoint((int) left[0][0], (int) left[0][1]);
    polygon.addPoint((int) left[1][0], (int) left[1][1]);
    polygon.addPoint((int) right[1][0], (int) right[1][1]);
    polygon.addPoint((int) right[0][0], (int) right[0][1]);
    this.polygons.add(polygon);
   
    return -1;
  }
View Full Code Here

    // Add the last polygon
    polygon = new Polygon();
    polygon.addPoint((int) left[0][0], (int) left[0][1]);
    polygon.addPoint((int) left[1][0], (int) left[1][1]);
    polygon.addPoint((int) right[1][0], (int) right[1][1]);
    polygon.addPoint((int) right[0][0], (int) right[0][1]);
    this.polygons.add(polygon);
   
    return -1;
  }
 
View Full Code Here

            Cubic[] X = calcNaturalCubic(pts.npoints - 1, pts.xpoints);
            Cubic[] Y = calcNaturalCubic(pts.npoints - 1, pts.ypoints);
             // very crude technique - just break each segment up into steps lines
            int x = (int) Math.round(X[0].eval(0));
            int y = (int) Math.round(Y[0].eval(0));
            p.addPoint(x, boundY(y));
            for (int i = 0; i < X.length; i++)
            {
                for (int j = 1; j <= STEPS; j++)
                {
                    float u = j / (float) STEPS;
View Full Code Here

                for (int j = 1; j <= STEPS; j++)
                {
                    float u = j / (float) STEPS;
                    x = Math.round(X[i].eval(u));
                    y = Math.round(Y[i].eval(u));
                    p.addPoint(x, boundY(y));
                }
            }
        }
        return p;
    }
View Full Code Here

    private void drawArrow(Graphics g, int ascent, int x, int y) {
        Polygon arrow = new Polygon();
        int dx = x;
        y += ascent - 10;
        int dy = y;
        arrow.addPoint(dx, dy + 3);
        arrow.addPoint(dx + 5, dy + 3);
        for (x = dx + 5; x <= dx + 10; x++, y++) {
            arrow.addPoint(x, y);
        }
        for (x = dx + 9; x >= dx + 5; x--, 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.