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);
}
}
}
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);
}
}
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();
}
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();
}
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();
}
Aggregations