private void setObstacleField(String str1, String str2, double x) {
		if (!(model instanceof MolecularModel))
			return;
		MolecularModel m = (MolecularModel) model;
		if (m.obstacles == null)
			return;
		int lb = str1.indexOf("[");
		int rb = str1.indexOf("]");
		double z = parseMathExpression(str1.substring(lb + 1, rb));
		if (Double.isNaN(z))
			return;
		int i = (int) Math.round(z);
		if (i < 0 || i >= m.obstacles.size()) {
			out(ScriptEvent.FAILED, "Obstacle " + i + " doesn't exisit.");
			return;
		}
		RectangularObstacle obs = m.obstacles.get(i);
		String s = str2.toLowerCase().intern();
		boolean b = true;
		if (s == "x")
			obs.translateTo(x * IR_CONVERTER, obs.y);
		else if (s == "y")
			obs.translateTo(obs.x, x * IR_CONVERTER);
		else if (s == "width")
			obs.setRect(obs.x, obs.y, x * IR_CONVERTER, obs.height);
		else if (s == "height")
			obs.setRect(obs.x, obs.y, obs.width, x * IR_CONVERTER);
		else if (s == "vx")
			obs.setVx(x * IV_CONVERTER);
		else if (s == "vy")
			obs.setVy(x * IV_CONVERTER);
		else if (s == "custom")
			obs.custom = (float) x;
		else if (s == "density")
			obs.setDensity(x * 0.01);
		else if (s == "friction")
			obs.setFriction((float) x);
		else if (s == "hx")
			obs.setHx((float) (x * 0.001));
		else if (s == "hy")
			obs.setHy((float) (x * 0.001));
		else if (s == "externalfx") // deprecated
			obs.setHx((float) (x * 0.001));
		else if (s == "externalfy") // deprecated
			obs.setHy((float) (x * 0.001));
		else if (s == "elasticity") {
			if (x > 1)
				x = 1;
			else if (x < 0)
				x = 0;
			obs.setElasticity((float) x);
		} else {
			out(ScriptEvent.FAILED, "Cannot set property: " + str2);
			b = false;
		}
		if (b)
			notifyChange();
	}