@Override
    public void paintComponent(Graphics graphics) {
        int viewMode = getGUI().getCurrentViewMode();
        mapEditorPanel.setVisible(false);
        unitInfoPanel.setVisible(false);
        endTurnPanel.setVisible(false);
        tileInfoPanel.setVisible(false);
        if (getFreeColClient().isMapEditor()) {
            mapEditorPanel.setVisible(true);
        } else if (viewMode == GUI.VIEW_TERRAIN_MODE) {
            tileInfoPanel.setVisible(true);
        } else if (unitInfoPanel.getUnit() != null) {
            unitInfoPanel.setVisible(true);
        } else if (getMyPlayer() != null
                   && !getMyPlayer().hasNextActiveUnit()) {
            endTurnPanel.setVisible(true);
        }

        if (useSkin && skin != null) {
            graphics.drawImage(skin, 0, 0, null);
        }

        super.paintComponent(graphics);
    }