classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: ProgressBar border handling fixed


From: Roman Kennke
Subject: [cp-patches] FYI: ProgressBar border handling fixed
Date: Fri, 20 May 2005 14:26:27 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

I committed the attached patch. It fixes the handling of borders in ProgressBars. See below for details.

2005-05-20  Roman Kennke  <address@hidden>

       * javax/swing/JProgressBar.java
       (paintBorder): Check if border is null before trying to paint it.
       * javax/swing/plaf/basic/BasicProgressBarUI.java
       (paint): Don't paint the border here. This would lead to the border
       beeing painted twice.

/Roman

Index: javax/swing/JProgressBar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JProgressBar.java,v
retrieving revision 1.9
diff -u -r1.9 JProgressBar.java
--- javax/swing/JProgressBar.java       16 Feb 2005 12:36:22 -0000      1.9
+++ javax/swing/JProgressBar.java       20 May 2005 12:23:06 -0000
@@ -45,6 +45,7 @@
 import javax.accessibility.AccessibleRole;
 import javax.accessibility.AccessibleStateSet;
 import javax.accessibility.AccessibleValue;
+import javax.swing.border.Border;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.plaf.ProgressBarUI;
@@ -285,9 +286,11 @@
    */
   protected void paintBorder(Graphics graphics)
   {
-    getBorder().paintBorder(this, graphics, 0, 0,
-                            getWidth(),
-                            getHeight());
+    Border border = getBorder();
+    if (paintBorder && border != null)
+      border.paintBorder(this, graphics, 0, 0,
+                         getWidth(),
+                         getHeight());
   }
 
   /**
Index: javax/swing/plaf/basic/BasicProgressBarUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java,v
retrieving revision 1.9
diff -u -r1.9 BasicProgressBarUI.java
--- javax/swing/plaf/basic/BasicProgressBarUI.java      13 May 2005 12:39:46 
-0000      1.9
+++ javax/swing/plaf/basic/BasicProgressBarUI.java      20 May 2005 12:23:06 
-0000
@@ -492,11 +492,6 @@
       paintDeterminate(g, c);
     else
       paintIndeterminate(g, c);
-      
-    if (progressBar.isBorderPainted())
-      progressBar.getBorder().paintBorder(progressBar, g, 0, 0,
-                                          progressBar.getWidth(),
-                                         progressBar.getHeight());
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]