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