public void changeViewMode(int newViewMode) {

        if (newViewMode == currentMode) {
            logger.warning("Trying to change to the same view mode");
            return;
        }

        currentMode = newViewMode;

        switch (currentMode) {
        case GUI.MOVE_UNITS_MODE:
            if (getActiveUnit() == null) {
                setActiveUnit(savedActiveUnit);
            }
            savedActiveUnit = null;
            logger.warning("Change view to Move Units Mode");
            break;
        case GUI.VIEW_TERRAIN_MODE:
            savedActiveUnit = activeUnit;
            setActiveUnit(null);
            logger.warning("Change view to View Terrain Mode");
            break;
        }
    }