SubstanceColorScheme borderScheme2) {
SubstanceFillPainter painter = SubstanceCoreUtilities
.getFillPainter(scrollBar);
SubstanceButtonShaper shaper = SubstanceCoreUtilities
.getButtonShaper(scrollBar);
SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
.getBorderPainter(scrollBar);
HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
scheme.getDisplayName(), scheme2.getDisplayName(), borderScheme
.getDisplayName(), borderScheme2.getDisplayName(),
cyclePos, borderCyclePos, painter.getDisplayName(), shaper
.getDisplayName(), borderPainter.getDisplayName());
BufferedImage result = SubstanceScrollBarUI.thumbVerticalMap.get(key);
if (result == null) {
// System.out.println("Cache miss - computing");
// System.out.println("New image for vertical thumb");
float radius = width / 2;
if (shaper instanceof ClassicButtonShaper)
radius = SubstanceSizeUtils
.getClassicButtonCornerRadius(SubstanceSizeUtils
.getComponentFontSize(scrollBar));
int borderDelta = (int) Math.floor(SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(scrollBar)) / 2.0);
GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(
height, width, radius, null, borderDelta);
result = SubstanceCoreUtilities.getBlankImage(height, width);
painter.paintContourBackground(result.createGraphics(), scrollBar,
height, width, contour, false, scheme, scheme2, cyclePos,
true, scheme != scheme2);
// int borderThickness = (int) SubstanceSizeUtils
// .getBorderStrokeWidth(SubstanceSizeUtils
// .getComponentFontSize(scrollBar));
// GeneralPath contourInner = SubstanceOutlineUtilities
// .getBaseOutline(height, width, radius, null,
// borderThickness + borderDelta);
borderPainter.paintBorder(result.getGraphics(), scrollBar, height,
width, contour, null, borderScheme, borderScheme2,
borderCyclePos, borderScheme != borderScheme2);
result = SubstanceImageCreator.getRotated(result, 3);
// System.out.println(key);
SubstanceScrollBarUI.thumbVerticalMap.put(key, result);