boolean setBooleanProperty(String key, boolean value, boolean defineNew) {
		boolean notFound = false;
		while (true) {
			if (key.equalsIgnoreCase("refreshing")) {
				setRefreshing(value);
				break;
			}
			if (key.equalsIgnoreCase("navigationMode")) {
				setNavigationMode(value);
				break;
			}
			if (key.equalsIgnoreCase("justifyMeasurements")) {
				setJustifyMeasurements(value);
				break;
			}
			if (key.equalsIgnoreCase("ssBondsBackbone")) {
				setSsbondsBackbone(value);
				break;
			}
			if (key.equalsIgnoreCase("hbondsBackbone")) {
				setHbondsBackbone(value);
				break;
			}
			if (key.equalsIgnoreCase("hbondsSolid")) {
				setHbondsSolid(value);
				break;
			}
			if (key.equalsIgnoreCase("specular")) {
				setSpecular(value);
				break;
			}
			if (key.equalsIgnoreCase("slabEnabled")) {
				setSlabEnabled(value);
				break;
			}
			if (key.equalsIgnoreCase("zoomEnabled")) {
				setZoomEnabled(value);
				break;
			}
			if (key.equalsIgnoreCase("solvent")) {
				setSolventOn(value);
				break;
			}
			if (key.equalsIgnoreCase("highResolution")) {
				setHighResolution(value);
				break;
			}
			if (key.equalsIgnoreCase("traceAlpha")) {
				setTraceAlpha(value);
				break;
			}
			if (key.equalsIgnoreCase("zoomLarge")) {
				setZoomLarge(value);
				break;
			}
			if (key.equalsIgnoreCase("languageTranslation")) {
				GT.setDoTranslate(value);
				break;
			}
			if (key.equalsIgnoreCase("hideNotSelected")) {
				setHideNotSelected(value);
				break;
			}
			if (key.equalsIgnoreCase("colorRasmol")) {
				setDefaultColors(value ? "rasmol" : "jmol");
				break;
			}
			if (key.equalsIgnoreCase("perspectiveDepth")) {
				setPerspectiveDepth(value);
				break;
			}
			if (key.equalsIgnoreCase("scriptQueue")) {
				scriptManager.setQueue(value);
				break;
			}
			if (key.equalsIgnoreCase("dotSurface")) {
				setDotSurfaceFlag(value);
				break;
			}
			if (key.equalsIgnoreCase("dotsSelectedOnly")) {
				setDotsSelectedOnlyFlag(value);
				break;
			}
			if (key.equalsIgnoreCase("showAxes")) { // deprecated -- see "axes" command
				setShapeShow(JmolConstants.SHAPE_AXES, value);
				break;
			}
			if (key.equalsIgnoreCase("showBoundBox")) { // deprecated -- see "boundBox"
				setShapeShow(JmolConstants.SHAPE_BBCAGE, value);
				break;
			}
			if (key.equalsIgnoreCase("showUnitcell")) { // deprecated -- see "unitcell"
				setShapeShow(JmolConstants.SHAPE_UCCAGE, value);
				break;
			}
			if (key.equalsIgnoreCase("selectionHalos")) {
				setSelectionHaloEnabled(value); // volatile
				break;
			}
			if (key.equalsIgnoreCase("debugScript")) {
				setDebugScript(value);
				break;
			}
			if (key.equalsIgnoreCase("frank")) {
				setFrankOn(value);
				break;
			}
			if (key.equalsIgnoreCase("showHydrogens")) {
				setShowHydrogens(value);
				break;
			}
			if (key.equalsIgnoreCase("defaultSelectHydrogen")) {
				setRasmolHydrogenSetting(value);
				break;
			}
			if (key.equalsIgnoreCase("defaultSelectHetero")) {
				setRasmolHeteroSetting(value);
				break;
			}
			if (key.equalsIgnoreCase("showMultipleBonds")) {
				setShowMultipleBonds(value);
				break;
			}
			if (key.equalsIgnoreCase("showHiddenSelectionHalos")) {
				setShowHiddenSelectionHalos(value);
				break;
			}
			if (key.equalsIgnoreCase("showMeasurements")) {
				setShowMeasurements(value);
				break;
			}
			if (key.equalsIgnoreCase("axesOrientationRasmol")) {
				setAxesOrientationRasmol(value);
				break;
			}
			if (key.equalsIgnoreCase("windowCentered")) {
				setWindowCentered(value);
				break;
			}
			if (key.equalsIgnoreCase("adjustCamera")) {
				setAdjustCamera(value);
				break;
			}
			if (key.equalsIgnoreCase("axesWindow")) {
				setAxesModeMolecular(!value);
				break;
			}
			if (key.equalsIgnoreCase("axesMolecular")) {
				setAxesModeMolecular(value);
				break;
			}
			if (key.equalsIgnoreCase("axesUnitCell")) {
				setAxesModeUnitCell(value);
				break;
			}
			if (key.equalsIgnoreCase("displayCellParameters")) {
				setDisplayCellParameters(value);
				break;
			}
			if (key.equalsIgnoreCase("testFlag1")) {
				setTestFlag1(value);
				break;
			}
			if (key.equalsIgnoreCase("testFlag2")) {
				setTestFlag2(value);
				break;
			}
			if (key.equalsIgnoreCase("testFlag3")) {
				setTestFlag3(value);
				break;
			}
			if (key.equalsIgnoreCase("testFlag4")) {
				setTestFlag4(value);
				break;
			}
			if (key.equalsIgnoreCase("ribbonBorder")) {
				setRibbonBorder(value);
				break;
			}
			if (key.equalsIgnoreCase("cartoonRockets")) {
				setCartoonRocketFlag(value);
				break;
			}
			if (key.equalsIgnoreCase("greyscaleRendering")) {
				setGreyscaleRendering(value);
				break;
			}
			// these next are deprecated because they don't
			// give much indication what they really do:
			if (key.equalsIgnoreCase("bonds")) {
				return setBooleanProperty("showMultipleBonds", value, true);
			}
			if (key.equalsIgnoreCase("hydrogen")) { // deprecated
				return setBooleanProperty("defaultSelectHydrogen", value, true);
			}
			if (key.equalsIgnoreCase("hetero")) { // deprecated
				return setBooleanProperty("defaultSelectHetero", value, true);
			}
			if (key.equalsIgnoreCase("showSelections")) { // deprecated -- see "selectionHalos"
				return setBooleanProperty("selectionHalos", value, true);
			}
			// these next return, because there is no need to repaint
			while (true) {
				if (key.equalsIgnoreCase("bondModeOr")) {
					setBondSelectionModeOr(value);
					break;
				}
				if (key.equalsIgnoreCase("zeroBasedXyzRasmol")) {
					setZeroBasedXyzRasmol(value);
					break;
				}
				if (key.equalsIgnoreCase("rangeSelected")) {
					setRangeSelected(value);
					break;
				}
				if (key.equalsIgnoreCase("cameraMove")) {
					setAllowCameraMove(value);
					break;
				}
				if (key.equalsIgnoreCase("measureAllModels")) {
					setMeasureAllModels(value);
					break;
				}
				if (key.equalsIgnoreCase("statusReporting")) {
					setAllowStatusReporting(value);
					break;
				}
				if (key.equalsIgnoreCase("chainCaseSensitive")) {
					setChainCaseSensitive(value);
					break;
				}
				if (key.equalsIgnoreCase("hideNameInPopup")) {
					setHideNameInPopup(value);
					break;
				}
				if (key.equalsIgnoreCase("autobond")) {
					setAutoBond(value);
					break;
				}
				if (key.equalsIgnoreCase("disablePopupMenu")) {
					setDisablePopupMenu(value);
					break;
				}
				if (key.equalsIgnoreCase("forceAutoBond")) {
					setForceAutoBond(value);
					break;
				}
				notFound = true;
				break;
			}
			if (!defineNew)
				return !notFound;
			if (!notFound) {
				global.setPropertyFlag(key, value);
				return true;
			}
			notFound = true;
			break;
		}
		if (!defineNew)
			return !notFound;
		if (notFound) {
			if (!value && !global.htPropertyFlags.containsKey(key)) {
				Logger.error("viewer.setBooleanProperty(" + key + "," + value + ") - unrecognized SET option");
				scriptStatus("Script ERROR: unrecognized SET option: set " + key);
				return false;
			}
		}
		global.setPropertyFlag(key, value);
		if (notFound)
			return false;
		setTainted(true);
		refresh(0, "viewer.setBooleanProperty");
		return true;
	}