@Override
    public void repaint(Graphics2D g) {
        if (hoverArea == null) {
            hoverArea = getBounds(g, text);
        }
        if (font == null)
            font = g.getFont();
        if (height == -1 || width == -1) {
            Rectangle2D bounds = font.getStringBounds(text, g.getFontRenderContext());
            height = (height == -1) ? (int) bounds.getHeight() + 5 : height;
            width = (width == -1) ? (int) bounds.getWidth() + 5 : width;
        }
        Paint p = g.getPaint();
        metrics = g.getFontMetrics(font);
        if (!hovered)
            g.setPaint(new GradientPaint(x, y, colorScheme.main1, x, y + height, colorScheme.main2));
        else
            g.setPaint(new GradientPaint(x, y, colorScheme.main2, x, y + height, colorScheme.main1));
        g.fillRect(x, y, width, height);

        g.setPaint(p);
        g.setColor(colorScheme.main2);
        g.drawRect(x, y, width - 1, height);

        g.setColor(colorScheme.text);
        g.setFont(font);
        g.drawString(text,
                     (x + (width / 2) - (metrics.stringWidth(text) / 2)),
                     y + (height / 2) + (int) (metrics.getMaxAscent() / (font.getSize() / 4.5)));

        g.setColor(new Color(255, 255, 255, 65));
        g.fillRect(x + 1, (y + 1), width - 2, (int) (height / 2.333));
    }