assert model == null || filename == null : "One and only one must be null";
assert model != null || filename != null : "One and only one must be null";
if (model == null)
{
BioPAXIOHandler reader = new SimpleIOHandler();
model = reader.convertFromOWL(new FileInputStream(filename));
}
// Don't do anything if the source model does not contain anything
if (model.getObjects().isEmpty())
{
MessageDialog.openInformation(main.getShell(), "No Data!",
"The file is empty.");
return;
}
// Typical merging process
sources.add(model);
Model target = main.getOwlModel();
if (merger == null)
{
merger = new Merger(SimpleEditorMap.get(target.getLevel()));
}
merger.merge(target, sources.toArray(new Model[sources.size()]));
BioPAXReader reader = new BioPAXReader(target);
BioPAXGraph graph = (BioPAXGraph) reader.readXMLFile(null);
if (createNewPathway)
{
List<String> intids = getInteractionIDs(model);
newPathwayName = graph.createPathway(