/**
   * Sets the main match if the main match column is selected, or opens the protein web link if the
   * accession number column is selected.
   *
   * @param evt
   */
  private void proteinMatchTableMouseReleased(
      java.awt.event.MouseEvent evt) { // GEN-FIRST:event_proteinMatchTableMouseReleased

    int row = proteinMatchTable.rowAtPoint(evt.getPoint());
    int column = proteinMatchTable.columnAtPoint(evt.getPoint());

    if (row != -1) {

      if (column == 1) {
        try {
          inspectedMatch.setMainMatch(accessions.get(row));
          identification.updateProteinMatch(inspectedMatch);
          peptideShakerGUI
              .getIdentificationFeaturesGenerator()
              .updateCoverableAA(inspectedMatch.getKey());
          peptideShakerGUI
              .getIdentificationFeaturesGenerator()
              .updateSequenceCoverage(inspectedMatch.getKey());
          peptideShakerGUI
              .getIdentificationFeaturesGenerator()
              .updateObservableCoverage(inspectedMatch.getKey());
        } catch (Exception e) {
          peptideShakerGUI.catchException(e);
        }
        proteinMatchTable.revalidate();
        proteinMatchTable.repaint();
      } else if (column == 2) {

        // open protein link in web browser
        if (evt.getButton() == MouseEvent.BUTTON1
            && ((String) proteinMatchTable.getValueAt(row, column)).lastIndexOf("<html>") != -1) {

          String link = (String) proteinMatchTable.getValueAt(row, column);
          link = link.substring(link.indexOf("\"") + 1);
          link = link.substring(0, link.indexOf("\""));

          this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
          BareBonesBrowserLaunch.openURL(link);
          this.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        }
      }
    }
  } // GEN-LAST:event_proteinMatchTableMouseReleased