PdfContentByte cb, PdfFormField field,
String onValue, float width, float height,
boolean normal, FSColor color, FSColor darker) {
// XXX Should cache this by width and height, but they're small so
// don't bother for now...
PdfAppearance tpOff = cb.createAppearance(width, height);
PdfAppearance tpOn = cb.createAppearance(width, height);
float diameter = Math.min(width, height);
setStrokeColor(tpOff, color);
setStrokeColor(tpOn, color);
if (! normal) {
setStrokeColor(tpOff, darker);
setStrokeColor(tpOn, darker);
}
float strokeWidth = Math.max(1.0f, reduce(diameter));
tpOff.setLineWidth(strokeWidth);
tpOn.setLineWidth(strokeWidth);
tpOff.circle(width / 2, height / 2, diameter / 2 - strokeWidth / 2);
tpOn.circle(width / 2, height / 2, diameter / 2 - strokeWidth / 2);
if (! normal) {
tpOff.fillStroke();
tpOn.fillStroke();
} else {
tpOff.stroke();
tpOn.stroke();
}
setFillColor(tpOn, color);
if (! normal) {
tpOn.circle(width / 2, height / 2, diameter * 0.23f);
} else {
tpOn.circle(width / 2, height / 2, diameter * 0.20f);
}
tpOn.fill();
if (normal) {
field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, OFF_STATE, tpOff);
field.setAppearance(PdfAnnotation.APPEARANCE_NORMAL, onValue, tpOn);
} else {