Search in sources :

Example 6 with SpectralDBPeakIdentity

use of net.sf.mzmine.util.spectraldb.entry.SpectralDBPeakIdentity in project mzmine2 by mzmine.

the class SpectraIdentificationResultsWindow method addMatches.

/**
 * add all matches and sort the view
 *
 * @param scan
 * @param matches
 */
public synchronized void addMatches(List<SpectralDBPeakIdentity> matches) {
    // add all
    for (SpectralDBPeakIdentity match : matches) {
        if (!totalMatches.contains(match)) {
            // add
            totalMatches.add(match);
            SpectralMatchPanel pn = new SpectralMatchPanel(match);
            pn.setCoupleZoomY(isCouplingZoomY);
            matchPanels.put(match, pn);
        }
    }
    // sort and show
    sortTotalMatches();
}
Also used : SpectralDBPeakIdentity(net.sf.mzmine.util.spectraldb.entry.SpectralDBPeakIdentity)

Example 7 with SpectralDBPeakIdentity

use of net.sf.mzmine.util.spectraldb.entry.SpectralDBPeakIdentity in project mzmine2 by mzmine.

the class SpectraIdentificationResultsWindow method renewLayout.

/**
 * Add a spectral library hit
 *
 * @param ident
 * @param simScore
 */
public void renewLayout() {
    SwingUtilities.invokeLater(() -> {
        // any number of rows
        JPanel pnGrid = new JPanel(new GridLayout(0, 1, 0, 5));
        pnGrid.setBackground(Color.WHITE);
        pnGrid.setAutoscrolls(false);
        // add all panel in order
        synchronized (totalMatches) {
            for (SpectralDBPeakIdentity match : totalMatches) {
                JPanel pn = matchPanels.get(match);
                if (pn != null)
                    pnGrid.add(pn);
            }
        }
        // show
        scrollPane.setViewportView(pnGrid);
        scrollPane.getVerticalScrollBar().setUnitIncrement(75);
        pnGrid.revalidate();
        scrollPane.revalidate();
        scrollPane.repaint();
        this.pnGrid = pnGrid;
    });
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) SpectralDBPeakIdentity(net.sf.mzmine.util.spectraldb.entry.SpectralDBPeakIdentity)

Aggregations

SpectralDBPeakIdentity (net.sf.mzmine.util.spectraldb.entry.SpectralDBPeakIdentity)7 ArrayList (java.util.ArrayList)3 DataPoint (net.sf.mzmine.datamodel.DataPoint)3 PeakIdentity (net.sf.mzmine.datamodel.PeakIdentity)2 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)2 Scan (net.sf.mzmine.datamodel.Scan)2 MissingMassListException (net.sf.mzmine.util.exceptions.MissingMassListException)2 SpectralSimilarity (net.sf.mzmine.util.scans.similarity.SpectralSimilarity)2 SpectralDBEntry (net.sf.mzmine.util.spectraldb.entry.SpectralDBEntry)2 Range (com.google.common.collect.Range)1 Color (java.awt.Color)1 Component (java.awt.Component)1 Desktop (java.awt.Desktop)1 GridLayout (java.awt.GridLayout)1 Point (java.awt.Point)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1