public void setViewAngle(byte i) {
		synchronized (lock) {
			viewAngle = i;
		}
		int delta = 5;
		switch (viewAngle) {
		case FRONT_VIEW:
			// special treatment because the rotation center is that of the atom set but not the box center
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(0, 0, model.getHeight() + delta);
			}
			else {
				viewer.frontView(model.getHeight());
			}
			break;
		case BACK_VIEW:
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(0, 0, -(model.getHeight() + delta));
				viewer.evalStringQuiet("moveto 0 back");
			}
			else {
				viewer.backView(-model.getHeight());
			}
			break;
		case TOP_VIEW:
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(0, (model.getWidth() + delta), 0);
				viewer.evalStringQuiet("moveto 0 top");
			}
			else {
				viewer.topView(model.getWidth());
			}
			break;
		case BOTTOM_VIEW:
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(0, -(model.getWidth() + delta), 0);
				viewer.evalStringQuiet("moveto 0 bottom");
			}
			else {
				viewer.bottomView(model.getWidth());
			}
			break;
		case LEFT_VIEW:
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(-(model.getLength() + delta), 0, 0);
				viewer.evalStringQuiet("moveto 0 left");
			}
			else {
				viewer.leftView(model.getLength());
			}
			break;
		case RIGHT_VIEW:
			if (viewer.getNavigationMode()) {
				viewer.runScriptImmediatelyWithoutThread("reset");
				viewer.setCameraPosition(model.getLength() + delta, 0, 0);
				viewer.evalStringQuiet("moveto 0 right");
			}
			else {
				viewer.rightView(model.getLength());
			}
			break;
		}
	}