From: <ha...@us...> - 2009-04-10 02:01:04
|
Revision: 10788 http://jmol.svn.sourceforge.net/jmol/?rev=10788&view=rev Author: hansonr Date: 2009-04-10 01:48:19 +0000 (Fri, 10 Apr 2009) Log Message: ----------- version=11.7.32_dev ZIP file reading problems # bug fix: reading multiple files from a ZIP file collection, Jmol was forcing autobond # even when bonds were defined # bug fix: load MANIFEST not working properly Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/SmarterJmolAdapter.java trunk/Jmol/src/org/jmol/modelset/ModelLoader.java Modified: trunk/Jmol/src/org/jmol/adapter/smarter/SmarterJmolAdapter.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/SmarterJmolAdapter.java 2009-04-09 18:30:16 UTC (rev 10787) +++ trunk/Jmol/src/org/jmol/adapter/smarter/SmarterJmolAdapter.java 2009-04-10 01:48:19 UTC (rev 10788) @@ -165,8 +165,12 @@ // or we are opening a zip file. boolean doCombine = (subFilePtr == 1); - int selectedFile = (htParams != null && htParams.containsKey("modelNumber") ? - ((Integer)htParams.get("modelNumber")).intValue() : Integer.MAX_VALUE); + int selectedFile = 0; + if (htParams != null && htParams.containsKey("modelNumber")) { + selectedFile = ((Integer)htParams.get("modelNumber")).intValue(); + if(selectedFile > 0 && doCombine) + htParams.remove("modelNumber"); + } String[] subFileList = (htParams == null ? null : (String[]) htParams .get("subFileList")); if (subFileList == null) @@ -177,9 +181,6 @@ if (subFileName != null && (subFileName.startsWith("/") || subFileName.startsWith("\\"))) subFileName = subFileName.substring(1); - //if (selectedFile > 0 && doCombine && params != null) - //params[0] = 0; would set next find to "all models" - //TODO -- why? -- because it could be a zip file // zipDirectory[0] is the manifest if present String manifest = (htParams == null ? null : (String) htParams @@ -192,8 +193,6 @@ Logger.info("manifest for " + fileName + ":\n" + manifest); manifest = '|' + manifest.replace('\r', '|').replace('\n', '|') + '|'; } - if (selectedFile == Integer.MAX_VALUE) - selectedFile = (haveManifest ? -1 : 1); boolean ignoreErrors = (manifest.indexOf("IGNORE_ERRORS") >= 0); boolean selectAll = (manifest.indexOf("IGNORE_MANIFEST") >= 0); boolean exceptFiles = (manifest.indexOf("EXCEPT_FILES") >= 0); Modified: trunk/Jmol/src/org/jmol/modelset/ModelLoader.java =================================================================== --- trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2009-04-09 18:30:16 UTC (rev 10787) +++ trunk/Jmol/src/org/jmol/modelset/ModelLoader.java 2009-04-10 01:48:19 UTC (rev 10788) @@ -937,7 +937,7 @@ autoBond(bs, bs, bsExclude, null); Logger.info("ModelSet: autobonding; use autobond=false to not generate bonds automatically"); } else { - Logger.info("ModelSet: not autobonding; use forceAutobond=true to force automatic bond creation"); + Logger.info("ModelSet: not autobonding; use forceAutobond=true to force automatic bond creation"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |