Package eu.isas.peptideshaker.gui.preferencesdialogs

Source Code of eu.isas.peptideshaker.gui.preferencesdialogs.PreferencesDialog

package eu.isas.peptideshaker.gui.preferencesdialogs;

import com.compomics.util.gui.error_handlers.HelpDialog;
import com.compomics.util.gui.renderers.AlignedListCellRenderer;
import com.compomics.util.preferences.PTMScoringPreferences;
import eu.isas.peptideshaker.gui.PeptideShakerGUI;
import eu.isas.peptideshaker.preferences.SpectrumCountingPreferences;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import javax.swing.JSpinner.NumberEditor;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

/**
* A dialog where the user can edit the PeptideShaker preferences.
*
* @author Harald Barsnes
* @author Marc Vaudel
*/
public class PreferencesDialog extends javax.swing.JDialog {

    /**
     * Instance of the main GUI class.
     */
    private PeptideShakerGUI peptideShakerGUI;
    /**
     * The spectrum counting preferences.
     */
    private SpectrumCountingPreferences spectrumCountingPreferences;
    /**
     * The PTM scoring preferences.
     */
    private PTMScoringPreferences ptmScoringPreferences;

    /**
     * Creates a new PreferencesDialog.
     *
     * @param peptideShakerGUI
     * @param modal
     */
    public PreferencesDialog(PeptideShakerGUI peptideShakerGUI, boolean modal) {
        super(peptideShakerGUI, modal);
        initComponents();

        this.peptideShakerGUI = peptideShakerGUI;
        this.spectrumCountingPreferences = peptideShakerGUI.getSpectrumCountingPreferences();
        this.ptmScoringPreferences = peptideShakerGUI.getPtmScoringPreferences();

        // centrally align the spinner 
        ((NumberEditor) nAASpinner.getEditor()).getTextField().setHorizontalAlignment(JTextField.CENTER);

        // set the values
        nAASpinner.setValue(peptideShakerGUI.getDisplayPreferences().getnAASurroundingPeptides());
        methodCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
        probabilitsticScoreCalculationCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
        neutralLossesCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
        insertSpectrumCountingPreferences();
        insertPTMScoringPreferences();

        setLocationRelativeTo(peptideShakerGUI);
        setVisible(true);
    }

    /**
     * Update the GUI based on the spectrum counting preferences.
     */
    private void insertSpectrumCountingPreferences() {
        if (spectrumCountingPreferences.getSelectedMethod() == SpectrumCountingPreferences.SpectralCountingMethod.NSAF) {
            methodCmb.setSelectedIndex(0);
        } else {
            methodCmb.setSelectedIndex(1);
        }
        if (spectrumCountingPreferences.isValidatedHits()) {
            validatedCheck.setSelected(true);
        } else {
            validatedCheck.setSelected(false);
        }
    }

    /**
     * Updates the GUI based on the PTM scoring preferences.
     */
    private void insertPTMScoringPreferences() {
        if (ptmScoringPreferences.isProbabilitsticScoreCalculation()) {
            probabilitsticScoreCalculationCmb.setSelectedIndex(0);
        } else {
            probabilitsticScoreCalculationCmb.setSelectedIndex(1);
        }
        if (ptmScoringPreferences.isProbabilisticScoreNeutralLosses()) {
            neutralLossesCmb.setSelectedIndex(0);
        } else {
            neutralLossesCmb.setSelectedIndex(1);
        }
        flrThresholdTxt.setText(ptmScoringPreferences.getFlrThreshold() + "");
    }

    /**
     * Verifies the input of the user.
     *
     * @return a boolean indicating whether the input can be parsed
     */
    public boolean validateInput() {
        try {
            new Double(flrThresholdTxt.getText());
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Please verify the input for A-score threshold.",
                    "Input Error", JOptionPane.ERROR_MESSAGE);
            return false;
        }
        return true;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        backgroundPanel = new javax.swing.JPanel();
        optionsPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        methodCmb = new javax.swing.JComboBox();
        validatedCheck = new javax.swing.JCheckBox();
        optionsPanel = new javax.swing.JPanel();
        surroundingAminoAcidsLabel = new javax.swing.JLabel();
        nAASpinner = new javax.swing.JSpinner();
        preferencesPanel = new javax.swing.JPanel();
        flrLabel = new javax.swing.JLabel();
        flrThresholdTxt = new javax.swing.JTextField();
        neutralLossesLabel = new javax.swing.JLabel();
        neutralLossesCmb = new javax.swing.JComboBox();
        probalisticScoreCalculationLabel = new javax.swing.JLabel();
        probabilitsticScoreCalculationCmb = new javax.swing.JComboBox();
        helpJButton = new javax.swing.JButton();
        okButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Preferences");
        setResizable(false);

        backgroundPanel.setBackground(new java.awt.Color(230, 230, 230));

        optionsPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("MS2 Quantification"));
        optionsPanel1.setOpaque(false);

        jLabel1.setText("Quantification Method");

        methodCmb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NSAF+", "emPAI" }));

        validatedCheck.setText("validated");
        validatedCheck.setToolTipText("Count only the validated hits");
        validatedCheck.setIconTextGap(10);
        validatedCheck.setOpaque(false);

        javax.swing.GroupLayout optionsPanel1Layout = new javax.swing.GroupLayout(optionsPanel1);
        optionsPanel1.setLayout(optionsPanel1Layout);
        optionsPanel1Layout.setHorizontalGroup(
            optionsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(methodCmb, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(validatedCheck, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(39, Short.MAX_VALUE))
        );
        optionsPanel1Layout.setVerticalGroup(
            optionsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(optionsPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel1)
                    .addComponent(methodCmb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(validatedCheck))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        optionsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Peptide Sequence"));
        optionsPanel.setOpaque(false);

        surroundingAminoAcidsLabel.setText("Surrounding Amino Acids");

        nAASpinner.setModel(new javax.swing.SpinnerNumberModel(2, 0, 5, 1));

        javax.swing.GroupLayout optionsPanelLayout = new javax.swing.GroupLayout(optionsPanel);
        optionsPanel.setLayout(optionsPanelLayout);
        optionsPanelLayout.setHorizontalGroup(
            optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(surroundingAminoAcidsLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(nAASpinner)
                .addContainerGap())
        );
        optionsPanelLayout.setVerticalGroup(
            optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(optionsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(optionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(surroundingAminoAcidsLabel)
                    .addComponent(nAASpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        preferencesPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("PTM Scoring"));
        preferencesPanel.setOpaque(false);

        flrLabel.setText("False Localization Rate");

        flrThresholdTxt.setEditable(false);
        flrThresholdTxt.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        flrThresholdTxt.setText("50");

        neutralLossesLabel.setText("Neutral Losses Accounted");

        neutralLossesCmb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));

        probalisticScoreCalculationLabel.setText("Probabilitstic Score");

        probabilitsticScoreCalculationCmb.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Yes", "No" }));

        javax.swing.GroupLayout preferencesPanelLayout = new javax.swing.GroupLayout(preferencesPanel);
        preferencesPanel.setLayout(preferencesPanelLayout);
        preferencesPanelLayout.setHorizontalGroup(
            preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(preferencesPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(preferencesPanelLayout.createSequentialGroup()
                        .addComponent(flrLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(neutralLossesCmb, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(flrThresholdTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
                            .addComponent(probabilitsticScoreCalculationCmb, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(preferencesPanelLayout.createSequentialGroup()
                        .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(neutralLossesLabel)
                            .addComponent(probalisticScoreCalculationLabel))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        preferencesPanelLayout.setVerticalGroup(
            preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(preferencesPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(probalisticScoreCalculationLabel)
                    .addComponent(probabilitsticScoreCalculationCmb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(flrLabel)
                    .addComponent(flrThresholdTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(preferencesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(neutralLossesLabel)
                    .addComponent(neutralLossesCmb, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        helpJButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/help.GIF"))); // NOI18N
        helpJButton.setToolTipText("Help");
        helpJButton.setBorder(null);
        helpJButton.setBorderPainted(false);
        helpJButton.setContentAreaFilled(false);
        helpJButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                helpJButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                helpJButtonMouseExited(evt);
            }
        });
        helpJButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                helpJButtonActionPerformed(evt);
            }
        });

        okButton.setText("OK");
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });

        cancelButton.setText("Cancel");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout backgroundPanelLayout = new javax.swing.GroupLayout(backgroundPanel);
        backgroundPanel.setLayout(backgroundPanelLayout);
        backgroundPanelLayout.setHorizontalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(backgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(optionsPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(backgroundPanelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(helpJButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cancelButton))
                    .addComponent(optionsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(preferencesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        backgroundPanelLayout.setVerticalGroup(
            backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(backgroundPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(optionsPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(optionsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(preferencesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(cancelButton)
                        .addComponent(okButton))
                    .addComponent(helpJButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(backgroundPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(backgroundPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Saves the setting and then closes the dialog.
     *
     * @param evt
     */
    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed

        if (validateInput()) {

            // ptm thresholds
            boolean ptmScoreThresholdChanged = false;


            // delta score threshold
            if (peptideShakerGUI.getPtmScoringPreferences().getFlrThreshold() != new Double(flrThresholdTxt.getText())) {
                peptideShakerGUI.getPtmScoringPreferences().setFlrThreshold(new Double(flrThresholdTxt.getText()));
                ptmScoreThresholdChanged = true;
            }

            if (peptideShakerGUI.getPtmScoringPreferences().isProbabilitsticScoreCalculation()&& probabilitsticScoreCalculationCmb.getSelectedIndex() != 0
                    || !peptideShakerGUI.getPtmScoringPreferences().isProbabilitsticScoreCalculation() && probabilitsticScoreCalculationCmb.getSelectedIndex() != 1) {
                peptideShakerGUI.getPtmScoringPreferences().setProbabilitsticScoreCalculation(probabilitsticScoreCalculationCmb.getSelectedIndex() == 0);
                ptmScoreThresholdChanged = true;
            }

            if (peptideShakerGUI.getPtmScoringPreferences().isProbabilisticScoreNeutralLosses()&& neutralLossesCmb.getSelectedIndex() != 0
                    || !peptideShakerGUI.getPtmScoringPreferences().isProbabilisticScoreNeutralLosses() && neutralLossesCmb.getSelectedIndex() != 1) {
                peptideShakerGUI.getPtmScoringPreferences().setProbabilisticScoreNeutralLosses(neutralLossesCmb.getSelectedIndex() == 0);
                ptmScoreThresholdChanged = true;
            }


            // spectrum counting
            boolean spectrumCountingMethodChanged = false;

            if (methodCmb.getSelectedIndex() == 0 && spectrumCountingPreferences.getSelectedMethod() != SpectrumCountingPreferences.SpectralCountingMethod.NSAF) {
                spectrumCountingPreferences.setSelectedMethod(SpectrumCountingPreferences.SpectralCountingMethod.NSAF);
                spectrumCountingMethodChanged = true;
            } else if (methodCmb.getSelectedIndex() == 1 && spectrumCountingPreferences.getSelectedMethod() != SpectrumCountingPreferences.SpectralCountingMethod.EMPAI) {
                spectrumCountingPreferences.setSelectedMethod(SpectrumCountingPreferences.SpectralCountingMethod.EMPAI);
                spectrumCountingMethodChanged = true;
            }

            if (spectrumCountingPreferences.isValidatedHits() != validatedCheck.isSelected()) {
                spectrumCountingPreferences.setValidatedHits(validatedCheck.isSelected());
                spectrumCountingMethodChanged = true;
            }


            // surrounding amino acids
            boolean numberOfSurroundingAminoAcidsChanged = false;

            int selection = (Integer) nAASpinner.getValue();
            if (selection != peptideShakerGUI.getDisplayPreferences().getnAASurroundingPeptides()) {
                peptideShakerGUI.getDisplayPreferences().setnAASurroundingPeptides(selection);
                numberOfSurroundingAminoAcidsChanged = true;
            }


            // update the ptm score threshold
            if (ptmScoreThresholdChanged) {
                //@TODO: update interface where needed?
            }

            // update the number of surrounding amino acids
            if (numberOfSurroundingAminoAcidsChanged) {
                peptideShakerGUI.updateSurroundingAminoAcids();
            }

            // update the spectrum counting method
            if (spectrumCountingMethodChanged) {
                peptideShakerGUI.setSpectrumCountingPreferences(spectrumCountingPreferences);
                peptideShakerGUI.getIdentificationFeaturesGenerator().clearSpectrumCounting();
                peptideShakerGUI.setUpdated(PeptideShakerGUI.OVER_VIEW_TAB_INDEX, false);
                peptideShakerGUI.setUpdated(PeptideShakerGUI.STRUCTURES_TAB_INDEX, false);
                peptideShakerGUI.setUpdated(PeptideShakerGUI.QC_PLOTS_TAB_INDEX, false);
                peptideShakerGUI.updateTabbedPanes();
            }

            peptideShakerGUI.setDataSaved(false);
            dispose();
        }
    }//GEN-LAST:event_okButtonActionPerformed

    /**
     * Closes the dialog.
     *
     * @param evt
     */
    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        dispose();
    }//GEN-LAST:event_cancelButtonActionPerformed

    /**
     * Change the cursor to a hand cursor.
     *
     * @param evt
     */
    private void helpJButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_helpJButtonMouseEntered
        setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
    }//GEN-LAST:event_helpJButtonMouseEntered

    /**
     * Change the cursor back to the default cursor.
     *
     * @param evt
     */
    private void helpJButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_helpJButtonMouseExited
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    }//GEN-LAST:event_helpJButtonMouseExited

    /**
     * Open the help dialog.
     *
     * @param evt
     */
    private void helpJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_helpJButtonActionPerformed
        setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
        new HelpDialog(peptideShakerGUI, getClass().getResource("/helpFiles/PreferencesDialog.html"),
                Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/help.GIF")),
                Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")),
                "PeptideShaker - Help");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    }//GEN-LAST:event_helpJButtonActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel backgroundPanel;
    private javax.swing.JButton cancelButton;
    private javax.swing.JLabel flrLabel;
    private javax.swing.JTextField flrThresholdTxt;
    private javax.swing.JButton helpJButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JComboBox methodCmb;
    private javax.swing.JSpinner nAASpinner;
    private javax.swing.JComboBox neutralLossesCmb;
    private javax.swing.JLabel neutralLossesLabel;
    private javax.swing.JButton okButton;
    private javax.swing.JPanel optionsPanel;
    private javax.swing.JPanel optionsPanel1;
    private javax.swing.JPanel preferencesPanel;
    private javax.swing.JComboBox probabilitsticScoreCalculationCmb;
    private javax.swing.JLabel probalisticScoreCalculationLabel;
    private javax.swing.JLabel surroundingAminoAcidsLabel;
    private javax.swing.JCheckBox validatedCheck;
    // End of variables declaration//GEN-END:variables
}
TOP

Related Classes of eu.isas.peptideshaker.gui.preferencesdialogs.PreferencesDialog

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.