From: <ha...@us...> - 2010-02-28 15:44:05
|
Revision: 12515 http://jmol.svn.sourceforge.net/jmol/?rev=12515&view=rev Author: hansonr Date: 2010-02-28 15:43:58 +0000 (Sun, 28 Feb 2010) Log Message: ----------- version=11.9.32_dev # new feature: readers can now assign atomic data for atoms of the "property_" type # implemented for property_spin and property_magneticMoment in CrystalReader Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java Modified: trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2010-02-28 14:27:58 UTC (rev 12514) +++ trunk/Jmol/src/org/jmol/adapter/smarter/AtomSetCollection.java 2010-02-28 15:43:58 UTC (rev 12515) @@ -23,6 +23,7 @@ */ package org.jmol.adapter.smarter; +import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; import java.util.Properties; @@ -802,6 +803,8 @@ pt = symmetryAddAtoms(iAtomFirst, noSymmetryCount, tx, ty, tz, cell555Count, pt, iCell * operationCount); } + if (iCell * noSymmetryCount == atomCount - iAtomFirst) + appendAtomProperties(iCell); if (operationCount > 0) { String[] symmetryList = new String[operationCount]; for (int i = 0; i < operationCount; i++) @@ -1248,9 +1251,27 @@ Hashtable p = (Hashtable) getAtomSetAuxiliaryInfo(currentAtomSetIndex, "atomProperties"); if (p == null) setAtomSetAuxiliaryInfo("atomProperties", p = new Hashtable()); + if (!data.endsWith("\n")) + data += "\n"; p.put(key, data); } + private void appendAtomProperties(int nTimes) { + Hashtable p = (Hashtable) getAtomSetAuxiliaryInfo(currentAtomSetIndex, "atomProperties"); + if (p == null) + return; + Enumeration e = p.keys(); + while (e.hasMoreElements()) { + String key = (String) e.nextElement(); + String data = (String) p.get(key); + StringBuffer s = new StringBuffer(); + for (int i = nTimes; --i >= 0; ) + s.append(data); + p.put(key, s.toString()); + } + } + + /** * Sets auxiliary information for the AtomSet * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |