233 |
{ |
{ |
234 |
if (block) |
if (block) |
235 |
{ |
{ |
236 |
// Only need to check it if it's block scrolling |
// Only need to check it if it's block scrolling |
237 |
// We only block scroll if the click occurs |
// We only block scroll if the click occurs |
238 |
// in the track. |
// in the track. |
239 |
if (! trackListener.shouldScroll(direction)) |
if (!trackListener.shouldScroll(direction)) |
240 |
{ |
{ |
241 |
trackHighlight = NO_HIGHLIGHT; |
trackHighlight = NO_HIGHLIGHT; |
242 |
scrollbar.repaint(); |
scrollbar.repaint(); |
243 |
return; |
return; |
244 |
} |
} |
245 |
scrollByBlock(direction); |
scrollByBlock(direction); |
246 |
} |
} |
247 |
else |
else |
248 |
scrollByUnit(direction); |
scrollByUnit(direction); |
249 |
} |
} |
250 |
} |
} |
251 |
|
|
659 |
height = Math.max(incrButton.getPreferredSize().height, |
height = Math.max(incrButton.getPreferredSize().height, |
660 |
decrButton.getPreferredSize().height); |
decrButton.getPreferredSize().height); |
661 |
height = Math.max(getMinimumThumbSize().height, height); |
height = Math.max(getMinimumThumbSize().height, height); |
|
height = Math.max(20, height); |
|
662 |
height = Math.min(getMaximumThumbSize().height, height); |
height = Math.min(getMaximumThumbSize().height, height); |
663 |
} |
} |
664 |
else |
else |
671 |
width = Math.max(incrButton.getPreferredSize().width, |
width = Math.max(incrButton.getPreferredSize().width, |
672 |
decrButton.getPreferredSize().width); |
decrButton.getPreferredSize().width); |
673 |
width = Math.max(getMinimumThumbSize().width, width); |
width = Math.max(getMinimumThumbSize().width, width); |
|
width = Math.max(20, width); |
|
674 |
width = Math.min(getMaximumThumbSize().width, width); |
width = Math.min(getMaximumThumbSize().width, width); |
675 |
} |
} |
676 |
|
|
873 |
trackRect = new Rectangle(); |
trackRect = new Rectangle(); |
874 |
thumbRect = new Rectangle(); |
thumbRect = new Rectangle(); |
875 |
|
|
876 |
scrollTimer = new Timer(200, null); |
scrollTimer = new Timer(50, null); |
877 |
scrollTimer.setRepeats(true); |
scrollTimer.setRepeats(true); |
878 |
|
|
879 |
installComponents(); |
installComponents(); |