public static void paintBorder(Component c, Graphics2D graphics, int x,
int y, int width, int height, float radius,
SubstanceColorScheme borderScheme1,
SubstanceColorScheme borderScheme2, float cyclePos) {
SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
.getBorderPainter(c);
graphics.translate(x, y);
int componentFontSize = SubstanceSizeUtils.getComponentFontSize(c);
int borderDelta = (int) Math.floor(SubstanceSizeUtils
.getBorderStrokeWidth(componentFontSize) / 2.0);
Shape contour = SubstanceOutlineUtilities.getBaseOutline(width, height,
radius, null, borderDelta);
int borderThickness = (int) SubstanceSizeUtils
.getBorderStrokeWidth(componentFontSize);
GeneralPath contourInner = (c instanceof JTextComponent) ? null
: SubstanceOutlineUtilities.getBaseOutline(width, height,
radius - borderThickness, null, borderThickness
+ borderDelta);
borderPainter.paintBorder(graphics, c, width, height, contour,
contourInner, borderScheme1, borderScheme2, cyclePos,
borderScheme1 != borderScheme2);
graphics.translate(-x, -y);
}