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