private static BufferedImage getThumbHorizontal(JScrollBar scrollBar,
int width, int height, float cyclePos, SubstanceColorScheme scheme,
SubstanceColorScheme scheme2, float borderCyclePos,
SubstanceColorScheme borderScheme,
SubstanceColorScheme borderScheme2) {
SubstanceFillPainter painter = SubstanceCoreUtilities
.getFillPainter(scrollBar);
SubstanceButtonShaper shaper = SubstanceCoreUtilities
.getButtonShaper(scrollBar);
SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
.getBorderPainter(scrollBar);
// GripPainter gripPainter = SubstanceCoreUtilities.getGripPainter(
// scrollBar, null);
// System.out.println(state.name());
HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
scheme.getDisplayName(), scheme2.getDisplayName(), borderScheme
.getDisplayName(), borderScheme2.getDisplayName(),
cyclePos, borderCyclePos, painter.getDisplayName(), shaper
.getDisplayName(), borderPainter.getDisplayName());
// + ":"
// + ((gripPainter != null) ? gripPainter.getDisplayName()
// : "null");
float radius = height / 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(width,
height, radius, null, borderDelta);
BufferedImage opaque = SubstanceScrollBarUI.thumbHorizontalMap.get(key);
if (opaque == null) {
// System.out.println("New image for horizontal thumb");
opaque = SubstanceCoreUtilities.getBlankImage(width, height);
painter.paintContourBackground(opaque.createGraphics(), scrollBar,
width, height, contour, false, scheme, scheme2, cyclePos,
true, scheme != scheme2);
// int borderThickness = (int) SubstanceSizeUtils
// .getBorderStrokeWidth(SubstanceSizeUtils