}
@Override
public void paintBorder(Component c, Graphics g2, int x, int y, int width, int height) {
Graphics2D g = ((Graphics2D)g2);
final GraphicsConfig config = new GraphicsConfig(g);
g.translate(x, y);
if (UIUtil.isUnderDarcula() || UIUtil.isUnderIntelliJLaF()) {
if (valueSelector.isActive) {
DarculaUIUtil.paintFocusRing(g, 2, 2, width - 4, height - 4);
} else {
boolean editable = valueSelector.isEnabled;
g.setColor(getBorderColor(c.isEnabled() && editable));
g.drawRect(1, 1, width-2, height-2);
g.setColor(UIUtil.getPanelBackground());
g.drawRect(0, 0, width, height);
}
} else {
Border textFieldBorder = UIUtil.getTextFieldBorder();
if (textFieldBorder instanceof LineBorder) {
LineBorder lineBorder = (LineBorder) textFieldBorder;
g.setColor(lineBorder.getLineColor());
} else {
g.setColor(UIUtil.getBorderColor());
}
g.drawRect(1, 1, width - 3, height - 3);
g.setColor(UIUtil.getPanelBackground());
g.drawRect(0, 0, width-1, height-1);
}
g.translate(-x, -y);
config.restore();
}