diff options
author | Ronald Veldema <rveldema@cs.vu.nl> | 2002-03-11 15:48:06 +0000 |
---|---|---|
committer | Ronald Veldema <rveldema@cs.vu.nl> | 2002-03-11 15:48:06 +0000 |
commit | 5158e5cd020ca88753de8793a40dcda66f3ea8ae (patch) | |
tree | e8ff44926abd1e1fd9f058139dc1476c54d24f9c /javax/swing/plaf/basic/BasicCheckBoxUI.java | |
parent | eed4707c499f072d7e36d8499638b859a370fc57 (diff) | |
download | classpath-5158e5cd020ca88753de8793a40dcda66f3ea8ae.tar.gz |
Added my embryonic javax.swing implementation,
since there are no makefiles for it yet nobody should
notice its addition (it shouldn't break anything by adding it this early)
R.
Diffstat (limited to 'javax/swing/plaf/basic/BasicCheckBoxUI.java')
-rw-r--r-- | javax/swing/plaf/basic/BasicCheckBoxUI.java | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/javax/swing/plaf/basic/BasicCheckBoxUI.java b/javax/swing/plaf/basic/BasicCheckBoxUI.java new file mode 100644 index 000000000..2ad18888a --- /dev/null +++ b/javax/swing/plaf/basic/BasicCheckBoxUI.java @@ -0,0 +1,87 @@ +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.text, + b.getIcon(), + b.vert_align, + b.hori_align, + b.hori_text_pos, + b.vert_text_pos); + //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); + } +} + + + + |