Revision: 20681
          http://sourceforge.net/p/jmol/code/20681
Author:   hansonr
Date:     2015-08-08 17:53:35 +0000 (Sat, 08 Aug 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.2.15_2015.08.08"

new feature: load "test.pdb" from write property atomno temperature now 
restores values for atomno and temperature for points on plot 

bug fix: "print stateVersion" not reporting as documented. 
bug fix: write property atomno temperature "test.pdb" does not preserve long 
residue names from CIF files or long atom names from other file types 

Modified Paths:
--------------
    branches/v14_2/Jmol/src/org/jmol/scriptext/CmdExt.java
    branches/v14_2/Jmol/src/org/jmol/viewer/GlobalSettings.java
    branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
    branches/v14_2/Jmol/src/org/jmol/viewer/PropertyManager.java

Modified: branches/v14_2/Jmol/src/org/jmol/scriptext/CmdExt.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/scriptext/CmdExt.java      2015-08-07 
18:05:21 UTC (rev 20680)
+++ branches/v14_2/Jmol/src/org/jmol/scriptext/CmdExt.java      2015-08-08 
17:53:35 UTC (rev 20681)
@@ -2892,13 +2892,14 @@
       eval.iToken = pt0 + 1;
       for (int i = 0; i < 3; i++) {
         switch (tokAt(eval.iToken)) {
+        case T.nada:
         case T.format:
         case T.min:
         case T.max:
           i = 2;
           continue;
         }
-        if (!T.tokAttr(propToks[i] = tokAt(eval.iToken), T.atomproperty))
+        if ((propToks[i] = tokAt(eval.iToken)) != T.property && 
!T.tokAttr(propToks[i], T.atomproperty))
           invArg();
         props[i] = getToken(eval.iToken).value.toString();
         eval.iToken++;
@@ -2985,22 +2986,23 @@
     // prepare data for property plotting
 
     float[] dataX = null, dataY = null, dataZ = null;
+    String[] propData = new String[3];
     if (tok == T.property) {
       dataX = getBitsetPropertyFloat(bs, propToks[0] | T.selectedfloat,
           propToks[0] == T.property? props[0] : null, (minXYZ == null ? 
Float.NaN : minXYZ.x), (maxXYZ == null ? Float.NaN
               : maxXYZ.x));
-      props[0] = props[0] + " " + Escape.eAF(dataX);
+      propData[0] = props[0] + " " + Escape.eAF(dataX);
       if (props[1] != null) {
         dataY = getBitsetPropertyFloat(bs, propToks[1] | T.selectedfloat,
             propToks[1] == T.property? props[1] : null, (minXYZ == null ? 
Float.NaN : minXYZ.y),
             (maxXYZ == null ? Float.NaN : maxXYZ.y));
-        props[1] = props[1] + " " + Escape.eAF(dataY);
+        propData[1] = props[1] + " " + Escape.eAF(dataY);
       }
       if (props[2] != null) {
         dataZ = getBitsetPropertyFloat(bs, propToks[2] | T.selectedfloat,
             propToks[2] == T.property? props[2] : null, (minXYZ == null ? 
Float.NaN : minXYZ.z),
             (maxXYZ == null ? Float.NaN : maxXYZ.z));
-        props[2] = props[2] + " " + Escape.eAF(dataZ);
+        propData[2] = props[2] + " " + Escape.eAF(dataZ);
       }
       if (minXYZ == null)
         minXYZ = P3.new3(getPlotMinMax(dataX, false, propToks[0]),
@@ -3050,7 +3052,7 @@
             dataZ[i] = (dataZ[i] - center.z) / factors.z;
       }
       parameters = new Object[] { bs, dataX, dataY, dataZ, minXYZ, maxXYZ,
-          factors, center, format, props};
+          factors, center, format, propData};
     }
 
     // all set...

Modified: branches/v14_2/Jmol/src/org/jmol/viewer/GlobalSettings.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/GlobalSettings.java 2015-08-07 
18:05:21 UTC (rev 20680)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/GlobalSettings.java 2015-08-08 
17:53:35 UTC (rev 20681)
@@ -140,7 +140,7 @@
       setI("spinFps", TransformManager.DEFAULT_SPIN_FPS);
       setF("visualRange", TransformManager.DEFAULT_VISUAL_RANGE);
       setI("stereoDegrees", TransformManager.DEFAULT_STEREO_DEGREES);
-      setI("stateversion", 0); // only set by a saved state being recalled
+      //setI("stateversion", 0); // only set by a saved state being recalled
       setB("syncScript", vwr.sm.syncingScripts);
       setB("syncMouse", vwr.sm.syncingMouse);
       setB("syncStereo", vwr.sm.stereoSync);

Modified: branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-08-07 
18:05:21 UTC (rev 20680)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/Jmol.properties     2015-08-08 
17:53:35 UTC (rev 20681)
@@ -6,11 +6,13 @@
 
 # see also http://chemapps.stolaf.edu/jmol/zip for daily updates
        
-Jmol.___JmolVersion="14.2.15_2015.08.07"
+Jmol.___JmolVersion="14.2.15_2015.08.08"
 
-bug fix: write property atomno temperature "test.pdb" preserves long residue 
names from CIF files 
-bug fix: load "test.pdb" from write property atomno temperature  restores 
values for atomno and temperature 
+new feature: load "test.pdb" from write property atomno temperature now 
restores values for atomno and temperature for points on plot 
 
+bug fix: "print stateVersion" not reporting as documented. 
+bug fix: write property atomno temperature "test.pdb" does not preserve long 
residue names from CIF files or long atom names from other file types 
+
 JmolVersion="14.2.15_2015.08.06"
 
 bug fix: stereo setting should not be saved in state. 

Modified: branches/v14_2/Jmol/src/org/jmol/viewer/PropertyManager.java
===================================================================
--- branches/v14_2/Jmol/src/org/jmol/viewer/PropertyManager.java        
2015-08-07 18:05:21 UTC (rev 20680)
+++ branches/v14_2/Jmol/src/org/jmol/viewer/PropertyManager.java        
2015-08-08 17:53:35 UTC (rev 20681)
@@ -1837,15 +1837,15 @@
         );
       else if (isHetero)
         tokens = (leftJustify ? LabelToken.compile(vwr,
-            "HETATM%5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E   _XYZ_"
+            "HETATM%5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"
                 + occTemp, '\0', null) : LabelToken.compile(vwr,
-            "HETATM%5.-5i  %-3.3a%1A%3.-3n %1c%4.-4R%1E   _XYZ_"
+            "HETATM%5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"
                 + occTemp, '\0', null));
       else
         tokens = (leftJustify ? LabelToken.compile(vwr,
-            "ATOM  %5.-5i %-4.4a%1A%3.-3n %1c%4.-4R%1E   _XYZ_"
+            "ATOM  %5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"
                 + occTemp, '\0', null) : LabelToken.compile(vwr,
-            "ATOM  %5.-5i  %-3.3a%1A%3.-3n %1c%4.-4R%1E   _XYZ_"
+            "ATOM  %5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"
                 + occTemp, '\0', null));
       String XX = a.getElementSymbolIso(false).toUpperCase();
       XX = pdbKey(a.group.getBioPolymerIndexInModel())
@@ -1960,19 +1960,22 @@
     }
   }
 
+//
+//  /**
+//   * PDB line sorter 
+//   * @param s1 
+//   * @param s2 
+//   * @return -1, 0, or 1
+//   */
+//  public int compare(String s1, String s2) {
+//    int atA = PT.parseInt(s1.substring(10, 16));
+//    int atB = PT.parseInt(s2.substring(10, 16));
+//    int resA = PT.parseInt(s1.substring(26, 30));
+//    int resB = PT.parseInt(s2.substring(26, 30));
+//    return (resA < resB ? -1 : resA > resB ? 1 : atA < atB ? -1
+//        : atA > atB ? 1 : 0);
+//  }
 
-  /**
-   * PDB line sorter 
-   */
-  public int compare(String s1, String s2) {
-    int atA = PT.parseInt(s1.substring(10, 16));
-    int atB = PT.parseInt(s2.substring(10, 16));
-    int resA = PT.parseInt(s1.substring(26, 30));
-    int resB = PT.parseInt(s2.substring(26, 30));
-    return (resA < resB ? -1 : resA > resB ? 1 : atA < atB ? -1
-        : atA > atB ? 1 : 0);
-  }
-
   /* **********************
    * 
    * Jmol Data Frame methods
@@ -2024,12 +2027,27 @@
       Atom[] atoms = vwr.ms.at;
       if (isPDBFormat) {
         out.append("REMARK   6 Jmol PDB-encoded data: ").append(type)
-            .append(";\n");
+            .append("; ").append(Viewer.getJmolVersion()).append("; 
").append(vwr.apiPlatform.getDateFormat(null)).append("\n");
         out.append("REMARK   6 Jmol data").append(" min = ")
             .append(Escape.eP(minXYZ)).append(" max = ")
             .append(Escape.eP(maxXYZ)).append(" unScaledXyz = xyz * ")
             .append(Escape.eP(factors)).append(" + ").append(Escape.eP(center))
             .append(";\n");
+        String atomNames = null;
+        for (int i = bsAtoms.nextSetBit(0); i >= 0; i = bsAtoms
+            .nextSetBit(i + 1)) {
+          String name = "" + atoms[i].getAtomName();
+          if (atomNames != null || name.length() > 4) {
+            if (atomNames == null) {
+              atomNames = "";
+              i = -1;
+              continue;
+            }
+            atomNames += " " + name;
+          }
+        }
+        if (atomNames != null)
+          out.append("REMARK   6 Jmol atom 
names").append(atomNames).append("\n");
         String resNames = null;
         for (int i = bsAtoms.nextSetBit(0); i >= 0; i = bsAtoms
             .nextSetBit(i + 1)) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to