public static IChemModel readFromFileReader(URL fileURL, String url, String type, AbstractJChemPaintPanel panel) throws CDKException { IChemModel chemModel = null; WaitDialog.showDialog(); // InChI workaround - guessing for InChI results into an INChIReader // (this does not work, we'd need an INChIPlainTextReader..) // Instead here we use STDInChIReader, to be consistent throughout JCP // using the nestedVm based classes. try { ISimpleChemObjectReader cor=null; if(url.endsWith("txt")) { chemModel = InChITool.readInChI(fileURL); } else { cor = FileHandler.createReader(fileURL, url,type); chemModel = JChemPaint.getChemModelFromReader(cor,panel); } boolean avoidOverlap=true; if (cor instanceof RGroupQueryReader) avoidOverlap=false; JChemPaint.cleanUpChemModel(chemModel, avoidOverlap, panel); } finally { WaitDialog.hideDialog(); } return chemModel; }