Use lambda-expressions for EventHandlers.
@@ -151,30 +151,22 @@ class NeutralLossPlot extends EChartViewer {
});
- this.setOnKeyTyped(new EventHandler<KeyEvent>() {
- @Override
- public void handle(KeyEvent keyEvent) {
+ this.setOnKeyTyped(keyEvent -> {
if (keyEvent.getCharacter().equals(" ")) {
showSpectrum();
}
- }
});
- chart.addProgressListener(new ChartProgressListener() {
- @Override
- public void chartProgress(ChartProgressEvent event) {
+ chart.addProgressListener(event -> {
if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {
-
visualizer.updateTitle();
-
if (showSpectrumRequest) {
showSpectrumRequest = false;
showSpectrum();
-
- }
}
}
});
+
resetZoomHistory();
}
