private void setAtomField(String str1, String str2, double x) {
		if (!(model instanceof MolecularModel))
			return;
		MolecularModel m = (MolecularModel) model;
		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.numberOfAtoms) {
			out(ScriptEvent.FAILED, "Atom " + i + " doesn't exisit.");
			return;
		}
		String s = str2.toLowerCase().intern();
		boolean b = true;
		if (s == "color")
			m.atom[i].color = new Color((int) x);
		else if (s == "custom")
			m.atom[i].custom = (float) x;
		else if (s == "id")
			m.atom[i].setElement(m.getElement((int) x));
		else if (s == "rx")
			m.atom[i].rx = x * IR_CONVERTER;
		else if (s == "ry")
			m.atom[i].ry = x * IR_CONVERTER;
		else if (s == "vx")
			m.atom[i].vx = x * IV_CONVERTER;
		else if (s == "vy")
			m.atom[i].vy = x * IV_CONVERTER;
		else if (s == "ax")
			m.atom[i].ax = x;
		else if (s == "ay")
			m.atom[i].ay = x;
		else if (s == "hx")
			m.atom[i].hx = (float) x * R_CONVERTER;
		else if (s == "hy")
			m.atom[i].hy = (float) x * R_CONVERTER;
		else if (s == "charge") {
			m.atom[i].charge = x;
			m.checkCharges();
		} else if (s == "friction")
			m.atom[i].friction = (float) x;
		else if (s == "damp_type")
			m.atom[i].dampType = (byte) x;
		else if (s == "restraint") {
			if (m.atom[i].restraint == null) {
				m.atom[i].restraint = new PointRestraint(x * 0.01, m.atom[i].rx, m.atom[i].ry);
			} else {
				m.atom[i].restraint.k = x * 0.01;
			}
		} else if (s == "restraint.x") {
			if (m.atom[i].restraint != null)
				m.atom[i].restraint.x0 = x * IR_CONVERTER;
		} else if (s == "restraint.y") {
			if (m.atom[i].restraint != null)
				m.atom[i].restraint.y0 = x * IR_CONVERTER;
		} else {
			out(ScriptEvent.FAILED, "Cannot set property: " + str2);
			b = false;
		}
		if (b)
			notifyChange();
	}