Revision: 18507 http://sourceforge.net/p/jmol/code/18507 Author: hansonr Date: 2013-07-29 00:31:59 +0000 (Mon, 29 Jul 2013) Log Message: -----------
Modified Paths: -------------- trunk/Jmol/src/org/jmol/modelset/Measurement.java trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java Modified: trunk/Jmol/src/org/jmol/modelset/Measurement.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/Measurement.java 2013-07-28 17:51:56 UTC (rev 18506) +++ trunk/Jmol/src/org/jmol/modelset/Measurement.java 2013-07-29 00:31:59 UTC (rev 18507) @@ -538,7 +538,9 @@ Atom a1 = (Atom) getAtom(1); Atom a2 = (Atom) getAtom(2); float d = a2.distanceSquared(a1); - String key = (a1.index < a2.index ? a1.getAtomName() + a2.getAtomName() : a2.getAtomName() + a1.getAtomName()); + String n1 = a1.getAtomName(); + String n2 = a2.getAtomName(); + String key = (n1.compareTo(n2) < 0 ? n1 + n2 : n2 + n1); Float min = htMin.get(key); return (min != null && d == min.floatValue()); } Modified: trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java =================================================================== --- trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java 2013-07-28 17:51:56 UTC (rev 18506) +++ trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java 2013-07-29 00:31:59 UTC (rev 18507) @@ -1,4 +1,4 @@ -/* $RCSfile$ + /* $RCSfile$ * $Author: hansonr $ * $Date: 2006-05-13 19:17:06 -0500 (Sat, 13 May 2006) $ * $Revision: 5114 $ @@ -108,7 +108,8 @@ int n = tensors.size(); for (int j = 0; j < n; j++) { Tensor t = tensors.get(j); - if (t.type.equals(type) && t.isSelected(bs, iAtom) + if (t.type.equals(type) + && t.isSelected(bs, iAtom) && (bs2 == null || bs2.get(getOtherAtom(t, iAtom)))) list.addLast(t); @@ -172,12 +173,13 @@ public float getJCouplingHz(Atom a1, Atom a2, String type, Tensor isc) { if (isc == null) { type = getISCtype(a1, type); - if (type == null) + if (type == null || a1.modelIndex != a2.modelIndex) return 0; BS bs = new BS(); BS bs2 = new BS(); - bs.set(a1.index); - bs2.set(a2.index); + int i0 = viewer.modelSet.models[a1.modelIndex].firstAtomIndex - 1; + bs.set(a1.atomSite + i0); + bs2.set(a2.atomSite + i0); JmolList<Tensor> list = getInteractionTensorList(type, bs, bs2); if (list.size() == 0) return Float.NaN; @@ -427,7 +429,8 @@ float d = a2.distanceSquared(a1); if (d == 0) continue; - String key = (i < j ? name + a2.getAtomName() : a2.getAtomName() + name); + String name1 = a2.getAtomName(); + String key = (name.compareTo(name1) < 0 ? name + name1 : name1 + name); Float min = htMin.get(key); if (min == null) { min = Float.valueOf(d); Modified: trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2013-07-28 17:51:56 UTC (rev 18506) +++ trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2013-07-29 00:31:59 UTC (rev 18507) @@ -386,7 +386,7 @@ } private static String plusMinus(String strT, float x, String sx) { - return (x == 0 ? "" : x < 0 ? "-" : strT.length() == 0 ? "" : "+") + sx; + return (x == 0 ? "" : (x < 0 ? "-" : strT.length() == 0 ? "" : "+") + sx); } private static float normalizeTwelfths(float iValue, boolean doNormalize) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits