From: Egon W. <eg...@us...> - 2002-05-17 14:59:08
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol In directory usw-pr-cvs1:/tmp/cvs-serv3925/src/org/openscience/jmol Modified Files: ChemFrame.java JMolCDO.java Log Message: Have JmolCDO accept partial atomic charges as they are now read in the new cdk-cml library. Index: ChemFrame.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/ChemFrame.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** ChemFrame.java 17 May 2002 07:39:39 -0000 1.37 --- ChemFrame.java 17 May 2002 14:59:05 -0000 1.38 *************** *** 323,326 **** --- 323,327 ---- atoms[i] = atoms[i+1]; } + atoms[numberAtoms-1] = null; numberAtoms--; try { Index: JMolCDO.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/JMolCDO.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** JMolCDO.java 14 May 2002 15:28:36 -0000 1.17 --- JMolCDO.java 17 May 2002 14:59:05 -0000 1.18 *************** *** 34,37 **** --- 34,38 ---- private String atomY; private String atomZ; + private String partialCharge; public JMolCDO() { *************** *** 162,165 **** --- 163,167 ---- atomY = ""; atomZ = ""; + partialCharge = ""; } *************** *** 170,174 **** double z = FortranFormat.atof(atomZ.trim()); try { ! currentFrame.addAtom(atomType.trim(), (float) x, (float) y, (float) z); } catch (Exception e) { System.out.println("JMolCDO error while adding atom: " + e); --- 172,183 ---- double z = FortranFormat.atof(atomZ.trim()); try { ! int index = currentFrame.addAtom(atomType.trim(), (float) x, (float) y, (float) z); ! if (partialCharge.length() > 0) { ! System.out.println("Adding charge for atom " + index); ! double c = FortranFormat.atof(partialCharge); ! currentFrame.getAtomAt(index).addProperty(new Charge(c)); ! } else { ! System.out.println("Not adding charge for atom " + index); ! } } catch (Exception e) { System.out.println("JMolCDO error while adding atom: " + e); *************** *** 189,192 **** --- 198,204 ---- if (type.equals("z3")) { atomZ = value; + } + if (type.equals("partialCharge")) { + partialCharge = value; } } |