return baseline;
}
@Override
public void paint(Graphics2D graphics) {
RadioButton radioButton = (RadioButton)getComponent();
int width = getWidth();
int height = getHeight();
// Paint the button
int offset = (height - BUTTON_DIAMETER) / 2;
graphics.translate(0, offset);
paintButton(graphics, radioButton.isEnabled(), radioButton.isSelected());
graphics.translate(0, -offset);
// Paint the content
Button.DataRenderer dataRenderer = radioButton.getDataRenderer();
Object buttonData = radioButton.getButtonData();
dataRenderer.render(buttonData, radioButton, false);
dataRenderer.setSize(Math.max(width - (BUTTON_DIAMETER + spacing * 2), 0), height);
Graphics2D contentGraphics = (Graphics2D)graphics.create();
contentGraphics.translate(BUTTON_DIAMETER + spacing, 0);
contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
dataRenderer.paint(contentGraphics);
contentGraphics.dispose();
// Paint the focus state
if (radioButton.isFocused()) {
if (buttonData == null) {
Color focusColor = new Color(buttonSelectionColor.getRed(),
buttonSelectionColor.getGreen(),
buttonSelectionColor.getBlue(), 0x44);
graphics.setColor(focusColor);