Add handler for SpectralDBAnnotation without library hit datapoints, eg. NIST MS Search results.
Explicitly check if data points is null before adding match.
If match list is empty, update message - point user where to visualize NIST MS Search Results.
@@ -146,6 +146,7 @@ public class SpectraIdentificationResultsWindowFX extends Stage {
public synchronized void addMatches(SpectralDBAnnotation match) {
if (!totalMatches.contains(match)) {
// add
+ if (match.getEntry().getDataPoints() != null) {
totalMatches.add(match);
SpectralMatchPanelFX pn = new SpectralMatchPanelFX(match);
pn.setCoupleZoomY(isCouplingZoomY);
@@ -155,6 +156,9 @@ public class SpectraIdentificationResultsWindowFX extends Stage {
//pnGrid.add(pn, 0, matchPanels.size() - 1);
// sort and show
+
+ }
+
sortTotalMatches();
}
}
@@ -192,6 +196,7 @@ public class SpectraIdentificationResultsWindowFX extends Stage {
*/
public void sortTotalMatches() {
if (totalMatches.isEmpty()) {
+ setMatchingFinished();
return;
}
@@ -206,7 +211,8 @@ public class SpectraIdentificationResultsWindowFX extends Stage {
public void setMatchingFinished() {
if (totalMatches.isEmpty()) {
- noMatchesFound.setText("Sorry no matches found");
+ noMatchesFound.setText("Sorry no matches found.\n"
+ + "Please visualize NIST spectral search results through NIST MS Search software.");
noMatchesFound.setTextFill(Color.RED);
}
}
