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