From: <ha...@us...> - 2011-06-27 17:10:12
|
Revision: 15646 http://jmol.svn.sourceforge.net/jmol/?rev=15646&view=rev Author: hansonr Date: 2011-06-27 17:10:05 +0000 (Mon, 27 Jun 2011) Log Message: ----------- version=12.1.51_dev # new feature: LOAD command reports header/title for PDB files # -- specifically when scriptLevel = 0 (typed entry) Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2011-06-27 16:44:08 UTC (rev 15645) +++ trunk/Jmol/src/org/jmol/adapter/readers/cifpdb/PdbReader.java 2011-06-27 17:10:05 UTC (rev 15646) @@ -98,7 +98,8 @@ "REMARK " + //17 "HEADER " + //18 "COMPND " + //19 - "SOURCE "; //20 + "SOURCE " + //20 + "TITLE "; //21 private int serial = 0; private StringBuffer pdbHeader; @@ -110,6 +111,8 @@ atomSetCollection.setIsPDB(); pdbHeader = (getHeader ? new StringBuffer() : null); applySymmetry = !checkFilter("NOSYMMETRY"); + headerTitle = new StringBuffer(); + if (checkFilter("CONF ")) { configurationPtr = parseInt(filter, filter.indexOf("CONF ") + 5); @@ -225,6 +228,9 @@ case 20: compndSource(true); return true; + case 21: + title(); + return true; } return true; } @@ -269,6 +275,8 @@ private void header() { if (lineLength < 8) return; + headerTitle.append(line.substring(7).trim()).append("\n"); + atomSetCollection.setAtomSetCollectionAuxiliaryInfo("modelLoadNote", headerTitle.toString()); if (lineLength >= 66) atomSetCollection.setCollectionName(line.substring(62, 66)); if (lineLength > 50) @@ -276,6 +284,13 @@ atomSetCollection.setAtomSetCollectionAuxiliaryInfo("CLASSIFICATION", line.substring(7).trim()); } + private void title() { + if (lineLength < 10) + return; + headerTitle.append(line.substring(10).trim()).append("\n"); + atomSetCollection.setAtomSetCollectionAuxiliaryInfo("modelLoadNote", headerTitle.toString()); + } + private List<Map<String, String>> vCompnds; private Map<String, String> currentCompnd; private String currentKey; Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2011-06-27 16:44:08 UTC (rev 15645) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollectionReader.java 2011-06-27 17:10:05 UTC (rev 15646) @@ -149,7 +149,8 @@ public boolean iHaveUnitCell; public boolean iHaveSymmetryOperators; public boolean continuing = true; - + protected StringBuffer headerTitle; + protected JmolViewer viewer; // used by GenNBOReader and by CifReader protected boolean doApplySymmetry; Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2011-06-27 16:44:08 UTC (rev 15645) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2011-06-27 17:10:05 UTC (rev 15646) @@ -3274,7 +3274,7 @@ } private void showString(String str, boolean isPrint) { - if (isSyntaxCheck) + if (isSyntaxCheck || str == null) return; if (outputBuffer != null) outputBuffer.append(str).append('\n'); @@ -8731,6 +8731,8 @@ viewer.setAnimationRange(-1, -1); viewer.setCurrentModelIndex(modelCount); } + if (scriptLevel == 0 && !isAppend && nFiles < 2) + showString((String) viewer.getModelSetAuxiliaryInfo("modelLoadNote")); if (logMessages) scriptStatusOrBuffer("Successfully loaded:" + (filenames == null ? htParams.get("fullPathName") : modelName)); Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-06-27 16:44:08 UTC (rev 15645) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2011-06-27 17:10:05 UTC (rev 15646) @@ -3,6 +3,8 @@ version=12.1.51_dev +# new feature: LOAD command reports header/title for PDB files +# -- specifically when scriptLevel = 0 (typed entry) # new feature: isosurface SLAB OFF -- for SLAB n, this turns that slabbing off. # code: much more efficient plane creation and mapping # code: work on isosurface, JVXL, plane mapping This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |