Search in sources :

Example 1 with ScanSortMode

use of net.sf.mzmine.util.scans.sorting.ScanSortMode in project mzmine2 by mzmine.

the class MSMSLibrarySubmissionWindow method addListener.

private void addListener() {
    // listen for changes in masslist selection and preprocessing
    MassListComponent mc = getMassListComponent();
    mc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
    DoubleComponent nc = getNoiseLevelComponent();
    nc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
    IntegerComponent minc = getMinSignalComponent();
    minc.addDocumentListener(new DelayedDocumentListener(e -> updateSettingsOnAllSelectors()));
    ComboComponent<ScanSortMode> sortc = getComboSortMode();
    sortc.addItemListener(e -> updateSortModeOnAllSelectors());
    IntegerComponent mslevel = getMSLevelComponent();
    mslevel.addDocumentListener(new DelayedDocumentListener(e -> {
        updateParameterSetFromComponents();
        Integer level = paramMeta.getParameter(LibraryMetaDataParameters.MS_LEVEL).getValue();
        setFragmentScan(level != null && level > 1);
    }));
}
Also used : Color(java.awt.Color) OptionalModuleComponent(net.sf.mzmine.parameters.parametertypes.submodules.OptionalModuleComponent) Arrays(java.util.Arrays) URL(java.net.URL) ItemListener(java.awt.event.ItemListener) DataPoint(net.sf.mzmine.datamodel.DataPoint) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) ChartViewWrapper(net.sf.mzmine.chartbasics.gui.wrapper.ChartViewWrapper) EChartPanel(net.sf.mzmine.chartbasics.gui.swing.EChartPanel) Map(java.util.Map) ScanSortMode(net.sf.mzmine.util.scans.sorting.ScanSortMode) LibrarySubmitTask(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.LibrarySubmitTask) UserParameter(net.sf.mzmine.parameters.UserParameter) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) JFrame(javax.swing.JFrame) JMenuBar(javax.swing.JMenuBar) ScrollPaneConstants(javax.swing.ScrollPaneConstants) GridBagPanel(net.sf.mzmine.util.components.GridBagPanel) SortingProperty(net.sf.mzmine.util.SortingProperty) Font(java.awt.Font) PeakListRowSorter(net.sf.mzmine.util.PeakListRowSorter) LibraryMetaDataParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibraryMetaDataParameters) JMenu(javax.swing.JMenu) GUIUtils(net.sf.mzmine.util.GUIUtils) GridBagConstraints(java.awt.GridBagConstraints) Logger(java.util.logging.Logger) LibrarySubmitParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibrarySubmitParameters) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) Platform(javafx.application.Platform) Dimension(java.awt.Dimension) List(java.util.List) Stream(java.util.stream.Stream) ComboComponent(net.sf.mzmine.parameters.parametertypes.ComboComponent) EmptyBorder(javax.swing.border.EmptyBorder) AbstractMSMSIdentity(net.sf.mzmine.datamodel.identities.ms2.interf.AbstractMSMSIdentity) JPanel(javax.swing.JPanel) Scan(net.sf.mzmine.datamodel.Scan) MZmineCore(net.sf.mzmine.main.MZmineCore) Parameter(net.sf.mzmine.parameters.Parameter) ActionListener(java.awt.event.ActionListener) JSplitPane(javax.swing.JSplitPane) LibrarySubmitModule(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.LibrarySubmitModule) HashMap(java.util.HashMap) LibrarySubmitIonParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibrarySubmitIonParameters) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) GridLayout(java.awt.GridLayout) IntegerComponent(net.sf.mzmine.parameters.parametertypes.IntegerComponent) DelayedDocumentListener(net.sf.mzmine.framework.listener.DelayedDocumentListener) JMenuItem(javax.swing.JMenuItem) JFreeChart(org.jfree.chart.JFreeChart) Hashtable(java.util.Hashtable) JComponent(javax.swing.JComponent) HelpWindow(net.sf.mzmine.desktop.impl.helpwindow.HelpWindow) MZTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance) JButton(javax.swing.JButton) MigLayout(net.miginfocom.swing.MigLayout) ValueAxis(org.jfree.chart.axis.ValueAxis) ActionEvent(java.awt.event.ActionEvent) ChartGroup(net.sf.mzmine.chartbasics.chartgroups.ChartGroup) Consumer(java.util.function.Consumer) JScrollPane(javax.swing.JScrollPane) SortingDirection(net.sf.mzmine.util.SortingDirection) MassListComponent(net.sf.mzmine.parameters.parametertypes.MassListComponent) OptionalParameterComponent(net.sf.mzmine.parameters.parametertypes.OptionalParameterComponent) JLabel(javax.swing.JLabel) DialogLoggerUtil(net.sf.mzmine.util.DialogLoggerUtil) PseudoSpectrumDataSet(net.sf.mzmine.modules.visualization.spectra.multimsms.pseudospectra.PseudoSpectrumDataSet) DoubleComponent(net.sf.mzmine.parameters.parametertypes.DoubleComponent) DoubleComponent(net.sf.mzmine.parameters.parametertypes.DoubleComponent) ScanSortMode(net.sf.mzmine.util.scans.sorting.ScanSortMode) IntegerComponent(net.sf.mzmine.parameters.parametertypes.IntegerComponent) DelayedDocumentListener(net.sf.mzmine.framework.listener.DelayedDocumentListener) MassListComponent(net.sf.mzmine.parameters.parametertypes.MassListComponent)

Example 2 with ScanSortMode

use of net.sf.mzmine.util.scans.sorting.ScanSortMode in project mzmine2 by mzmine.

the class MSMSLibrarySubmissionWindow method updateAllChartSelectors.

/**
 * Create new scan selector panels
 */
public void updateAllChartSelectors() {
    group = new ChartGroup(showCrosshair, showCrosshair, true, false);
    pnCharts.removeAll();
    GridLayout layout = new GridLayout(0, 1);
    pnCharts.setLayout(layout);
    if (checkInput()) {
        Integer minSignals = paramSubmit.getParameter(LibrarySubmitParameters.minSignals).getValue();
        Double noiseLevel = paramSubmit.getParameter(LibrarySubmitParameters.noiseLevel).getValue();
        String massListName = paramSubmit.getParameter(LibrarySubmitParameters.massList).getValue();
        if (minSignals != null && noiseLevel != null && massListName != null) {
            ScanSortMode sort = (ScanSortMode) getComboSortMode().getSelectedItem();
            if (rows != null) {
                // create MS2 of all rows
                for (int i = 0; i < rows.length; i++) {
                    PeakListRow row = rows[i];
                    ScanSelectPanel pn = new ScanSelectPanel(row, sort, noiseLevel, minSignals, massListName);
                    pnScanSelect[i] = pn;
                    pn.addChartChangedListener(chart -> regroupCharts());
                    pnCharts.add(pn);
                    // add to group
                    EChartPanel c = pn.getChart();
                    if (c != null) {
                        group.add(new ChartViewWrapper(c));
                    }
                }
            } else if (scanList != null) {
                // all selectors of scanlist
                for (int i = 0; i < scanList.size(); i++) {
                    Scan[] scansEntry = scanList.get(i);
                    ScanSelectPanel pn = new ScanSelectPanel(scansEntry, sort, noiseLevel, minSignals, massListName);
                    pnScanSelect[i] = pn;
                    pn.addChartChangedListener(chart -> regroupCharts());
                    pnCharts.add(pn);
                    // add to group
                    EChartPanel c = pn.getChart();
                    if (c != null) {
                        group.add(new ChartViewWrapper(c));
                    }
                }
            }
        }
        streamSelection().forEach(pn -> {
            pn.setFragmentScan(isFragmentScan);
            // only show exclude/check button if more than 1 entry
            pn.setShowExcludeButton(pnScanSelect.length > 1);
        });
    }
    pnCharts.revalidate();
    pnCharts.repaint();
}
Also used : Color(java.awt.Color) OptionalModuleComponent(net.sf.mzmine.parameters.parametertypes.submodules.OptionalModuleComponent) Arrays(java.util.Arrays) URL(java.net.URL) ItemListener(java.awt.event.ItemListener) DataPoint(net.sf.mzmine.datamodel.DataPoint) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) ChartViewWrapper(net.sf.mzmine.chartbasics.gui.wrapper.ChartViewWrapper) EChartPanel(net.sf.mzmine.chartbasics.gui.swing.EChartPanel) Map(java.util.Map) ScanSortMode(net.sf.mzmine.util.scans.sorting.ScanSortMode) LibrarySubmitTask(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.LibrarySubmitTask) UserParameter(net.sf.mzmine.parameters.UserParameter) BorderLayout(java.awt.BorderLayout) JComboBox(javax.swing.JComboBox) JFrame(javax.swing.JFrame) JMenuBar(javax.swing.JMenuBar) ScrollPaneConstants(javax.swing.ScrollPaneConstants) GridBagPanel(net.sf.mzmine.util.components.GridBagPanel) SortingProperty(net.sf.mzmine.util.SortingProperty) Font(java.awt.Font) PeakListRowSorter(net.sf.mzmine.util.PeakListRowSorter) LibraryMetaDataParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibraryMetaDataParameters) JMenu(javax.swing.JMenu) GUIUtils(net.sf.mzmine.util.GUIUtils) GridBagConstraints(java.awt.GridBagConstraints) Logger(java.util.logging.Logger) LibrarySubmitParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibrarySubmitParameters) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) Platform(javafx.application.Platform) Dimension(java.awt.Dimension) List(java.util.List) Stream(java.util.stream.Stream) ComboComponent(net.sf.mzmine.parameters.parametertypes.ComboComponent) EmptyBorder(javax.swing.border.EmptyBorder) AbstractMSMSIdentity(net.sf.mzmine.datamodel.identities.ms2.interf.AbstractMSMSIdentity) JPanel(javax.swing.JPanel) Scan(net.sf.mzmine.datamodel.Scan) MZmineCore(net.sf.mzmine.main.MZmineCore) Parameter(net.sf.mzmine.parameters.Parameter) ActionListener(java.awt.event.ActionListener) JSplitPane(javax.swing.JSplitPane) LibrarySubmitModule(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.LibrarySubmitModule) HashMap(java.util.HashMap) LibrarySubmitIonParameters(net.sf.mzmine.modules.peaklistmethods.io.spectraldbsubmit.param.LibrarySubmitIonParameters) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) GridLayout(java.awt.GridLayout) IntegerComponent(net.sf.mzmine.parameters.parametertypes.IntegerComponent) DelayedDocumentListener(net.sf.mzmine.framework.listener.DelayedDocumentListener) JMenuItem(javax.swing.JMenuItem) JFreeChart(org.jfree.chart.JFreeChart) Hashtable(java.util.Hashtable) JComponent(javax.swing.JComponent) HelpWindow(net.sf.mzmine.desktop.impl.helpwindow.HelpWindow) MZTolerance(net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance) JButton(javax.swing.JButton) MigLayout(net.miginfocom.swing.MigLayout) ValueAxis(org.jfree.chart.axis.ValueAxis) ActionEvent(java.awt.event.ActionEvent) ChartGroup(net.sf.mzmine.chartbasics.chartgroups.ChartGroup) Consumer(java.util.function.Consumer) JScrollPane(javax.swing.JScrollPane) SortingDirection(net.sf.mzmine.util.SortingDirection) MassListComponent(net.sf.mzmine.parameters.parametertypes.MassListComponent) OptionalParameterComponent(net.sf.mzmine.parameters.parametertypes.OptionalParameterComponent) JLabel(javax.swing.JLabel) DialogLoggerUtil(net.sf.mzmine.util.DialogLoggerUtil) PseudoSpectrumDataSet(net.sf.mzmine.modules.visualization.spectra.multimsms.pseudospectra.PseudoSpectrumDataSet) DoubleComponent(net.sf.mzmine.parameters.parametertypes.DoubleComponent) GridLayout(java.awt.GridLayout) EChartPanel(net.sf.mzmine.chartbasics.gui.swing.EChartPanel) ChartViewWrapper(net.sf.mzmine.chartbasics.gui.wrapper.ChartViewWrapper) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) ScanSortMode(net.sf.mzmine.util.scans.sorting.ScanSortMode) DataPoint(net.sf.mzmine.datamodel.DataPoint) ChartGroup(net.sf.mzmine.chartbasics.chartgroups.ChartGroup)

Aggregations

BorderLayout (java.awt.BorderLayout)2 Color (java.awt.Color)2 Dimension (java.awt.Dimension)2 Font (java.awt.Font)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridLayout (java.awt.GridLayout)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 ItemListener (java.awt.event.ItemListener)2 URL (java.net.URL)2 MessageFormat (java.text.MessageFormat)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 HashMap (java.util.HashMap)2 Hashtable (java.util.Hashtable)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Consumer (java.util.function.Consumer)2 Logger (java.util.logging.Logger)2