/[classpath]/classpath/javax/swing/plaf/basic/BasicScrollBarUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicScrollBarUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by tromey, Tue Apr 26 18:56:19 2005 UTC revision 1.18 by rabbit78, Wed Apr 27 10:16:21 2005 UTC
# Line 499  public class BasicScrollBarUI extends Sc Line 499  public class BasicScrollBarUI extends Sc
499      thumbColor = defaults.getColor("ScrollBar.thumb");      thumbColor = defaults.getColor("ScrollBar.thumb");
500      thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");      thumbHighlightColor = defaults.getColor("ScrollBar.thumbHighlight");
501      thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");      thumbDarkShadowColor = defaults.getColor("ScrollBar.thumbDarkShadow");
502      thumbLightShadowColor = defaults.getColor("ScrollBar.thumbLightShadow");      thumbLightShadowColor = defaults.getColor("ScrollBar.thumbShadow");
503    }    }
504    
505    /**    /**
# Line 1034  public class BasicScrollBarUI extends Sc Line 1034  public class BasicScrollBarUI extends Sc
1034     */     */
1035    protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)    protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
1036    {    {
     Color saved = g.getColor();  
     Point x;  
     Point y;  
     Point z;  
     Polygon lines;  
   
     g.setColor(thumbHighlightColor);  
     x = new Point(thumbBounds.x + 1, thumbBounds.y + 1);  
     y = new Point(x);  
     y.translate(thumbBounds.width - 2, 0);  
     z = new Point(x);  
     z.translate(0, thumbBounds.height - 2);  
   
     lines = new Polygon(new int[] { x.x, y.x, z.x },  
                         new int[] { x.y, y.y, z.y }, 3);  
   
     g.drawPolygon(lines);  
   
     g.setColor(thumbLightShadowColor);  
     x = new Point(thumbBounds.x + thumbBounds.width - 1,  
                   thumbBounds.y + thumbBounds.height - 1);  
     y = new Point(x);  
     y.translate(-(thumbBounds.width - 2), 0);  
     z = new Point(x);  
     z.translate(0, -(thumbBounds.height - 2));  
   
     lines = new Polygon(new int[] { x.x, y.x, z.x },  
                         new int[] { x.y, y.y, z.y }, 3);  
     g.drawPolygon(lines);  
   
     g.setColor(thumbDarkShadowColor);  
     x = new Point(thumbBounds.x + thumbBounds.width,  
                   thumbBounds.y + thumbBounds.height);  
     y = new Point(x);  
     y.translate(-thumbBounds.width, 0);  
     z = new Point(x);  
     z.translate(0, -thumbBounds.height);  
   
     lines = new Polygon(new int[] { x.x, y.x, z.x },  
                         new int[] { x.y, y.y, z.y }, 3);  
     g.drawPolygon(lines);  
   
1037      g.setColor(thumbColor);      g.setColor(thumbColor);
1038      g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width,      g.fillRect(thumbBounds.x, thumbBounds.y, thumbBounds.width,
1039                 thumbBounds.height);                 thumbBounds.height);
1040    
1041      g.setColor(saved);      BasicGraphicsUtils.drawBezel(g, thumbBounds.x, thumbBounds.y,
1042                                     thumbBounds.width, thumbBounds.height,
1043                                     false, false, thumbDarkShadowColor,
1044                                     thumbDarkShadowColor, thumbHighlightColor,
1045                                     thumbHighlightColor);
1046    }    }
1047    
1048    /**    /**

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26