@Override
    public void paint(Graphics g) {
        Rectangle clipArea = g.getClipBounds();
        if (clipArea == null) {
            clipArea = getBounds();
            clipArea.x = clipArea.y = 0;
        }
        if (clipArea.isEmpty()) {
            // we are done - the picture is OK
            return;
        }
        g.setColor(MASK_COLOR);
        g.fillRect(clipArea.x, clipArea.y, clipArea.width, clipArea.height);

        if (player == null) {
            // we are done, no player information
            return;
        }

        ImageIcon coatOfArmsIcon = imageLibrary
                .getCoatOfArmsImageIcon(player.getNation());

        Rectangle iconBounds = new Rectangle();
        if (coatOfArmsIcon != null) {
            iconBounds.width = coatOfArmsIcon.getIconWidth();
            iconBounds.height = coatOfArmsIcon.getIconHeight();
        }

        Font nameFont = getFont();
        FontMetrics nameFontMetrics = getFontMetrics(nameFont);
        StringTemplate t = StringTemplate.template("waitingFor")
            .addStringTemplate("%nation%", player.getNationName());
        String message = Messages.message(t);

        Rectangle textBounds;
        int fontSize = DEFAULT_FONT_SIZE;
        int maxWidth = Math.min(MAX_TEXT_WIDTH, getSize().width);
        do {
            nameFont = nameFont.deriveFont(Font.BOLD, fontSize);
            nameFontMetrics = getFontMetrics(nameFont);
            textBounds = nameFontMetrics.getStringBounds(message, g)
                    .getBounds();
            fontSize -= FONT_SIZE_DECREMENT;
        } while (textBounds.width > maxWidth);

        Dimension size = getSize();
        textBounds.x = (size.width - textBounds.width) / 2;
        textBounds.y = size.height - InfoPanel.PANEL_HEIGHT - 2 * textBounds.height;

        iconBounds.x = (size.width - iconBounds.width) / 2;
        iconBounds.y = textBounds.y + 3 * textBounds.height / 2;

        if (textBounds.intersects(clipArea)) {
            // show message
            g.setFont(nameFont);
            g.setColor(imageLibrary.getColor(player));
            g.drawString(message, textBounds.x, textBounds.y
                    + textBounds.height);
        }
        if (coatOfArmsIcon != null && iconBounds.intersects(clipArea)) {
            // show icon
            coatOfArmsIcon.paintIcon(this, g, iconBounds.x, iconBounds.y);
        }
    }