Search in sources :

Example 6 with DPPModuleTreeNode

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

the class ProcessingComponent method addSelectedModule.

/**
 * Adds the selected module in the tvAllModules to the processing list
 */
private void addSelectedModule() {
    DefaultMutableTreeNode selected = getSelectedItem(tvAllModules);
    if (selected == null)
        return;
    if (selected instanceof DPPModuleTreeNode) {
        DPPModuleTreeNode node = (DPPModuleTreeNode) selected.clone();
        DPPMSLevelTreeNode target = getTargetNode();
        if (target.isEnabled())
            addModule(node, target);
    } else {
        logger.finest("Cannot add item " + selected.toString() + " to " + this.getName() + ".");
    }
}
Also used : DPPMSLevelTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPMSLevelTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) DPPModuleTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleTreeNode)

Example 7 with DPPModuleTreeNode

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

the class ProcessingComponent method setTreeViewProcessingItemsFromQueue.

/**
 * Convenience method to publicly set the items of the processing list from the tree view. Used to
 * set the default queue, if set, loaded by the manager's constructor.
 *
 * @param queue
 */
public void setTreeViewProcessingItemsFromQueue(@Nullable DataPointProcessingQueue queue, MSLevel level) {
    logger.info("Loading queue into tvProcessing...");
    DPPMSLevelTreeNode targetNode = getNodeByMSLevel(level);
    targetNode.removeAllChildren();
    Collection<DPPModuleTreeNode> moduleNodes = createTreeItemsFromQueue(queue);
    for (DPPModuleTreeNode node : moduleNodes) {
        addModule(node, targetNode);
    }
    ((DefaultTreeModel) tvProcessing.getModel()).reload();
    expandAllNodes(tvProcessing);
}
Also used : DPPMSLevelTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPMSLevelTreeNode) DPPModuleTreeNode(net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleTreeNode) DefaultTreeModel(javax.swing.tree.DefaultTreeModel)

Aggregations

DPPModuleTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleTreeNode)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)5 DPPMSLevelTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPMSLevelTreeNode)4 DefaultTreeModel (javax.swing.tree.DefaultTreeModel)3 Nonnull (javax.annotation.Nonnull)1 JTree (javax.swing.JTree)1 MZmineModule (net.sf.mzmine.modules.MZmineModule)1 DataPointProcessingModule (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingModule)1 DataPointProcessingQueue (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.DataPointProcessingQueue)1 MSLevel (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.MSLevel)1 DPPModuleCategoryTreeNode (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DPPModuleCategoryTreeNode)1 DisableableTreeCellRenderer (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.datamodel.customguicomponents.DisableableTreeCellRenderer)1 ParameterSet (net.sf.mzmine.parameters.ParameterSet)1 ExitCode (net.sf.mzmine.util.ExitCode)1