protected void configureScrollBarColors() {
}
private void updateStyle(JScrollBar c) {
SynthStyle oldStyle = style;
SeaGlassContext context = getContext(c, ENABLED);
style = SeaGlassLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
scrollBarWidth = style.getInt(context, "ScrollBar.thumbHeight", 14);
minimumThumbSize = (Dimension) style.get(context, "ScrollBar.minimumThumbSize");
if (minimumThumbSize == null) {
minimumThumbSize = new Dimension();
validMinimumThumbSize = false;
} else {
validMinimumThumbSize = true;
}
maximumThumbSize = (Dimension) style.get(context, "ScrollBar.maximumThumbSize");
if (maximumThumbSize == null) {
maximumThumbSize = new Dimension(4096, 4097);
}
incrGap = style.getInt(context, "ScrollBar.incrementButtonGap", 0);
decrGap = style.getInt(context, "ScrollBar.decrementButtonGap", 0);
capSize = style.getInt(context, "ScrollBar.capSize", 0);
/*
* Handle scaling for sizeVarients for special case components. The
* key "JComponent.sizeVariant" scales for large/small/mini
* components are based on Apples LAF
*/
String scaleKey = SeaGlassStyle.getSizeVariant(scrollbar);
if (scaleKey != null) {
if (SeaGlassStyle.LARGE_KEY.equals(scaleKey)) {
scrollBarWidth *= 1.15;
incrGap *= 1.15;
decrGap *= 1.15;
} else if (SeaGlassStyle.SMALL_KEY.equals(scaleKey)) {
scrollBarWidth *= 0.857;
incrGap *= 0.857;
decrGap *= 0.857;
} else if (SeaGlassStyle.MINI_KEY.equals(scaleKey)) {
scrollBarWidth *= 0.714;
incrGap *= 0.714;
decrGap *= 0.714;
}
}
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
}
context.dispose();
context = getContext(c, Region.SCROLL_BAR_TRACK, ENABLED);
trackStyle = SeaGlassLookAndFeel.updateStyle(context, this);
context.dispose();
context = getContext(c, Region.SCROLL_BAR_THUMB, ENABLED);
thumbStyle = SeaGlassLookAndFeel.updateStyle(context, this);
context.dispose();
context = getContext(c, SeaGlassRegion.SCROLL_BAR_CAP, ENABLED);
capStyle = SeaGlassLookAndFeel.updateStyle(context, this);
context.dispose();
}