public override void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) { g2.setPaint((Paint) Color.blue); g2.setStroke((Stroke) new BasicStroke(1f)); Rectangle2D rectangle2D1 = DialPlot.rectangleByRadius(frame, this.radius, this.radius); Rectangle2D rectangle2D2 = DialPlot.rectangleByRadius(frame, this.widthRadius, this.widthRadius); double d = plot.getValue(this.datasetIndex); double num = plot.getScaleForDataset(this.datasetIndex).valueToAngle(d); Point2D endPoint1 = ((Arc2D) new Arc2D.Double(rectangle2D1, num, 0.0, 0)).getEndPoint(); Arc2D.Double double1 = new Arc2D.Double(rectangle2D2, num - 90.0, 180.0, 0); Point2D startPoint1 = ((Arc2D) double1).getStartPoint(); Point2D endPoint2 = ((Arc2D) double1).getEndPoint(); Point2D startPoint2 = ((Arc2D) new Arc2D.Double(rectangle2D2, num - 180.0, 0.0, 0)).getStartPoint(); GeneralPath generalPath = new GeneralPath(); ((Path2D.Float) generalPath).moveTo((float) endPoint1.getX(), (float) endPoint1.getY()); ((Path2D.Float) generalPath).lineTo((float) startPoint1.getX(), (float) startPoint1.getY()); ((Path2D.Float) generalPath).lineTo((float) startPoint2.getX(), (float) startPoint2.getY()); ((Path2D.Float) generalPath).lineTo((float) endPoint2.getX(), (float) endPoint2.getY()); ((Path2D) generalPath).closePath(); g2.setPaint(this.fillPaint); g2.fill((Shape) generalPath); g2.setPaint(this.outlinePaint); Line2D.Double double2 = new Line2D.Double(((RectangularShape) frame).getCenterX(), ((RectangularShape) frame).getCenterY(), endPoint1.getX(), endPoint1.getY()); g2.draw((Shape) double2); ((Line2D) double2).setLine(startPoint1, endPoint2); g2.draw((Shape) double2); ((Line2D) double2).setLine(endPoint2, endPoint1); g2.draw((Shape) double2); ((Line2D) double2).setLine(startPoint1, endPoint1); g2.draw((Shape) double2); ((Line2D) double2).setLine(startPoint1, startPoint2); g2.draw((Shape) double2); ((Line2D) double2).setLine(endPoint2, startPoint2); g2.draw((Shape) double2); }
public override void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) { g2.setPaint(this.paint); g2.setStroke(this.stroke); Rectangle2D rectangle2D = DialPlot.rectangleByRadius(frame, this.radius, this.radius); double d = plot.getValue(this.datasetIndex); double num = plot.getScaleForDataset(this.datasetIndex).valueToAngle(d); Point2D endPoint = ((Arc2D) new Arc2D.Double(rectangle2D, num, 0.0, 0)).getEndPoint(); Line2D.Double @double = new Line2D.Double(((RectangularShape) frame).getCenterX(), ((RectangularShape) frame).getCenterY(), endPoint.getX(), endPoint.getY()); g2.draw((Shape) @double); }