use of gov.sandia.n2a.ui.UndoManager in project n2a by frothga.
the class ImportNeuroML method process.
@Override
public void process(File source) {
if (PluginNeuroML.partMap == null)
PluginNeuroML.partMap = new PartMap();
ImportJob job = new ImportJob(PluginNeuroML.partMap);
job.process(source);
job.postprocess();
MNode mainModel = job.models.child(job.modelName);
job.models.clear(job.modelName);
UndoManager um = PanelModel.instance.undoManager;
um.addEdit(new CompoundEdit());
while (job.models.size() > 0) addModel(job.models.iterator().next(), job.models, um);
// after all add operations are completed.
if (mainModel != null)
um.add(new AddDoc(job.modelName, mainModel));
um.endCompoundEdit();
}
Aggregations