aboutsummaryrefslogtreecommitdiff
path: root/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>2002-08-09 04:26:17 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2002-08-09 05:26:17 +0100
commit7bde45b2eb84502b62e77e46d947e46dcbd333d6 (patch)
treecdf9958b411887bead2263ea8ef0bdfc8eae6319 /libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
parent097684ce62b505168739fc98e952f92a8719a1fa (diff)
downloadgcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.zip
gcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.tar.gz
gcc-7bde45b2eb84502b62e77e46d947e46dcbd333d6.tar.bz2
AWT/Swing merge from GNU Classpath.
From-SVN: r56147
Diffstat (limited to 'libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java')
-rw-r--r--libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java88
1 files changed, 88 insertions, 0 deletions
diff --git a/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java b/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
new file mode 100644
index 0000000..1a84b1f
--- /dev/null
+++ b/libjava/javax/swing/plaf/basic/BasicCheckBoxUI.java
@@ -0,0 +1,88 @@
+package javax.swing.plaf.basic;
+
+import javax.swing.*;
+import javax.swing.plaf.*;
+import java.awt.*;
+
+
+public class BasicCheckBoxUI extends BasicRadioButtonUI
+{
+ public static ComponentUI createUI(final JComponent c) {
+ return new BasicCheckBoxUI();
+ }
+
+
+ public void installUI(final JComponent c) {
+ super.installUI(c);
+ }
+
+ public Dimension getPreferredSize(JComponent c)
+ {
+ AbstractButton b = (AbstractButton)c;
+ Dimension d = BasicGraphicsUtils.getPreferredSize(b,
+ gap,
+ b.getText(),
+ b.getIcon(),
+ b.getVerticalAlignment(),
+ b.getHorizontalAlignment(),
+ b.getHorizontalTextPosition(),
+ b.getVerticalTextPosition());
+
+ //System.out.println("^^^^^^^^^^^^^^^^^^^^^^ BASIC-PREF="+d + ",T="+b.text);
+ return d;
+ }
+
+ protected void paintFocus(Graphics g,
+ JComponent c,
+ Rectangle vr,
+ Rectangle tr,
+ Rectangle ir)
+ {
+ }
+
+ protected void paintIcon(Graphics g,
+ JComponent c,
+ Rectangle iconRect)
+ {
+ }
+
+ protected void paintButtonPressed(Graphics g,
+ JComponent b)
+ {
+ Dimension size = b.getSize();
+
+ g.setColor(pressedBackgroundColor);
+ g.fillRect(1,1,size.width-2, size.height-2);
+
+ }
+
+ protected void paintButtonNormal(Graphics g,
+ JComponent b)
+ {
+ Dimension size = b.getSize();
+
+ g.setColor(normalBackgroundColor);
+ g.fillRect(1,1,size.width-2, size.height-2);
+
+ }
+ protected void paintText(Graphics g,
+ JComponent c,
+ Rectangle textRect,
+ String text)
+ {
+ // AbstractButton b = (AbstractButton) c;
+
+ // System.out.println("drawing string: " + text + ", at:" + textRect);
+
+ g.setColor(textColor);
+ BasicGraphicsUtils.drawString(g,
+ text,
+ 0,
+ textRect.x,
+ textRect.y);
+ }
+}
+
+
+
+