Example #1
0
 public String exportMolFile() {
   MolfileWriter writer = new MolfileWriter();
   try {
     return writer.write(molecule);
   } catch (Exception e) {
     Window.alert("Error occured: " + e.getMessage());
   }
   return null;
 }
Example #2
0
 public void importMolFile(String fileContent) {
   MolfileReader reader = new MolfileReader();
   Molecule molecule = new DefaultMolecule();
   try {
     reader.read(molecule, fileContent);
     setMolecule(molecule);
   } catch (Exception e) {
     Window.alert("Error occured: " + e.getMessage());
   }
 }