Package java.awt

Examples of java.awt.Polygon.addPoint()


  public void drawPolygon(final int[] xPoints, final int[] yPoints, final int nPoints)
  {
    final Polygon poly = new Polygon();
    for (int i = 0; i < nPoints; i++)
    {
      poly.addPoint(xPoints[i], yPoints[i]);
    }
    draw(poly);
  }

  /**
 
View Full Code Here


  public void fillPolygon(final int[] xPoints, final int[] yPoints, final int nPoints)
  {
    final Polygon poly = new Polygon();
    for (int i = 0; i < nPoints; i++)
    {
      poly.addPoint(xPoints[i], yPoints[i]);
    }
    fill(poly);
  }

  /**
 
View Full Code Here

            /*
             * very crude technique just break each segment up into
             * steps lines
             */
            Polygon p = new Polygon();
            p.addPoint((int) Math.round(X[0].eval(0)),
                    (int) Math.round(Y[0].eval(0)));
            for (int i = 0; i < X.length; i++) {
                for (int j = 1; j <= steps; j++) {
                    float u = j / (float) steps;
                    p.addPoint(Math.round(X[i].eval(u)),
View Full Code Here

            p.addPoint((int) Math.round(X[0].eval(0)),
                    (int) Math.round(Y[0].eval(0)));
            for (int i = 0; i < X.length; i++) {
                for (int j = 1; j <= steps; j++) {
                    float u = j / (float) steps;
                    p.addPoint(Math.round(X[i].eval(u)),
                            Math.round(Y[i].eval(u)));
                }
            }

            // copy polygon points to the return array
View Full Code Here

            /*
             * very crude technique just break each segment up into
             * steps lines
             */
            Polygon p = new Polygon();
            p.addPoint((int) Math.round(X[0].eval(0)),
                    (int) Math.round(Y[0].eval(0)));
            for (int i = 0; i < X.length; i++) {
                for (int j = 1; j <= steps; j++) {
                    float u = j / (float) steps;
                    p.addPoint(Math.round(X[i].eval(u)),
View Full Code Here

            p.addPoint((int) Math.round(X[0].eval(0)),
                    (int) Math.round(Y[0].eval(0)));
            for (int i = 0; i < X.length; i++) {
                for (int j = 1; j <= steps; j++) {
                    float u = j / (float) steps;
                    p.addPoint(Math.round(X[i].eval(u)),
                            Math.round(Y[i].eval(u)));
                }
            }

            res = new float[p.npoints * 2];
 
View Full Code Here

    Polygon polygon = new Polygon();
   
    int i;
    for (i = 0; i < coordinates.length - 2; i += 2)
    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }
    if (coordinates[i] != coordinates[0] || coordinates[i + 1] != coordinates[1])
    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }
View Full Code Here

    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }
    if (coordinates[i] != coordinates[0] || coordinates[i + 1] != coordinates[1])
    {
      polygon.addPoint(coordinates[i], coordinates[i + 1]);
    }

    return polygon;
  }
 
View Full Code Here

    g2d.setColor(fillColor);
    g2d.fillRoundRect(BUBBLE_OFFSET + 1, 1, width - 2, height - 2, ARC_DIAMETER, ARC_DIAMETER);
   
    // The bubble handle
    final Polygon p = new Polygon();
    p.addPoint(BUBBLE_OFFSET + 1, MARGIN_WIDTH + 1);
    p.addPoint(0, LINE_HEIGHT);
    p.addPoint(BUBBLE_OFFSET + 1, LINE_HEIGHT / 2 + MARGIN_WIDTH);
    g2d.fillPolygon(p);
   
    g2d.setColor(outLineColor);
View Full Code Here

    g2d.fillRoundRect(BUBBLE_OFFSET + 1, 1, width - 2, height - 2, ARC_DIAMETER, ARC_DIAMETER);
   
    // The bubble handle
    final Polygon p = new Polygon();
    p.addPoint(BUBBLE_OFFSET + 1, MARGIN_WIDTH + 1);
    p.addPoint(0, LINE_HEIGHT);
    p.addPoint(BUBBLE_OFFSET + 1, LINE_HEIGHT / 2 + MARGIN_WIDTH);
    g2d.fillPolygon(p);
   
    g2d.setColor(outLineColor);
    g2d.drawLine(0, LINE_HEIGHT, BUBBLE_OFFSET, MARGIN_WIDTH + 1);
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.