Package java.awt

Examples of java.awt.Polygon.addPoint()


    p.reset();
    p.addPoint(x + width, y);
    p.addPoint(x + width, y + height);
    p.addPoint(x, y + height);
    p.addPoint(x + borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + borderWidth);
    g.setClip(p);
    g.clipRect(oldClip.x, oldClip.y, oldClip.width, oldClip.height);
   
    // Bottom border. More than one y coordinate may be needed in case the
View Full Code Here


    p.addPoint(x + width, y);
    p.addPoint(x + width, y + height);
    p.addPoint(x, y + height);
    p.addPoint(x + borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + height - borderWidth);
    p.addPoint(x + width - borderWidth, y + borderWidth);
    g.setClip(p);
    g.clipRect(oldClip.x, oldClip.y, oldClip.width, oldClip.height);
   
    // Bottom border. More than one y coordinate may be needed in case the
    // tile border coincides to be inside the bottom border.
View Full Code Here

            String p[] = split(s);
            int max = Integer.parseInt(p[0]);
            Polygon pol = new Polygon();
            for (int i = 0; i != max; i++) {
                pol.addPoint(translate(p[i * 2 + 1]), translate(p[i * 2 + 2]));
            }

            p = split(readLine().trim());
            max = Integer.parseInt(p[0]);
            Polygon pol2 = new Polygon();
View Full Code Here

            p = split(readLine().trim());
            max = Integer.parseInt(p[0]);
            Polygon pol2 = new Polygon();
            for (int i = 0; i != max; i++) {
                pol2.addPoint(translate(p[i * 2 + 1]), translate(p[i * 2 + 2]));
            }

            Area a = new Area(pol);
            a.exclusiveOr(new Area(pol2));
            double z = calculateArea(a);
View Full Code Here

            Polygon pol = new Polygon();
  for(int i=0;i!=max;i++) {
    s = readLine().trim();
    String p[] = split(s);
    pol.addPoint(translate(p[0]),translate(p[1]));
  }

            Area a = new Area(pol);
            double z = calculateArea(a);
    z /= 10000;
View Full Code Here

    Vector2f v2 = pts[1];
    Vector2f v3 = pts[2];
    Vector2f v4 = pts[3];
   
    Polygon pol = new Polygon();
    pol.addPoint((int) v1.x,(int) v1.y);
    pol.addPoint((int) v2.x,(int) v2.y);
    pol.addPoint((int) v3.x,(int) v3.y);
    pol.addPoint((int) v4.x,(int) v4.y);
   
    if (fill) {
View Full Code Here

    Vector2f v3 = pts[2];
    Vector2f v4 = pts[3];
   
    Polygon pol = new Polygon();
    pol.addPoint((int) v1.x,(int) v1.y);
    pol.addPoint((int) v2.x,(int) v2.y);
    pol.addPoint((int) v3.x,(int) v3.y);
    pol.addPoint((int) v4.x,(int) v4.y);
   
    if (fill) {
      g.fill(pol);
View Full Code Here

    Vector2f v4 = pts[3];
   
    Polygon pol = new Polygon();
    pol.addPoint((int) v1.x,(int) v1.y);
    pol.addPoint((int) v2.x,(int) v2.y);
    pol.addPoint((int) v3.x,(int) v3.y);
    pol.addPoint((int) v4.x,(int) v4.y);
   
    if (fill) {
      g.fill(pol);
    } else {
View Full Code Here

   
    Polygon pol = new Polygon();
    pol.addPoint((int) v1.x,(int) v1.y);
    pol.addPoint((int) v2.x,(int) v2.y);
    pol.addPoint((int) v3.x,(int) v3.y);
    pol.addPoint((int) v4.x,(int) v4.y);
   
    if (fill) {
      g.fill(pol);
    } else {
      g.draw(pol);
View Full Code Here

        //  return i;
        //}

      // 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);
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.