The thumb icons for JSliders are drawing badly at present because of a FIXME in the gradient painting code. Until we can come up with a solution, I think it is tidier to draw the icons without the gradient paint:

2006-11-29  David Gilbert  <[EMAIL PROTECTED]>

   * javax/swing/plaf/metal/MetalIconFactory.java
   (HorizontalSliderThumbIcon.paintIcon()): Commented out gradient paint,
   (VerticalSliderThumbIcon.paintIcon()): Likewise.

Regards,

Dave
Index: javax/swing/plaf/metal/MetalIconFactory.java
===================================================================
RCS file: 
/sources/classpath/classpath/javax/swing/plaf/metal/MetalIconFactory.java,v
retrieving revision 1.31
diff -u -r1.31 MetalIconFactory.java
--- javax/swing/plaf/metal/MetalIconFactory.java        26 Sep 2006 13:33:29 
-0000      1.31
+++ javax/swing/plaf/metal/MetalIconFactory.java        29 Nov 2006 18:03:30 
-0000
@@ -1039,20 +1039,22 @@
       g.drawLine(x + 6, y + 14, x, y + 8);
       g.drawLine(x, y + 7, x, y + 1);
       
-      // Fill the icon.
-      if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
-          && enabled)
-        {
-          String gradient;
-          if (focus)
-            gradient = "Slider.focusGradient";
-          else
-            gradient = "Slider.gradient";
-          MetalUtils.paintGradient(g, x + 1, y + 2, 12, 13,
-                                   SwingConstants.VERTICAL, gradient,
-                                   gradientMask);
-        }
-      else
+// The following is commented out until the masking for the gradient painting 
+// is working correctly
+//      // Fill the icon.
+//      if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
+//          && enabled)
+//        {
+//          String gradient;
+//          if (focus)
+//            gradient = "Slider.focusGradient";
+//          else
+//            gradient = "Slider.gradient";
+//          MetalUtils.paintGradient(g, x + 1, y + 2, 12, 13,
+//                                   SwingConstants.VERTICAL, gradient,
+//                                   gradientMask);
+//        }
+//      else
         {
           if (focus)
             g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
@@ -1700,20 +1702,22 @@
       g.drawLine(x + 8, y + 14, x + 1, y + 14);
       g.drawLine(x, y + 13, x, y + 1);
       
-      // Fill the icon.
-      if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
-          && enabled)
-        {
-          String gradient;
-          if (focus)
-            gradient = "Slider.focusGradient";
-          else
-            gradient = "Slider.gradient";
-          MetalUtils.paintGradient(g, x + 2, y + 1, 13, 12,
-                                   SwingConstants.HORIZONTAL, gradient,
-                                   gradientMask);
-        }
-      else
+//    The following is commented out until the masking for the gradient 
painting 
+//    is working correctly
+//      // Fill the icon.
+//      if (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme
+//          && enabled)
+//        {
+//          String gradient;
+//          if (focus)
+//            gradient = "Slider.focusGradient";
+//          else
+//            gradient = "Slider.gradient";
+//          MetalUtils.paintGradient(g, x + 2, y + 1, 13, 12,
+//                                   SwingConstants.HORIZONTAL, gradient,
+//                                   gradientMask);
+//        }
+//      else
         {
           if (focus)
             g.setColor(MetalLookAndFeel.getPrimaryControlShadow());

Reply via email to