public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
boolean active = isActive(c);
int th = getTitleHeight(c);
Color titleColor = AbstractLookAndFeel.getWindowTitleColorLight();
Color borderColor = AbstractLookAndFeel.getWindowBorderColor();
if (!active) {
titleColor = ColorHelper.brighter(titleColor, 20);
borderColor = ColorHelper.brighter(borderColor, 20);
}
g.setColor(titleColor);
g.fillRect(x, y + 1, w, insets.top - 1);
g.setColor(borderColor);
g.fillRect(x + 1, y + h - dw, w - 2, dw - 1);
g.fillRect(1, insets.top + th + 1, dw - 1, h - th - dw);
g.fillRect(w - dw, insets.top + th + 1, dw - 1, h - th - dw);
if (active) {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getWindowTitleColors(), 1, insets.top, dw, th + 1);
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getWindowTitleColors(), w - dw, insets.top, dw, th + 1);
} else {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getWindowInactiveTitleColors(), 1, insets.top, dw, th + 1);
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getWindowInactiveTitleColors(), w - dw, insets.top, dw, th + 1);
}
g.setColor(ColorHelper.darker(borderColor, 15));
g.drawRect(x, y, w - 1, h - 1);
g.drawLine(x + dw - 1, y + insets.top + th, x + dw - 1, y + h - dw);
g.drawLine(x + w - dw, y + insets.top + th, x + w - dw, y + h - dw);
g.drawLine(x + dw - 1, y + h - dw, x + w - dw, y + h - dw);
}
}