cyclePos = highest.getFadePosition();
if (!highest.isFadingIn())
cyclePos = 1.0f - cyclePos;
}
SubstanceButtonShaper shaper = SubstanceCoreUtilities
.getButtonShaper(this.scrollbar);
HashMapKey key = SubstanceCoreUtilities
.getHashKey(cyclePos, width, height,
((leftActiveButton == null) ? "null"
: ComponentState.getState(
leftActiveButton.getModel(),
leftActiveButton).name()),
((leftActiveButton == null) ? "null"
: SubstanceCoreUtilities
.getPrevComponentState(
leftActiveButton).name()),
((rightActiveButton == null) ? "null"
: ComponentState.getState(
rightActiveButton.getModel(),
rightActiveButton).name()),
((rightActiveButton == null) ? "null"
: SubstanceCoreUtilities
.getPrevComponentState(
rightActiveButton).name()),
((compLeftState == null) ? "null" : compLeftState
.name()),
((compRightState == null) ? "null" : compRightState
.name()), ((compLeftState == null) ? "null"
: SubstanceColorSchemeUtilities
.getColorScheme(leftActiveButton,
compLeftState)
.getDisplayName()),
((compRightState == null) ? "null"
: SubstanceColorSchemeUtilities
.getColorScheme(rightActiveButton,
compRightState)
.getDisplayName()),
SubstanceColorSchemeUtilities.getColorScheme(
this.scrollbar, ComponentState.DEFAULT)
.getDisplayName(), shaper.getDisplayName(),
SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(scrollbar)));
// System.out.println(key);
if (trackFullHorizontalMap.containsKey(key)) {
// System.out.println("Cache hit");
return trackFullHorizontalMap.get(key);
}
// System.out.println("Cache miss");
// System.out.println("New image for horizontal track");
BufferedImage imageBack = getTrackBackHorizontal(this.scrollbar,
leftActiveButton, rightActiveButton, width, height);
Graphics2D backGraphics = imageBack.createGraphics();
BufferedImage imageDefault = getTrackHorizontal(this.scrollbar,
compLeftState, compRightState, width, height);
backGraphics.drawImage(imageDefault, 0, 0, null);
BufferedImage imageActive = getTrackHorizontal(this.scrollbar,
compLeftState, compRightState, width, height);
backGraphics.setComposite(AlphaComposite.SrcOver.derive(cyclePos));
// System.out.println("Painting " + cyclePos);
backGraphics.drawImage(imageActive, 0, 0, null);
trackFullHorizontalMap.put(key, imageBack);
return imageBack;
}
SubstanceButtonShaper shaper = SubstanceCoreUtilities
.getButtonShaper(this.scrollbar);
HashMapKey key = SubstanceCoreUtilities
.getHashKey(width, height, ((compLeftState == null) ? "null"
: ComponentState.getState(leftActiveButton.getModel(),
leftActiveButton).name()),
((compLeftState == null) ? "null"
: SubstanceCoreUtilities.getPrevComponentState(
leftActiveButton).name()),
((compRightState == null) ? "null" : ComponentState
.getState(rightActiveButton.getModel(),
rightActiveButton).name()),
((compRightState == null) ? "null"
: SubstanceCoreUtilities.getPrevComponentState(
rightActiveButton).name()),
((compLeftState == null) ? "null" : compLeftState
.name()), ((compRightState == null) ? "null"
: compRightState.name()),
((compLeftState == null) ? "null"
: SubstanceColorSchemeUtilities.getColorScheme(
leftActiveButton, compLeftState)
.getDisplayName()),
((compRightState == null) ? "null"
: SubstanceColorSchemeUtilities.getColorScheme(
rightActiveButton, compRightState)
.getDisplayName()),
SubstanceColorSchemeUtilities.getColorScheme(
this.scrollbar, ComponentState.DEFAULT)
.getDisplayName(), shaper.getDisplayName(),
SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(scrollbar)));
// System.out.println(key);