use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingModule in project mzmine2 by mzmine.
the class ProcessingComponent method setupTreeViews.
private void setupTreeViews() {
tiProcessingRoot = new DefaultMutableTreeNode("Processing queues");
msLevelNodes = new DPPMSLevelTreeNode[MSLevel.cropValues().length];
for (MSLevel mslevel : MSLevel.cropValues()) {
msLevelNodes[mslevel.ordinal()] = new DPPMSLevelTreeNode(mslevel);
tiProcessingRoot.add(msLevelNodes[mslevel.ordinal()]);
}
tiAllModulesRoot = new DefaultMutableTreeNode("Modules");
// create category items dynamically, if a new category is added later on.
DPPModuleCategoryTreeNode[] moduleCategories = new DPPModuleCategoryTreeNode[ModuleSubCategory.values().length];
for (int i = 0; i < moduleCategories.length; i++) {
moduleCategories[i] = new DPPModuleCategoryTreeNode(ModuleSubCategory.values()[i]);
tiAllModulesRoot.add(moduleCategories[i]);
}
// add modules to their module category items
Collection<MZmineModule> moduleList = MZmineCore.getAllModules();
for (MZmineModule module : moduleList) {
if (module instanceof DataPointProcessingModule) {
DataPointProcessingModule dppm = (DataPointProcessingModule) module;
// add each module as a child of the module category items
for (DPPModuleCategoryTreeNode catItem : moduleCategories) {
if (dppm.getModuleSubCategory().equals(catItem.getCategory())) {
catItem.add(new DPPModuleTreeNode(dppm));
}
}
}
}
// add the categories to the root item
tvProcessing = new JTree(tiProcessingRoot);
tvAllModules = new JTree(tiAllModulesRoot);
tvProcessing.setCellRenderer(new DisableableTreeCellRenderer());
tvAllModules.setRootVisible(true);
tvProcessing.setRootVisible(true);
expandAllNodes(tvAllModules);
}
Aggregations