protected void installDefaults() {
updateStyle(progressBar);
}
private void updateStyle(JProgressBar c) {
SeaGlassContext context = getContext(c, ENABLED);
// SynthStyle oldStyle = style;
style = SeaGlassLookAndFeel.updateStyle(context, this);
setCellLength(style.getInt(context, "ProgressBar.cellLength", 1));
setCellSpacing(style.getInt(context, "ProgressBar.cellSpacing", 0));
progressPadding = style.getInt(context, "ProgressBar.progressPadding", 0);
paintOutsideClip = style.getBoolean(context, "ProgressBar.paintOutsideClip", false);
rotateText = style.getBoolean(context, "ProgressBar.rotateText", false);
tileWhenIndeterminate = style.getBoolean(context, "ProgressBar.tileWhenIndeterminate", false);
trackThickness = style.getInt(context, "ProgressBar.trackThickness", 19);
tileWidth = style.getInt(context, "ProgressBar.tileWidth", 15);
bgFillColor = (Color) style.get(context, "ProgressBar.backgroundFillColor");
if (bgFillColor == null) {
bgFillColor = Color.white;
}
// 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(progressBar);
if (scaleKey != null) {
if (SeaGlassStyle.LARGE_KEY.equals(scaleKey)) {
trackThickness = 24;
tileWidth *= 1.15;
} else if (SeaGlassStyle.SMALL_KEY.equals(scaleKey)) {
trackThickness = 17;
tileWidth *= 0.857;
} else if (SeaGlassStyle.MINI_KEY.equals(scaleKey)) {
trackThickness = 15;
tileWidth *= 0.784;
}
}
context.dispose();
}