Search in sources :

Example 1 with ParameterSetupDialog

use of net.sf.mzmine.parameters.dialogs.ParameterSetupDialog in project mzmine2 by mzmine.

the class OptionalModuleComponent method actionPerformed.

@Override
public void actionPerformed(ActionEvent event) {
    Object src = event.getSource();
    if (src == checkBox) {
        boolean checkBoxSelected = checkBox.isSelected();
        setButton.setEnabled(checkBoxSelected);
    }
    if (src == setButton) {
        ParameterSetupDialog dialog = (ParameterSetupDialog) SwingUtilities.getAncestorOfClass(ParameterSetupDialog.class, this);
        if (dialog != null)
            embeddedParameters.showSetupDialog(dialog, dialog.isValueCheckRequired());
        else {
            // regular window? or null
            Window window = (Window) SwingUtilities.getAncestorOfClass(Window.class, this);
            embeddedParameters.showSetupDialog(window, false);
        }
    }
}
Also used : Window(java.awt.Window) ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog)

Example 2 with ParameterSetupDialog

use of net.sf.mzmine.parameters.dialogs.ParameterSetupDialog in project mzmine2 by mzmine.

the class MZRangeComponent method actionPerformed.

@Override
public void actionPerformed(ActionEvent event) {
    Object src = event.getSource();
    if (src == setAutoButton) {
        RawDataFile[] currentFiles = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
        ScanSelection scanSelection = new ScanSelection();
        try {
            ParameterSetupDialog setupDialog = (ParameterSetupDialog) SwingUtilities.getWindowAncestor(this);
            RawDataFilesComponent rdc = (RawDataFilesComponent) setupDialog.getComponentForParameter(new RawDataFilesParameter());
            if (rdc != null) {
                RawDataFile[] matchingFiles = rdc.getValue().getMatchingRawDataFiles();
                if (matchingFiles.length > 0)
                    currentFiles = matchingFiles;
            }
            ScanSelectionComponent ssc = (ScanSelectionComponent) setupDialog.getComponentForParameter(new ScanSelectionParameter());
            if (ssc != null)
                scanSelection = ssc.getValue();
        } catch (Exception e) {
            e.printStackTrace();
        }
        Range<Double> mzRange = null;
        for (RawDataFile file : currentFiles) {
            Scan[] scans = scanSelection.getMatchingScans(file);
            for (Scan s : scans) {
                Range<Double> scanRange = s.getDataPointMZRange();
                if (scanRange == null)
                    continue;
                if (mzRange == null)
                    mzRange = scanRange;
                else
                    mzRange = mzRange.span(scanRange);
            }
        }
        if (mzRange != null)
            setValue(mzRange);
    }
    if (src == fromMassButton) {
        Range<Double> mzRange = MzRangeMassCalculatorModule.showRangeCalculationDialog();
        if (mzRange != null)
            setValue(mzRange);
    }
    if (src == fromFormulaButton) {
        Range<Double> mzRange = MzRangeFormulaCalculatorModule.showRangeCalculationDialog();
        if (mzRange != null)
            setValue(mzRange);
    }
}
Also used : ScanSelection(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection) ScanSelectionParameter(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelectionParameter) ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog) RawDataFilesComponent(net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesComponent) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) Scan(net.sf.mzmine.datamodel.Scan) ScanSelectionComponent(net.sf.mzmine.parameters.parametertypes.selectors.ScanSelectionComponent) RawDataFilesParameter(net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesParameter)

Example 3 with ParameterSetupDialog

use of net.sf.mzmine.parameters.dialogs.ParameterSetupDialog in project mzmine2 by mzmine.

the class RawFileMergeParameters method showSetupDialog.

@Override
public ExitCode showSetupDialog(Window parent, boolean valueCheckRequired) {
    if ((getParameters() == null) || (getParameters().length == 0))
        return ExitCode.OK;
    ParameterSetupDialog dialog = new ParameterSetupDialog(parent, valueCheckRequired, this);
    // 
    ((ComboComponent) dialog.getComponentForParameter(mode)).addItemListener(e -> {
        boolean pattern = (e.getItem().equals(MODE.MERGE_PATTERN));
        dialog.getComponentForParameter(position).setVisible(pattern);
        dialog.getComponentForParameter(posMarker).setVisible(pattern);
    });
    dialog.setVisible(true);
    return dialog.getExitCode();
}
Also used : ComboComponent(net.sf.mzmine.parameters.parametertypes.ComboComponent) ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog)

Example 4 with ParameterSetupDialog

use of net.sf.mzmine.parameters.dialogs.ParameterSetupDialog in project mzmine2 by mzmine.

the class SpectraIdentificationSpectralDatabaseParameters method showSetupDialog.

@Override
public ExitCode showSetupDialog(Window parent, boolean valueCheckRequired) {
    if ((getParameters() == null) || (getParameters().length == 0))
        return ExitCode.OK;
    ParameterSetupDialog dialog = new ParameterSetupDialog(parent, valueCheckRequired, this);
    // only enable precursor mz tolerance if precursor mz is used
    OptionalParameterComponent usePreComp = (OptionalParameterComponent) dialog.getComponentForParameter(usePrecursorMZ);
    JComponent mzTolPrecursor = dialog.getComponentForParameter(mzTolerancePrecursor);
    mzTolPrecursor.setEnabled(getParameter(usePrecursorMZ).getValue());
    usePreComp.addItemListener(e -> {
        mzTolPrecursor.setEnabled(usePreComp.isSelected());
    });
    dialog.setVisible(true);
    return dialog.getExitCode();
}
Also used : OptionalParameterComponent(net.sf.mzmine.parameters.parametertypes.OptionalParameterComponent) JComponent(javax.swing.JComponent) ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog)

Example 5 with ParameterSetupDialog

use of net.sf.mzmine.parameters.dialogs.ParameterSetupDialog in project mzmine2 by mzmine.

the class ADAPChromatogramBuilderParameters method showSetupDialog.

public ExitCode showSetupDialog(Window parent, boolean valueCheckRequired) {
    String message = "<html>ADAP Module Disclaimer:" + "<br> If you use the ADAP Chromatogram Builder Module, please cite the " + "<a href=\"https://bmcbioinformatics.biomedcentral.com/articles/10.1186/1471-2105-11-395\">MZmine2 paper</a> and the following article:" + "<br><a href=\"http://pubs.acs.org/doi/abs/10.1021/acs.analchem.7b00947\"> Myers OD, Sumner SJ, Li S, Barnes S, Du X: One Step Forward for Reducing False Positive and False Negative " + "<br>Compound Identifications from Mass Spectrometry Metabolomics Data: New Algorithms for Constructing Extracted " + "<br>Ion Chromatograms and Detecting Chromatographic Peaks. Anal Chem 2017, DOI: 10.1021/acs.analchem.7b00947</a>" + "</html>";
    ParameterSetupDialog dialog = new ParameterSetupDialog(parent, valueCheckRequired, this, message);
    dialog.setVisible(true);
    return dialog.getExitCode();
}
Also used : ParameterSetupDialog(net.sf.mzmine.parameters.dialogs.ParameterSetupDialog)

Aggregations

ParameterSetupDialog (net.sf.mzmine.parameters.dialogs.ParameterSetupDialog)24 RawDataFile (net.sf.mzmine.datamodel.RawDataFile)3 UserParameter (net.sf.mzmine.parameters.UserParameter)3 RawDataFilesParameter (net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesParameter)3 Window (java.awt.Window)2 JComponent (javax.swing.JComponent)2 Parameter (net.sf.mzmine.parameters.Parameter)2 BooleanParameter (net.sf.mzmine.parameters.parametertypes.BooleanParameter)2 DoubleParameter (net.sf.mzmine.parameters.parametertypes.DoubleParameter)2 IntegerParameter (net.sf.mzmine.parameters.parametertypes.IntegerParameter)2 ModuleComboParameter (net.sf.mzmine.parameters.parametertypes.ModuleComboParameter)2 RawDataFilesComponent (net.sf.mzmine.parameters.parametertypes.selectors.RawDataFilesComponent)2 Collection (java.util.Collection)1 JButton (javax.swing.JButton)1 MZmineProject (net.sf.mzmine.datamodel.MZmineProject)1 Scan (net.sf.mzmine.datamodel.Scan)1 DelayedDocumentListener (net.sf.mzmine.framework.listener.DelayedDocumentListener)1 MZmineCore (net.sf.mzmine.main.MZmineCore)1 MZmineProcessingStep (net.sf.mzmine.modules.MZmineProcessingStep)1 MassListDeisotoperParameters (net.sf.mzmine.modules.visualization.spectra.simplespectra.datapointprocessing.isotopes.MassListDeisotoperParameters)1