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 |
/** |
/** |
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 |
/** |
/** |