Search in sources :

Example 1 with MSLevel

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel in project mzmine2 by mzmine.

the class ProcessingComponent method setValueFromValueWrapper.

/**
 * Sets the values of the component.
 *
 * @param valueWrapper
 */
public void setValueFromValueWrapper(DPPParameterValueWrapper valueWrapper) {
    cbDiffMSn.setSelected(valueWrapper.isDifferentiateMSn());
    for (MSLevel mslevel : MSLevel.cropValues()) setTreeViewProcessingItemsFromQueue(valueWrapper.getQueue(mslevel), mslevel);
    msLevelNodes[MSLevel.MSMS.ordinal()].setEnabled(cbDiffMSn.isSelected());
}
Also used : MSLevel(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel)

Example 2 with MSLevel

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel 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);
}
Also used : DisableableTreeCellRenderer(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DisableableTreeCellRenderer) DPPMSLevelTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPMSLevelTreeNode) JTree(javax.swing.JTree) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) DPPModuleCategoryTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleCategoryTreeNode) DPPModuleTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleTreeNode) DataPointProcessingModule(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingModule) MSLevel(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel) MZmineModule(net.sf.mzmine.modules.MZmineModule)

Example 3 with MSLevel

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel in project mzmine2 by mzmine.

the class ProcessingComponent method getValueFromComponent.

@Nonnull
public DPPParameterValueWrapper getValueFromComponent() {
    DPPParameterValueWrapper value = new DPPParameterValueWrapper();
    Boolean val = Boolean.valueOf(cbDiffMSn.isSelected());
    value.setDifferentiateMSn(val);
    for (MSLevel mslevel : MSLevel.cropValues()) value.setQueue(mslevel, getProcessingQueueFromNode(getNodeByMSLevel(mslevel)));
    return value;
}
Also used : DPPParameterValueWrapper(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.DPPParameterValueWrapper) MSLevel(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel) Nonnull(javax.annotation.Nonnull)

Example 4 with MSLevel

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel in project mzmine2 by mzmine.

the class SpectraPlot method checkAndRunController.

/**
 * Checks if the spectra processing is enabled & allowed and executes the controller if it is.
 * Processing is forbidden for instances of ParameterSetupDialogWithScanPreviews
 */
public void checkAndRunController() {
    // if controller != null, processing on the current spectra has already been executed. When
    // loading a new spectrum, the controller is set to null in removeAllDataSets()
    DataPointProcessingManager inst = DataPointProcessingManager.getInst();
    if (!isProcessingAllowed() || !inst.isEnabled())
        return;
    if (controller != null)
        controller = null;
    // if a controller is re-run then delete previous results
    removeDataPointProcessingResultDataSets();
    // if enabled, do the data point processing as set up by the user
    XYDataset dataSet = getMainScanDataSet();
    if (dataSet instanceof ScanDataSet) {
        Scan scan = ((ScanDataSet) dataSet).getScan();
        MSLevel mslevel = inst.decideMSLevel(scan);
        controller = new DataPointProcessingController(inst.getProcessingQueue(mslevel), this, getMainScanDataSet().getDataPoints());
        inst.addController(controller);
    }
}
Also used : DataPointProcessingManager(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingManager) ScanDataSet(net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.ScanDataSet) DataPointProcessingController(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingController) XYDataset(org.jfree.data.xy.XYDataset) Scan(net.sf.mzmine.datamodel.Scan) MSLevel(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel)

Aggregations

MSLevel (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel)4 Nonnull (javax.annotation.Nonnull)1 JTree (javax.swing.JTree)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 Scan (net.sf.mzmine.datamodel.Scan)1 MZmineModule (net.sf.mzmine.modules.MZmineModule)1 DataPointProcessingController (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingController)1 DataPointProcessingManager (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingManager)1 DataPointProcessingModule (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingModule)1 DPPParameterValueWrapper (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.DPPParameterValueWrapper)1 DPPMSLevelTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPMSLevelTreeNode)1 DPPModuleCategoryTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleCategoryTreeNode)1 DPPModuleTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleTreeNode)1 DisableableTreeCellRenderer (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DisableableTreeCellRenderer)1 ScanDataSet (net.sf.mzmine.modules.visualization.spectra.simplespectra.datasets.ScanDataSet)1 XYDataset (org.jfree.data.xy.XYDataset)1