@Override public Dimension render(Graphics2D graphics) { //Construct the arc Arc2D.Float arc = new Arc2D.Float(Arc2D.PIE); arc.setAngleStart(90); arc.setAngleExtent(progress * 360); arc.setFrame(position.getX() - diameter / 2, position.getY() - diameter / 2, diameter, diameter); //Draw the inside of the arc graphics.setColor(fill); graphics.fill(arc); //Draw the outlines of the arc graphics.setStroke(stroke); graphics.setColor(borderColor); graphics.drawOval(position.getX() - diameter / 2, position.getY() - diameter / 2, diameter, diameter); return new Dimension(diameter, diameter); }
protected static final Arc2D.Float ARC = new Arc2D.Float(); protected static final Rectangle2D.Float RECT = new Rectangle2D.Float(); protected static final Line2D.Float LINE = new Line2D.Float();
protected static final Arc2D.Float ARC = new Arc2D.Float(); protected static final Rectangle2D.Float RECT = new Rectangle2D.Float(); protected static final Line2D.Float LINE = new Line2D.Float();
slice.append(new Arc2D.Float(bounds, (float)Math.toDegrees(start), (float)Math.toDegrees(fracToRad(1, d)), Arc2D.OPEN), true);
g.draw(new Arc2D.Float(x0 - ra, y0 - ra, // box upper left 2 * ra, 2 * ra, // box width and height
g2d.fill(new Arc2D.Float(x, y, radius, radius, start, extent, Arc2D.PIE)); g2d.setColor(Color.YELLOW); g2d.draw(new Arc2D.Float(x, y, radius, radius, start, extent, Arc2D.PIE)); g2d.dispose();
angleStart %= 360f; Arc2D.Float arc = new Arc2D.Float(); arc.x = cx - rx; arc.y = cy - ry;
BufferedImage ret = arc; Arc2D.Float arcArea = new Arc2D.Float(0, 0, width, height, startAngle, 90, Arc2D.PIE); if (bgColor != null) { g2.fill(arcArea.getBounds2D()); return ret.getSubimage((int)arcArea.getBounds2D().getX(), (int)arcArea.getBounds2D().getY(), (int)arcArea.getBounds2D().getWidth(), (int)arcArea.getBounds2D().getHeight()); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Arc2D.Float arcArea = new Arc2D.Float(startX, startY, canvasWidth, canvasHeight, startAngle, 90, Arc2D.PIE); g2.fill(arcArea.getBounds2D()); g2.drawImage(arc, 0, 0, null); return convertType(ret, BufferedImage.TYPE_INT_RGB).getSubimage((int)arcArea.getBounds2D().getX(), (int)arcArea.getBounds2D().getY(), (int)arcArea.getBounds2D().getWidth(), (int)arcArea.getBounds2D().getHeight());
arcs[i] = new Arc2D.Float(xpoints[i] - RADIUS, ypoints[i] - RADIUS, 2 * RADIUS, 2 * RADIUS, start, extent, Arc2D.OPEN);
Arc2D.Float fillArea = new Arc2D.Float(startX, startY, width, height, startAngle, extent, Arc2D.PIE);
} else if (shape instanceof Arc2D) { clone = (shape instanceof Arc2D.Float) ? new Arc2D.Float() : new Arc2D.Double(); ((Arc2D) clone).setArc((Arc2D) shape); } else if (shape instanceof Polygon) {
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN); draw(arc);
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE); fill(arc);
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE); fill(arc);
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE); fill(arc);
path.lineTo( points[(2 * i)][0], points[(2 * i)][1] ); if( rounded ) { path.append( new Arc2D.Float( cx - radius, cy - radius, radius * 2, radius * 2, angles[(2 * i)], t + e, Arc2D.OPEN ), true ); } else {
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN); draw(arc);
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.OPEN); draw(arc);
Arc2D arc = new Arc2D.Float(x, y, width, height, startAngle, arcAngle, Arc2D.PIE); fill(arc);