1 package javax
.swing
.plaf
.basic
;
4 import javax
.swing
.plaf
.*;
8 public class BasicToggleButtonUI
extends BasicButtonUI
11 public static ComponentUI
createUI(final JComponent c
) {
12 return new BasicToggleButtonUI();
16 public void installUI(final JComponent c
) {
20 public Dimension
getPreferredSize(JComponent c
)
22 AbstractButton b
= (AbstractButton
)c
;
23 Dimension d
= BasicGraphicsUtils
.getPreferredSize(b
,
27 b
.getVerticalAlignment(),
28 b
.getHorizontalAlignment(),
29 b
.getHorizontalTextPosition(),
30 b
.getVerticalTextPosition());
32 //System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
36 protected void paintFocus(Graphics g
,
44 protected void paintIcon(Graphics g
,
50 protected void paintButtonPressed(Graphics g
,
53 Dimension size
= b
.getSize();
55 g
.setColor(pressedBackgroundColor
);
56 g
.fillRect(1,1,size
.width
-2, size
.height
-2);
60 protected void paintButtonNormal(Graphics g
,
63 Dimension size
= b
.getSize();
65 g
.setColor(normalBackgroundColor
);
66 g
.fillRect(1,1,size
.width
-2, size
.height
-2);
69 protected void paintText(Graphics g
,
74 // AbstractButton b = (AbstractButton) c;
76 // System.out.println("drawing string: " + text + ", at:" + textRect);
78 g
.setColor(textColor
);
80 BasicGraphicsUtils
.drawString(g
,