Package org.openscience.cdk.io

Examples of org.openscience.cdk.io.SDFWriter


        if (molecules.size() > 0) {
          IAtomContainerSet molSet = molecules.get(0).getBuilder().newInstance(IAtomContainerSet.class);
          for (IAtomContainer mol : molecules) {
            molSet.addAtomContainer(mol);
          }
          SDFWriter sdfWriter = new SDFWriter(new FileWriter(outFile));
          sdfWriter.write(molSet);
          sdfWriter.close();
        }
      } catch (Exception e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(jcpPanel, GT.get("There was an error generating the configurations {0}", e.getMessage()));
        return;
View Full Code Here


        return theMoleculeList;
    }

    public static void writeMDLFile(String theFileName, java.util.List<IMolecule> theMoleculeList) {
        try {
            SDFWriter theWriter = new SDFWriter(new FileWriter(theFileName));
            for (IMolecule theMolecule : theMoleculeList) {
                theWriter.write(theMolecule);
            }
            theWriter.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.io.SDFWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.