@Override
  public void actionPerformed(ActionEvent e) {

    Object src = e.getSource();

    if (src == thresholdCombo) {

      PeakThresholdMode mode = (PeakThresholdMode) this.thresholdCombo.getSelectedItem();

      switch (mode) {
        case ABOVE_INTENSITY_PEAKS:
          peakTextField.setText(String.valueOf(thresholdSettings.getIntensityThreshold()));
          peakTextField.setEnabled(true);
          break;
        case ALL_PEAKS:
          peakTextField.setEnabled(false);
          break;
        case TOP_PEAKS:
        case TOP_PEAKS_AREA:
          peakTextField.setText(String.valueOf(thresholdSettings.getTopPeaksThreshold()));
          peakTextField.setEnabled(true);
          break;
      }

      thresholdSettings.setMode(mode);
    }

    if (src == peakTextField) {
      PeakThresholdMode mode = (PeakThresholdMode) this.thresholdCombo.getSelectedItem();
      String value = peakTextField.getText();
      switch (mode) {
        case ABOVE_INTENSITY_PEAKS:
          double topInt = Double.parseDouble(value);
          thresholdSettings.setIntensityThreshold(topInt);
          break;
        case TOP_PEAKS:
        case TOP_PEAKS_AREA:
          int topPeaks = Integer.parseInt(value);
          thresholdSettings.setTopPeaksThreshold(topPeaks);
          break;
        default:
          break;
      }
    }

    PeakList selectedPeakList = getPeaksInThreshold();
    if (selectedPeakList != null) masterFrame.getPlot().loadPeakList(selectedPeakList);
  }