1 package javax
.swing
.plaf
.basic
;
4 import javax
.swing
.plaf
.*;
8 public class BasicCheckBoxUI
extends BasicRadioButtonUI
10 public static ComponentUI
createUI(final JComponent c
) {
11 return new BasicCheckBoxUI();
15 public void installUI(final JComponent c
) {
19 public Dimension
getPreferredSize(JComponent c
)
21 AbstractButton b
= (AbstractButton
)c
;
22 Dimension d
= BasicGraphicsUtils
.getPreferredSize(b
,
26 b
.getVerticalAlignment(),
27 b
.getHorizontalAlignment(),
28 b
.getHorizontalTextPosition(),
29 b
.getVerticalTextPosition());
31 //System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
35 protected void paintFocus(Graphics g
,
43 protected void paintIcon(Graphics g
,
49 protected void paintButtonPressed(Graphics g
,
52 Dimension size
= b
.getSize();
54 g
.setColor(pressedBackgroundColor
);
55 g
.fillRect(1,1,size
.width
-2, size
.height
-2);
59 protected void paintButtonNormal(Graphics g
,
62 Dimension size
= b
.getSize();
64 g
.setColor(normalBackgroundColor
);
65 g
.fillRect(1,1,size
.width
-2, size
.height
-2);
68 protected void paintText(Graphics g
,
73 // AbstractButton b = (AbstractButton) c;
75 // System.out.println("drawing string: " + text + ", at:" + textRect);
77 g
.setColor(textColor
);
78 BasicGraphicsUtils
.drawString(g
,