public virtual void paintComponent(Graphics g) { Graphics2D graphics2D = (Graphics2D) g; graphics2D.setRenderingHint((RenderingHints.Key) RenderingHints.KEY_ANTIALIASING, (object) RenderingHints.VALUE_ANTIALIAS_ON); Dimension size = ((Component) this).getSize(); Insets insets = this.getInsets(); double num1 = (double) insets.left; double num2 = (double) insets.top; double num3 = size.getWidth() - (double) insets.left - (double) insets.right; double num4 = size.getHeight() - (double) insets.top - (double) insets.bottom; Point2D.Double double1 = new Point2D.Double(num1 + 6.0, num2 + num4 / 2.0); Point2D.Double double2 = new Point2D.Double(num1 + num3 - 6.0, num2 + num4 / 2.0); Ellipse2D.Double double3 = new Ellipse2D.Double(((Point2D) double1).getX() - 5.0, ((Point2D) double1).getY() - 5.0, 10.0, 10.0); Ellipse2D.Double double4 = new Ellipse2D.Double(((Point2D) double2).getX() - 6.0, ((Point2D) double2).getY() - 5.0, 10.0, 10.0); graphics2D.draw((Shape) double3); graphics2D.fill((Shape) double3); graphics2D.draw((Shape) double4); graphics2D.fill((Shape) double4); Line2D.Double double5 = new Line2D.Double((Point2D) double1, (Point2D) double2); if (this.stroke == null) return; graphics2D.setStroke(this.stroke); graphics2D.draw((Shape) double5); }
public virtual void drawRadialGridLines(Graphics2D g2, PolarPlot plot, ValueAxis radialAxis, List ticks, Rectangle2D dataArea) { ((Graphics) g2).setFont(radialAxis.getTickLabelFont()); g2.setPaint(plot.getRadiusGridlinePaint()); g2.setStroke(plot.getRadiusGridlineStroke()); double lowerBound = radialAxis.getLowerBound(); Point point = plot.translateValueThetaRadiusToJava2D(lowerBound, lowerBound, dataArea); Iterator iterator = ticks.iterator(); while (iterator.hasNext()) { NumberTick numberTick = (NumberTick) iterator.next(); int num1 = (int) (plot.translateValueThetaRadiusToJava2D(90.0, numberTick.getNumber().doubleValue(), dataArea).x - point.x); int num2 = point.x - num1; int num3 = point.y - num1; int num4 = 2 * num1; Ellipse2D.Double @double = new Ellipse2D.Double((double) num2, (double) num3, (double) num4, (double) num4); g2.setPaint(plot.getRadiusGridlinePaint()); g2.draw((Shape) @double); } }