public void draw(Graphics2D g, int x, int y)
    {
        if (!visible)
            return;

        Graphics2D tg = (Graphics2D) g.create();

        String fpsText = String.format("%3.2f", cps);
        FontMetrics fm = tg.getFontMetrics();
        
        tg.setColor(Color.DARK_GRAY);
        tg.fillRect(x, 
                y, 
                fm.stringWidth("99.99") + MARGIN * 2, 
                fm.getAscent() + fm.getDescent() + MARGIN * 2);

        tg.setColor(Color.WHITE);
        tg.drawString(fpsText, x + MARGIN, y + MARGIN + fm.getAscent());
        
        tg.dispose();
    }