SubstanceColorScheme colorScheme2,
SubstanceColorScheme borderScheme,
SubstanceColorScheme borderScheme2, boolean paintOnlyBorder) {
SubstanceFillPainter fillPainter = SubstanceCoreUtilities
.getFillPainter(tabPane);
SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
.getBorderPainter(tabPane);
SubstanceButtonShaper shaper = SubstanceCoreUtilities
.getButtonShaper(tabPane);
int borderDelta = (int) Math.ceil(2.0 * SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(tabPane)));
int borderInsets = (int) Math.floor(SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(tabPane)) / 2.0);
int dy = 2 + borderDelta;
Set<Side> straightSides = EnumSet.of(Side.BOTTOM);
int cornerRadius = height / 3;
if (shaper instanceof ClassicButtonShaper) {
cornerRadius = (int) SubstanceSizeUtils
.getClassicButtonCornerRadius(SubstanceSizeUtils
.getComponentFontSize(tabPane));
if ((tabPlacement == TOP) || (tabPlacement == BOTTOM))
width -= 1;
else
height -= 1;
}
GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(width,
height + dy, cornerRadius, straightSides, borderInsets);
BufferedImage result = SubstanceCoreUtilities.getBlankImage(width,
height);
Graphics2D resGraphics = result.createGraphics();
if (!paintOnlyBorder) {
fillPainter.paintContourBackground(resGraphics, tabPane, width,
height + dy, contour, false, colorScheme, colorScheme2,
cyclePos, true, colorScheme != colorScheme2);
}
int borderThickness = (int) SubstanceSizeUtils
.getBorderStrokeWidth(SubstanceSizeUtils
.getComponentFontSize(tabPane));
GeneralPath contourInner = borderPainter.isPaintingInnerContour() ? SubstanceOutlineUtilities
.getBaseOutline(width, height + dy, cornerRadius
- borderThickness, straightSides, borderThickness
+ borderInsets)
: null;
borderPainter.paintBorder(resGraphics, tabPane, width, height + dy,
contour, contourInner, borderScheme, borderScheme2, cyclePos,
borderScheme != borderScheme2);
resGraphics.dispose();
return result;