Package java.awt

Examples of java.awt.Polygon$PolygonPathIterator


   * @see Graphics#drawPolygon(int[], int[], int)
   */
  public void fillPolygon(final int[] xPoints, final int[] yPoints,
                          final int nPoints)
  {
    parent.fill(new Polygon(xPoints, yPoints, nPoints));
  }
View Full Code Here


      final int sideLength = (int) (8 * 1.0);
      final int sideStrength = (int) (5 * 1.0);
      final double aDir = Math.atan2(x - xChild, y - yChild);

      // create new polygon for arrow head...
      final Polygon tmpPoly = new Polygon();
      // add arrow tip as point...
      tmpPoly.addPoint(xChild, yChild);
      // add one edge as point...
      tmpPoly.addPoint(xChild + xCor(sideLength, aDir + 0.5), yChild + yCor(sideLength, aDir + 0.5));
      // add between the edges as point...
      tmpPoly.addPoint(xChild + xCor(sideStrength, aDir), yChild + yCor(sideStrength, aDir));
      // add other edge as point...
      tmpPoly.addPoint(xChild + xCor(sideLength, aDir - 0.5), yChild + yCor(sideLength, aDir - 0.5));
      // add arrow tip as point...
      tmpPoly.addPoint(xChild, yChild);

      g.drawPolygon(tmpPoly); // draw the arrow head
      g.fillPolygon(tmpPoly); // fill the arrow head
    }
  }
View Full Code Here

    /**
     * @see Graphics#drawPolygon(int[], int[], int)
     */
    @Override
    public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
        Polygon poly = new Polygon(xPoints, yPoints, nPoints);
        draw(poly);
    }
View Full Code Here

    /**
     * @see Graphics#fillPolygon(int[], int[], int)
     */
    @Override
    public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
        Polygon poly = new Polygon();
        for (int i = 0; i < nPoints; i++) {
            poly.addPoint(xPoints[i], yPoints[i]);
        }
        fill(poly);
    }
View Full Code Here

        0,
        GfrShpDiamond._INT_SIZE_,
        0,
      };
     
      return new Polygon(intsX, intsY, intsX.length);
  
View Full Code Here

        -GfrShpTriangle._INT_SIZE_,
        GfrShpTriangle._INT_SIZE_,
        GfrShpTriangle._INT_SIZE_
      };
     
      return new Polygon(intsX, intsY, intsX.length);
  
View Full Code Here

    private Polygon shape;

    public boolean[] pointSelected;

    public Poly(int[] x, int[] y, int num) {
  this.shape = new Polygon(x, y, num);
  this.numPoints = num;
  this.pointSelected = new boolean[1];
  this.pointSelected[0] = false;
    }
View Full Code Here

  int[] yPoints = ((Polygon) (this.shape)).ypoints;
  for (int i = 0; i < this.numPoints; i++) {
      this.shape.xpoints[i] += moveX;
      this.shape.ypoints[i] += moveY;
  }
  this.shape = new Polygon(xPoints, yPoints, this.shape.npoints);
    }
View Full Code Here

  for (int j = 0; j < i.length; j++) {
      xPoints[i[j]] += moveX;
      yPoints[i[j]] += moveY;
  }

  this.shape = new Polygon(xPoints, yPoints, this.shape.npoints);
    }
View Full Code Here

      }
      pointSelected = new boolean[numPoints];
      for (int i = 0; i < numPoints; i++) {
    pointSelected[i] = false;
      }
      this.shape = new Polygon(xPoints, yPoints, numPoints);
  } else {
      JOptionPane.showMessageDialog(parent,
        "Polygons Must Have At Least Three Points");
      numPoints += numSelected;
  }
View Full Code Here

TOP

Related Classes of java.awt.Polygon$PolygonPathIterator

Copyright © 2018 www.massapicom. 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.