this.getTickRadius() - this.getTickLabelOffset(),
this.getTickRadius() - this.getTickLabelOffset());
boolean firstLabel = true;
Arc2D arc = new Arc2D.Double();
Line2D workingLine = new Line2D.Double();
Stroke arcStroke = new BasicStroke(0.75f);
for (double v = this.getLowerBound(); v <= this.getUpperBound();
v += this.getMajorTickIncrement()) {
arc.setArc(arcRect, this.getStartAngle(), valueToAngle(v)
- this.getStartAngle(), Arc2D.OPEN);
g2.setPaint(this.getMajorTickPaint());
g2.setStroke(arcStroke);
g2.draw(arc);
Point2D pt0 = arc.getEndPoint();
arc.setArc(arcRectMajor, this.getStartAngle(), valueToAngle(v)
- this.getStartAngle(), Arc2D.OPEN);
Point2D pt1 = arc.getEndPoint();
g2.setPaint(this.getMajorTickPaint());
g2.setStroke(this.getMajorTickStroke());
workingLine.setLine(pt0, pt1);
g2.draw(workingLine);
arc.setArc(arcRectForLabels, this.getStartAngle(), valueToAngle(v)
- this.getStartAngle(), Arc2D.OPEN);
Point2D pt2 = arc.getEndPoint();
if (this.getTickLabelsVisible()) {
if (!firstLabel || this.getFirstTickLabelVisible()) {
g2.setFont(this.getTickLabelFont());
TextUtilities.drawAlignedString(
this.getTickLabelFormatter().format(v), g2,
(float) pt2.getX(), (float) pt2.getY(),
TextAnchor.CENTER);
}
}
firstLabel = false;
// now do the minor tick marks
if (this.getMinorTickCount() > 0 && this.getMinorTickLength() > 0.0) {
double minorTickIncrement = this.getMajorTickIncrement()
/ (this.getMinorTickCount() + 1);
for (int i = 0; i < this.getMinorTickCount(); i++) {
double vv = v + ((i + 1) * minorTickIncrement);
if (vv >= this.getUpperBound()) {
break;
}
double angle = valueToAngle(vv);
arc.setArc(arcRect, this.getStartAngle(), angle
- this.getStartAngle(), Arc2D.OPEN);
pt0 = arc.getEndPoint();
arc.setArc(arcRectMinor, this.getStartAngle(), angle
- this.getStartAngle(), Arc2D.OPEN);
Point2D pt3 = arc.getEndPoint();
g2.setStroke(this.getMinorTickStroke());
g2.setPaint(this.getMinorTickPaint());
workingLine.setLine(pt0, pt3);
g2.draw(workingLine);
}