This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui] Patch: javax.swing.plaf.basic.BasicButtonUI
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 12 Aug 2004 17:14:35 +0200
- Subject: [gui] Patch: javax.swing.plaf.basic.BasicButtonUI
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I just commited the attached patch to improve
javax.swing.plaf.basic.BasicButtonUI and add some missing methods.
Michael
2004-08-12 Michael Koch <konqueror@gmx.de>
* javax/swing/plaf/basic/BasicButtonUI.java
(defaultTextIconGap): Made protected.
(defaultTextShiftOffset): Likewise.
(textShiftOffset): New field.
(clearTextShiftOffset): New method.
(getTextShiftOffset): Likewise.
(setTextShiftOffset): Likewise.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBG4lfWSOgCCdjSDsRAjtaAJ9iIcRU2dGpTKm+/p1ItgkrMbf5/gCfVyDL
BVY6PRPEJCrWbMRc1XhhEL0=
=fmi9
-----END PGP SIGNATURE-----
Index: javax/swing/plaf/basic/BasicButtonUI.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/plaf/basic/BasicButtonUI.java,v
retrieving revision 1.6.2.7
diff -u -r1.6.2.7 BasicButtonUI.java
--- javax/swing/plaf/basic/BasicButtonUI.java 10 Jul 2004 17:53:04 -0000 1.6.2.7
+++ javax/swing/plaf/basic/BasicButtonUI.java 12 Aug 2004 15:08:33 -0000
@@ -59,13 +59,19 @@
public class BasicButtonUI extends ButtonUI
{
- /** A constant used to pad out elements in the button's layout and
- preferred size calculations. */
- int defaultTextIconGap = 4;
-
- /** A constant added to the defaultTextIconGap to adjust the text
- within this particular button. */
- int defaultTextShiftOffset = 0;
+ /**
+ * A constant used to pad out elements in the button's layout and
+ * preferred size calculations.
+ */
+ protected int defaultTextIconGap = 4;
+
+ /**
+ * A constant added to the defaultTextIconGap to adjust the text
+ * within this particular button.
+ */
+ protected int defaultTextShiftOffset = 0;
+
+ private int textShiftOffset;
/**
* Factory method to create an instance of BasicButtonUI for a given
@@ -85,6 +91,21 @@
return defaultTextIconGap;
}
+ protected void clearTextShiftOffset()
+ {
+ textShiftOffset = 0;
+ }
+
+ protected int getTextShiftOffset()
+ {
+ return textShiftOffset;
+ }
+
+ protected void setTextShiftOffset()
+ {
+ textShiftOffset = defaultTextShiftOffset;
+ }
+
protected void installDefaults(AbstractButton b)
{
UIDefaults defaults = UIManager.getLookAndFeelDefaults();