Package java.awt

Examples of java.awt.Polygon


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


                            t.getDouble(),
                            t.getDouble(),
                            t.getDouble());
                } else
                if (t.findString("polygon(")) {
                    shape = new Polygon();
                    try {
                        while(true) {
                            ((Polygon)shape).addPoint((int)t.getDouble(), (int)t.getDouble());
                        }
                    } catch(IOException e) {
View Full Code Here

        draw(new Ellipse2D.Float(x, y, width, height));
    }

    @Override
    public void drawPolygon(int[] xpoints, int[] ypoints, int npoints) {
        draw(new Polygon(xpoints, ypoints, npoints));
    }
View Full Code Here

        fill(new Ellipse2D.Float(x, y, width, height));
    }

    @Override
    public void fillPolygon(int[] xpoints, int[] ypoints, int npoints) {
        fill(new Polygon(xpoints, ypoints, npoints));
    }
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++) {
            arrow.addPoint(x, y);
        }
        arrow.addPoint(dx + 5, dy + 7);
        arrow.addPoint(dx, dy + 7);

        g.setColor(Color.red);
        g.fillPolygon(arrow);
        g.setColor(Color.black);
        g.drawPolygon(arrow);
View Full Code Here

                // Now translate the current y values.
                double yy0 = rangeAxis.valueToJava2D(y0, dataArea, location);

                if (pass == 0) {
                    // left half
                    Polygon p = new Polygon();
                    p.addPoint((int) xx0, (int) yy0);
                    p.addPoint((int) (xx0+xx1)/2, (int) (yy0+yy1)/2);
                    p.addPoint((int) (xx0+xx1)/2, (int) (previousHeightxx0+previousHeightxx1)/2);
                    p.addPoint((int) xx0, (int) previousHeightxx0);

                    g2.setPaint(getItemPaint(row, column-1));
                    g2.setStroke(getItemStroke(row, column-1));
                    g2.fill(p);

                    if (entities != null)
                        addItemEntity(entities, dataset, row, column-1, p);

                    // right half
                    p = new Polygon();
                    p.addPoint((int) xx1, (int) yy1);
                    p.addPoint((int) (xx0+xx1)/2, (int) (yy0+yy1)/2);
                    p.addPoint((int) (xx0+xx1)/2, (int) (previousHeightxx0+previousHeightxx1)/2);
                    p.addPoint((int) xx1, (int) previousHeightxx1);

                    g2.setPaint(getItemPaint(row, column));
                    g2.setStroke(getItemStroke(row, column));
                    g2.fill(p);
View Full Code Here

   */
  public void replay(final WmfFile file)
  {
    final Graphics2D graph = file.getGraphics2D();

    final Polygon polygon = new Polygon(getScaledPointsX(), getScaledPointsY(), getPointCount());
    final MfDcState state = file.getCurrentState();

    if (state.getLogBrush().isVisible())
    {
      state.preparePaint();
View Full Code Here

    final GeneralPath genPath = new GeneralPath();
    for (int i = 0; i < polycount; i++)
    {
      final int[] pointsX = getScaledPointsX(i);
      final int[] pointsY = getScaledPointsY(i);
      final Polygon polygon = new Polygon(pointsX, pointsY, pointsX.length);

      genPath.append(polygon, false);
    }

    if (state.getLogBrush().isVisible())
View Full Code Here

   * @see java.awt.Graphics#fillPolygon
   * @see java.awt.Graphics#drawPolyline
   */
  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

   * @param nPoints a the total number of points.
   * @see java.awt.Graphics#drawPolygon(int[], int[], int)
   */
  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

TOP

Related Classes of java.awt.Polygon

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.