if(file.getName().toLowerCase().endsWith(".png")) {
loadPng(file);
} if (file.getName().toLowerCase().endsWith(".leoz")) {
SketchDocument doc = loadZip(file);
if(doc.isPresentation()) {
main.setupNewDoc(new PresoModeHelper(main),doc);
} else {
main.setupNewDoc(new VectorModeHelper(main),doc);
}
} else {
SketchDocument doc = load(new FileInputStream(file), file, file.getName(),null);
if(doc.isPresentation()) {
main.setupNewDoc(new PresoModeHelper(main),doc);
} else {
main.setupNewDoc(new VectorModeHelper(main),doc);
}
main.addRecentFile(file);
}