From: <mar...@us...> - 2009-12-10 13:40:25
|
Revision: 15178 http://cdk.svn.sourceforge.net/cdk/?rev=15178&view=rev Author: mark_rynbeek Date: 2009-12-10 13:40:17 +0000 (Thu, 10 Dec 2009) Log Message: ----------- Changes the check 'model does not have bonds' to be: 'model does not have bonds or atoms' Track ticket #53 Modified Paths: -------------- jchempaint/trunk/src/main/org/openscience/jchempaint/application/JChemPaint.java Modified: jchempaint/trunk/src/main/org/openscience/jchempaint/application/JChemPaint.java =================================================================== --- jchempaint/trunk/src/main/org/openscience/jchempaint/application/JChemPaint.java 2009-12-10 09:37:29 UTC (rev 15177) +++ jchempaint/trunk/src/main/org/openscience/jchempaint/application/JChemPaint.java 2009-12-10 13:40:17 UTC (rev 15178) @@ -288,14 +288,14 @@ throws CDKException { JChemPaint.setReactionIDs(chemModel); JChemPaint.replaceReferencesWithClones(chemModel); - JChemPaint.removeDuplicateMolecules(chemModel); - // check for bonds - if (ChemModelManipulator.getBondCount(chemModel) == 0) { + // check the model is not completely empty + if (ChemModelManipulator.getBondCount(chemModel) == 0 && + ChemModelManipulator.getAtomCount(chemModel) == 0) { throw new CDKException( - "Model does not have bonds. Cannot depict contents."); + "Structure does not have bonds or atoms. Cannot depict structure."); } - + JChemPaint.removeDuplicateMolecules(chemModel); JChemPaint.checkCoordinates(chemModel); JChemPaint.removeEmptyMolecules(chemModel); @@ -553,12 +553,6 @@ } } } - - // check for bonds - if (ChemModelManipulator.getBondCount(chemModel) == 0) { - throw new CDKException(GT - ._("Cannot depict contents. Model does not have bonds.")); - } } private static void removeDuplicateMolecules(IChemModel chemModel) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |