harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r563083 - /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
Date Mon, 06 Aug 2007 09:59:30 GMT
Author: odeakin
Date: Mon Aug  6 02:59:30 2007
New Revision: 563083

URL: http://svn.apache.org/viewvc?view=rev&rev=563083
Log:
Apply patch HARMONY-4482 ([classlib][swing] JSlider track size in Harmony is smaller then
in RI)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java?view=diff&rev=563083&r1=563082&r2=563083
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicSliderUI.java
Mon Aug  6 02:59:30 2007
@@ -700,28 +700,36 @@
                                                 : heightOfLowValueLabel / 2;
             }
         } else {
-            trackBuffer = (slider.getOrientation() == JSlider.HORIZONTAL)
-                       ? getThumbSize().width / 2
-                       : getThumbSize().height / 2;
+            trackBuffer = 0;
         }
     }
 
     protected void calculateTrackRect() {
-        if (slider.getOrientation() == JSlider.HORIZONTAL) {
-            int width = contentRect.width - trackBuffer * 2 - thumbRect.width;
-            int x = contentRect.x + trackBuffer + thumbRect.width / 2;
-            int y = contentRect.y + contentRect.height / 2 - (thumbRect.height + labelRect.height
+ tickRect.height) / 2;
-            trackRect.setBounds(x, y, width, thumbRect.height);
-        } else {
-            int height = contentRect.height - trackBuffer * 2 - thumbRect.height;
-            int x;
+
+        if (slider.getOrientation() == JSlider.HORIZONTAL) {            
+            int width = contentRect.width - trackBuffer * 2
+                          - getThumbSize().width;
+            int x = contentRect.x + trackBuffer + getThumbSize().width / 2;
+            int y = contentRect.y + (contentRect.height - getThumbSize().height
+                          + labelRect.height + tickRect.height) / 2;
+            
+            trackRect.setBounds(x, y, width, getThumbSize().height);
+            
+        } else {            
+            int height = contentRect.height - trackBuffer * 2
+                          - getThumbSize().height;
             int sizeToCenter = (getThumbSize().width + labelRect.width + tickRect.width)
/ 2;
+            int y = contentRect.y + trackBuffer + getThumbSize().height / 2;
+            int x;
+            
             if (slider.getComponentOrientation().isLeftToRight()) {
                 x = contentRect.x + contentRect.width / 2 - sizeToCenter;
+                
             } else {
-                x = contentRect.x + contentRect.width / 2 + sizeToCenter - getThumbSize().width;
+                x = contentRect.x + contentRect.width / 2 + sizeToCenter
+                          - getThumbSize().width;
             }
-            int y = contentRect.y + trackBuffer + thumbRect.height / 2;
+            
             trackRect.setBounds(x, y, getThumbSize().width, height);
         }
     }



Mime
View raw message