use of com.cburch.logisim.file.LoadFailedException in project logisim-evolution by reds-heig.
the class ProjectActions method createNewFile.
public static LogisimFile createNewFile(Project baseProject) {
Loader loader = new Loader(baseProject == null ? null : baseProject.getFrame());
InputStream templReader = AppPreferences.getTemplate().createStream();
LogisimFile file;
try {
file = loader.openLogisimFile(templReader);
} catch (IOException ex) {
displayException(baseProject.getFrame(), ex);
file = createEmptyFile(loader, baseProject);
} catch (LoadFailedException ex) {
if (!ex.isShown()) {
displayException(baseProject.getFrame(), ex);
}
file = createEmptyFile(loader, baseProject);
} finally {
try {
templReader.close();
} catch (IOException e) {
}
}
return file;
}
Aggregations