MZmineProjectImpl project = (MZmineProjectImpl) MZmineCore
.getCurrentProject();
// Check if we are adding to the current project
if (Arrays.asList(project.getDataFiles()).contains(rawDataFile)) {
final ProjectTreeModel treeModel = project.getTreeModel();
final MassList newMassList = storedMassList;
Runnable swingCode = new Runnable() {
@Override
public void run() {
treeModel.addObject(newMassList);
}
};
try {
if (SwingUtilities.isEventDispatchThread())