int row = peptideTable.getSelectedRow();
final int column = peptideTable.getSelectedColumn();
if (row != -1) {
SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
int peptideIndex = tableModel.getViewIndex(row);
String peptideKey = peptideKeys.get(peptideIndex);
peptideShakerGUI.setSelectedItems(peptideShakerGUI.getSelectedProteinKey(), peptideKey, PeptideShakerGUI.NO_SELECTION);
// update the psm selection
updatePsmSelection(row);
// new peptide, reset spectrum boundaries
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (psmTable.getSelectedRow() != -1) {
SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
updateSpectrum(tableModel.getViewIndex(psmTable.getSelectedRow()), true);
peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
}
}
});
if (column == peptideTable.getColumn(" ").getModelIndex()) {
if ((Boolean) peptideTable.getValueAt(row, column)) {
peptideShakerGUI.getStarHider().starPeptide(peptideKey);
} else {
peptideShakerGUI.getStarHider().unStarPeptide(peptideKey);
}
}
// open the protein inference at the petide level dialog
if (column == peptideTable.getColumn("PI").getModelIndex() && evt != null && evt.getButton() == MouseEvent.BUTTON1) {
try {
tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
new ProteinInferencePeptideLevelDialog(peptideShakerGUI, true, peptideKey, proteinKey);
} catch (Exception e) {
peptideShakerGUI.catchException(e);
}
}