Revision: 20703
          http://sourceforge.net/p/jmol/code/20703
Author:   hansonr
Date:     2015-08-17 13:28:09 +0000 (Mon, 17 Aug 2015)
Log Message:
-----------
Jmol.___JmolVersion="14.3.16_2015.08.17"

bug fix: PDB reader cuts off long titles.

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java  2015-08-17 
04:56:39 UTC (rev 20702)
+++ trunk/Jmol/src/org/jmol/adapter/readers/pdb/PdbReader.java  2015-08-17 
13:28:09 UTC (rev 20703)
@@ -402,6 +402,7 @@
   }
 
   Map<String, String> htGroup1;
+  private int maxLength = 80;
   
   private String readHeader(boolean getLine) throws Exception {
     if (getLine) {
@@ -523,6 +524,8 @@
     if (lineLength < 8)
       return;
     appendLoadNote(line.substring(7).trim());
+    if (lineLength == 80)
+      maxLength = 72; // old style
     String pdbID = (lineLength >= 66 ? line.substring(62, 66).trim() : "");
     if (pdbID.length() == 4) {
       asc.setCollectionName(pdbID);
@@ -534,10 +537,8 @@
   }
 
   private void title() {
-    if (lineLength > 72)
-      line = line.substring(0, 72);
-    if (lineLength >= 10)
-      appendLoadNote(line.substring(10).trim());
+    if (lineLength > 10)
+      appendLoadNote(line.substring(10, Math.min(maxLength , 
line.length())).trim());
   }
   
   private void compnd(boolean isSource) {

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-17 04:56:39 UTC 
(rev 20702)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2015-08-17 13:28:09 UTC 
(rev 20703)
@@ -56,8 +56,13 @@
 appear at a different location. An interesting challenge to figure out the 
algorithm 
 that still places it in the "proper" place even when perspective is on. 
(Daniele Tomerini)
 
-Jmol.___JmolVersion="14.3.16_2015.08.16"
 
+Jmol.___JmolVersion="14.3.16_2015.08.17"
+
+bug fix: PDB reader cuts off long titles.
+
+JmolVersion="14.3.16_2015.08.16"
+
 run up to full documentation
  
 JmolVersion="14.3.16_2015.08.15"

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