/** Setup the main pane */
  private void setupMainPane() {
    this.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
    this.setLayout(new BorderLayout());
    this.setForeground(Color.white);

    // add data content browser as property change listener to data access monitor
    inspectorContext = (PrideInspectorContext) Desktop.getInstance().getDesktopContext();
  }
 /**
  * Open downloaded file
  *
  * @param output downloaded file
  */
 @SuppressWarnings("unchecked")
 private void openFile(File output) {
   publish("Opening file: " + output.getAbsolutePath());
   OpenFileTask openFileTask =
       new OpenFileTask(
           output,
           PrideXmlControllerImpl.class,
           "Opening download file",
           output.getAbsolutePath());
   // set task's gui blocker
   openFileTask.setGUIBlocker(new DefaultGUIBlocker(openFileTask, GUIBlocker.Scope.NONE, null));
   // add task listeners
   Desktop.getInstance().getDesktopContext().addTask(openFileTask);
 }
  /**
   * Build a table to display database search summaries.
   *
   * @return JTable database search table
   */
  public static JTable createDatabaseSearchTable() {
    DatabaseSearchTableModel tableModel = new DatabaseSearchTableModel();
    DefaultTableColumnModelExt columnModel = new DefaultTableColumnModelExt();
    DefaultPrideTable searchTable = new DefaultPrideTable(tableModel, columnModel);

    // hide row number column
    String rowNumHeader = DatabaseSearchTableModel.TableHeader.ROW_NUMBER_COLUMN.getHeader();
    TableColumnExt rowColumn = (TableColumnExt) searchTable.getColumn(rowNumHeader);
    rowColumn.setVisible(false);

    // add cell renderer to view column
    String viewColumnHeader = DatabaseSearchTableModel.TableHeader.VIEW.getHeader();
    TableColumnExt viewColumn = (TableColumnExt) searchTable.getColumn(viewColumnHeader);
    Icon icon =
        GUIUtilities.loadIcon(
            Desktop.getInstance().getDesktopContext().getProperty("add.experiment.small.icon"));
    viewColumn.setCellRenderer(new IconRenderer(icon));
    viewColumn.setMaxWidth(50);

    // pubmed column
    String pubmedHeader = DatabaseSearchTableModel.TableHeader.PUBMED_ID.getHeader();
    TableColumnExt pubmedColumn = (TableColumnExt) searchTable.getColumn(pubmedHeader);
    Pattern pubmedPattern = Pattern.compile("[\\d,]+");
    pubmedColumn.setCellRenderer(new HyperLinkCellRenderer(pubmedPattern));

    // add mouse motion listener
    searchTable.addMouseMotionListener(
        new TableCellMouseMotionListener(searchTable, viewColumnHeader, pubmedHeader));
    searchTable.addMouseListener(new OpenExperimentMouseListener(searchTable, viewColumnHeader));
    searchTable.addMouseListener(
        new HyperLinkCellMouseClickListener(
            searchTable,
            pubmedHeader,
            new PrefixedHyperLinkGenerator(Constants.PUBMED_URL_PERFIX),
            pubmedPattern));

    return searchTable;
  }
  private void addComponents() {
    PrideViewerContext context =
        (PrideViewerContext) uk.ac.ebi.pride.gui.desktop.Desktop.getInstance().getDesktopContext();
    context.getDataAccessMonitor().addPropertyChangeListener(this);
    // get property manager
    PropertyManager propMgr = context.getPropertyManager();
    // data source viewer
    DataSourceViewer dataSourceViewer = new DataSourceViewer();
    JScrollPane dataSourceScrollPane =
        new JScrollPane(
            dataSourceViewer,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    dataSourceScrollPane.setBorder(BorderFactory.createEmptyBorder());
    // get display related details
    Icon dataSourceViewerIcon =
        GUIUtilities.loadIcon(propMgr.getProperty("data.source.viewer.small.icon"));
    String dataSourceTitle = propMgr.getProperty("data.source.viewer.title");
    String dataSourceToolTip = propMgr.getProperty("data.source.viewer.tooltip");
    // add a tab
    dataSourceTabPane = new JTabbedPane();
    dataSourceTabPane.addTab(
        dataSourceTitle, dataSourceViewerIcon, dataSourceScrollPane, dataSourceToolTip);

    // experiemnt tree viewer
    ExperimentTreeViewer experimentTreeViewer = new ExperimentTreeViewer();
    // get display related details
    Icon expTreeViewerIcon =
        GUIUtilities.loadIcon(propMgr.getProperty("experiment.tree.viewer.small.icon"));
    String expTreeTitle = propMgr.getProperty("experiment.tree.viewer.title");
    String expTreeToolTip = propMgr.getProperty("experiment.tree.viewer.tooltip");
    // add a tab
    expTreeTabPane = new JTabbedPane();
    expTreeTabPane.addTab(expTreeTitle, expTreeViewerIcon, experimentTreeViewer, expTreeToolTip);

    this.add(dataSourceTabPane, BorderLayout.CENTER);
  }
 public static void main(String[] args) {
   Desktop.launch(PrideInspector.class, PrideInspectorContext.class, args);
 }
  /**
   * Create a table for peptide quantitative data
   *
   * @param se search engine
   * @return JTable peptide table
   */
  public static JTable createQuantPeptideTable(DataAccessController controller, SearchEngine se) {
    QuantPeptideTableModel tableModel = new QuantPeptideTableModel(se);
    DefaultTableColumnModelExt columnModel = new DefaultTableColumnModelExt();
    DefaultPrideTable quantPeptideTable = new DefaultPrideTable(tableModel, columnModel);
    quantPeptideTable.setAutoCreateColumnsFromModel(false);
    // add table model change listener
    tableModel.addTableModelListener(new BarChartColumnListener(quantPeptideTable));

    // hide protein accession
    TableColumnExt proteinAccColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PROTEIN_ACCESSION_COLUMN.getHeader());
    proteinAccColumn.setVisible(false);

    // hide mapped protein accession
    String mappedProtAccHeader =
        QuantPeptideTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader();
    TableColumnExt mappedProtAccColumn =
        (TableColumnExt) quantPeptideTable.getColumn(mappedProtAccHeader);
    mappedProtAccColumn.setCellRenderer(new HyperLinkCellRenderer());
    mappedProtAccColumn.setVisible(false);
    // add hyper link click listener
    quantPeptideTable.addMouseMotionListener(
        new TableCellMouseMotionListener(quantPeptideTable, mappedProtAccHeader));
    quantPeptideTable.addMouseListener(
        new HyperLinkCellMouseClickListener(
            quantPeptideTable, mappedProtAccHeader, new ProteinAccHyperLinkGenerator()));

    // peptide sequence column renderer
    TableColumnExt peptideColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PEPTIDE_PTM_COLUMN.getHeader());
    peptideColumn.setCellRenderer(new PeptideSequenceCellRenderer());
    // set peptide column width
    peptideColumn.setPreferredWidth(150);

    // hide protein name
    TableColumnExt proteinNameColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PROTEIN_NAME.getHeader());
    proteinNameColumn.setVisible(false);

    // hide protein status
    TableColumnExt proteinStatusColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PROTEIN_STATUS.getHeader());
    proteinStatusColumn.setVisible(false);

    // hide protein sequence coverage
    TableColumnExt proteinSeqCoverageColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PROTEIN_SEQUENCE_COVERAGE.getHeader());
    proteinSeqCoverageColumn.setVisible(false);

    // peptide sequence present in protein sequence
    TableColumnExt peptideFitColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(QuantPeptideTableModel.TableHeader.PEPTIDE_FIT.getHeader());
    peptideFitColumn.setCellRenderer(new PeptideFitCellRenderer());
    peptideFitColumn.setVisible(false);

    // precursor charge column
    TableColumnExt precursorChargeColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PRECURSOR_CHARGE_COLUMN.getHeader());
    precursorChargeColumn.setVisible(false);

    // delta mass column
    TableColumnExt deltaMassColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.DELTA_MASS_COLUMN.getHeader());
    deltaMassColumn.setVisible(false);
    double minLimit =
        Double.parseDouble(
            Desktop.getInstance().getDesktopContext().getProperty("delta.mz.min.limit"));
    double maxLimit =
        Double.parseDouble(
            Desktop.getInstance().getDesktopContext().getProperty("delta.mz.max.limit"));
    DeltaMZRenderer renderer = new DeltaMZRenderer(minLimit, maxLimit);
    deltaMassColumn.setCellRenderer(renderer);

    // precursor m/z column
    TableColumnExt precursorMzColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PRECURSOR_MZ_COLUMN.getHeader());
    precursorMzColumn.setVisible(false);

    // number of ptms column
    TableColumnExt ptmsColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PEPTIDE_PTM_NUMBER_COLUMN.getHeader());
    ptmsColumn.setVisible(false);
    ImageIcon icon =
        GUIUtilities.loadImageIcon(
            Desktop.getInstance().getDesktopContext().getProperty("open.ptm.small.icon"));
    ptmsColumn.setCellRenderer(new OpenPTMRenderer(icon));

    // hide modified peptide sequence
    TableColumnExt peptideSeqColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PEPTIDE_PTM_MASS_COLUMN.getHeader());
    peptideSeqColumn.setVisible(false);

    // hide ptm summary
    TableColumnExt ptmSummaryColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PEPTIDE_PTM_SUMMARY.getHeader());
    ptmSummaryColumn.setVisible(false);

    // hide number of fragment ions
    TableColumnExt fragIonsColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.NUMBER_OF_FRAGMENT_IONS_COLUMN.getHeader());
    fragIonsColumn.setVisible(false);

    // hide peptide sequence length
    TableColumnExt seqLengthColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.PEPTIDE_SEQUENCE_LENGTH_COLUMN.getHeader());
    seqLengthColumn.setVisible(false);

    // hide sequence start
    TableColumnExt sequenceStartColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.SEQUENCE_START_COLUMN.getHeader());
    sequenceStartColumn.setVisible(false);

    // hide sequence end
    TableColumnExt sequenceEndColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.SEQUENCE_END_COLUMN.getHeader());
    sequenceEndColumn.setVisible(false);

    // hide pi point column
    TableColumnExt piColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.THEORITICAL_ISOELECTRIC_POINT_COLUMN
                    .getHeader());
    piColumn.setVisible(false);

    // hide spectrum id
    TableColumnExt spectrumIdColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(QuantPeptideTableModel.TableHeader.SPECTRUM_ID.getHeader());
    spectrumIdColumn.setVisible(false);

    // hide protein id column
    TableColumnExt proteinIdColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(
                QuantPeptideTableModel.TableHeader.IDENTIFICATION_ID.getHeader());
    proteinIdColumn.setVisible(false);

    // hide peptide id column
    TableColumnExt peptideIdColumn =
        (TableColumnExt)
            quantPeptideTable.getColumn(QuantPeptideTableModel.TableHeader.PEPTIDE_ID.getHeader());
    peptideIdColumn.setVisible(false);

    // add hyper link click listener
    String protAccColumnHeader =
        QuantPeptideTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader();
    quantPeptideTable.addMouseMotionListener(
        new TableCellMouseMotionListener(quantPeptideTable, protAccColumnHeader));
    quantPeptideTable.addMouseListener(
        new HyperLinkCellMouseClickListener(
            quantPeptideTable, protAccColumnHeader, new ProteinAccHyperLinkGenerator()));

    // additional column
    String additionalColHeader = ProteinTableModel.TableHeader.ADDITIONAL.getHeader();
    TableColumnExt additionalCol =
        (TableColumnExt) quantPeptideTable.getColumn(additionalColHeader);
    Icon detailIcon =
        GUIUtilities.loadIcon(
            Desktop.getInstance().getDesktopContext().getProperty("view.detail.small.icon"));
    additionalCol.setCellRenderer(new IconRenderer(detailIcon));
    additionalCol.setMaxWidth(50);
    additionalCol.setVisible(false);

    // add mouse motion listener
    quantPeptideTable.addMouseMotionListener(
        new TableCellMouseMotionListener(quantPeptideTable, additionalColHeader));
    quantPeptideTable.addMouseListener(
        new ShowParamsMouseListener(controller, quantPeptideTable, additionalColHeader));

    return quantPeptideTable;
  }
  /**
   * Build a table to display identification related details.
   *
   * @param controller data access controller
   * @return JTable identification table
   */
  public static JTable createIdentificationTable(DataAccessController controller) {
    ProteinTableModel identTableModel = new ProteinTableModel();
    DefaultTableColumnModelExt columnModel = new DefaultTableColumnModelExt();
    DefaultPrideTable table = new DefaultPrideTable(identTableModel, columnModel);

    TableColumnExt proteinIdColumn =
        (TableColumnExt)
            table.getColumn(ProteinTableModel.TableHeader.IDENTIFICATION_ID.getHeader());
    proteinIdColumn.setVisible(false);

    TableColumnExt proteinNameColumn =
        (TableColumnExt) table.getColumn(ProteinTableModel.TableHeader.PROTEIN_NAME.getHeader());
    // set protein name width
    proteinNameColumn.setPreferredWidth(200);

    // hide the protein name column
    proteinNameColumn.setVisible(false);

    // protein status column
    TableColumnExt proteinStatusColumn =
        (TableColumnExt) table.getColumn(ProteinTableModel.TableHeader.PROTEIN_STATUS.getHeader());
    proteinStatusColumn.setVisible(false);

    // sequence coverage column
    TableColumnExt seqCoverageColumn =
        (TableColumnExt)
            table.getColumn(ProteinTableModel.TableHeader.PROTEIN_SEQUENCE_COVERAGE.getHeader());
    seqCoverageColumn.setCellRenderer(new SequenceCoverageRenderer());
    seqCoverageColumn.setVisible(false);

    // isoelectric point column
    TableColumnExt isoelectricColumn =
        (TableColumnExt)
            table.getColumn(
                ProteinTableModel.TableHeader.THEORITICAL_ISOELECTRIC_POINT_COLUMN.getHeader());
    isoelectricColumn.setVisible(false);

    // add hyper link click listener
    String protAccColumnHeader =
        ProteinTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader();
    table.addMouseMotionListener(new TableCellMouseMotionListener(table, protAccColumnHeader));
    table.addMouseListener(
        new HyperLinkCellMouseClickListener(
            table, protAccColumnHeader, new ProteinAccHyperLinkGenerator()));

    // ptm accession hyperlink
    TableColumn protAcc =
        table.getColumn(ProteinTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader());
    protAcc.setCellRenderer(new HyperLinkCellRenderer());

    // additional column
    String additionalColHeader = ProteinTableModel.TableHeader.ADDITIONAL.getHeader();
    TableColumnExt additionalCol = (TableColumnExt) table.getColumn(additionalColHeader);
    Icon icon =
        GUIUtilities.loadIcon(
            Desktop.getInstance().getDesktopContext().getProperty("view.detail.small.icon"));
    additionalCol.setCellRenderer(new IconRenderer(icon));
    additionalCol.setMaxWidth(50);

    // add mouse motion listener
    table.addMouseMotionListener(new TableCellMouseMotionListener(table, additionalColHeader));
    table.addMouseListener(new ShowParamsMouseListener(controller, table, additionalColHeader));

    return table;
  }
  /**
   * Create a table for quantitative protein data with a given table model
   *
   * @param tableModel quant protein table model
   * @return JTable quant protein table
   */
  public static JTable createQuantProteinTable(
      DataAccessController controller, TableModel tableModel) {
    DefaultTableColumnModelExt columnModel = new DefaultTableColumnModelExt();
    DefaultPrideTable quantProteinTable = new DefaultPrideTable(tableModel, columnModel);
    quantProteinTable.setAutoCreateColumnsFromModel(false);
    // add table model change listener
    tableModel.addTableModelListener(new BarChartColumnListener(quantProteinTable));

    // in case the compare doesn't exist
    List<TableColumn> columns = columnModel.getColumns(true);
    for (TableColumn column : columns) {
      if (column.getHeaderValue().equals(QuantProteinTableModel.TableHeader.COMPARE.getHeader())) {
        column.setMaxWidth(25);
      }
    }
    // hide mapped protein accession
    String mappedProtAccHeader =
        QuantProteinTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader();
    TableColumnExt mappedProtAccColumn =
        (TableColumnExt) quantProteinTable.getColumn(mappedProtAccHeader);
    mappedProtAccColumn.setCellRenderer(new HyperLinkCellRenderer());
    // add hyper link click listener
    quantProteinTable.addMouseMotionListener(
        new TableCellMouseMotionListener(quantProteinTable, mappedProtAccHeader));
    quantProteinTable.addMouseListener(
        new HyperLinkCellMouseClickListener(
            quantProteinTable, mappedProtAccHeader, new ProteinAccHyperLinkGenerator()));

    TableColumnExt proteinIdColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.IDENTIFICATION_ID.getHeader());
    proteinIdColumn.setVisible(false);

    // hide the protein name column
    TableColumnExt proteinNameColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.PROTEIN_NAME.getHeader());
    proteinNameColumn.setVisible(false);

    // protein status column
    TableColumnExt proteinStatusColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.PROTEIN_STATUS.getHeader());
    proteinStatusColumn.setVisible(false);

    // sequence coverage column
    TableColumnExt seqCoverageColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.PROTEIN_SEQUENCE_COVERAGE.getHeader());
    seqCoverageColumn.setCellRenderer(new SequenceCoverageRenderer());
    seqCoverageColumn.setVisible(false);

    // isoelectric point column
    TableColumnExt isoelectricColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.THEORITICAL_ISOELECTRIC_POINT_COLUMN
                    .getHeader());
    isoelectricColumn.setVisible(false);

    // score
    TableColumnExt proteinScoreColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.IDENTIFICATION_SCORE_COLUMN.getHeader());
    proteinScoreColumn.setVisible(false);

    // threshold
    TableColumnExt proteinThresholdColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.IDENTIFICATION_THRESHOLD_COLUMN.getHeader());
    proteinThresholdColumn.setVisible(false);

    // number of peptides
    TableColumnExt numOfPeptideColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.NUMBER_OF_PEPTIDES.getHeader());
    numOfPeptideColumn.setVisible(false);

    // number of unique peptides
    TableColumnExt numOfUniquePeptideColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.NUMBER_OF_UNIQUE_PEPTIDES.getHeader());
    numOfUniquePeptideColumn.setVisible(false);

    // number of ptms
    TableColumnExt numOfPtmColumn =
        (TableColumnExt)
            quantProteinTable.getColumn(
                QuantProteinTableModel.TableHeader.NUMBER_OF_PTMS.getHeader());
    numOfPtmColumn.setVisible(false);

    // additional column
    String additionalColHeader = ProteinTableModel.TableHeader.ADDITIONAL.getHeader();
    TableColumnExt additionalCol =
        (TableColumnExt) quantProteinTable.getColumn(additionalColHeader);
    Icon icon =
        GUIUtilities.loadIcon(
            Desktop.getInstance().getDesktopContext().getProperty("view.detail.small.icon"));
    additionalCol.setCellRenderer(new IconRenderer(icon));
    additionalCol.setMaxWidth(50);
    additionalCol.setVisible(false);

    // add mouse motion listener
    quantProteinTable.addMouseMotionListener(
        new TableCellMouseMotionListener(quantProteinTable, additionalColHeader));
    quantProteinTable.addMouseListener(
        new ShowParamsMouseListener(controller, quantProteinTable, additionalColHeader));

    return quantProteinTable;
  }
  /**
   * Build a table to display peptide related details.
   *
   * @param se search engine
   * @param controller data access controller
   * @return JTable peptide table
   */
  public static JTable createPeptideTable(SearchEngine se, DataAccessController controller) {

    PeptideTableModel peptideTableModel = new PeptideTableModel(se);
    DefaultTableColumnModelExt columnModel = new DefaultTableColumnModelExt();
    DefaultPrideTable table = new DefaultPrideTable(peptideTableModel, columnModel);

    // peptide sequence column renderer
    TableColumnExt peptideColumn =
        (TableColumnExt)
            table.getColumn(PeptideTableModel.TableHeader.PEPTIDE_PTM_COLUMN.getHeader());
    peptideColumn.setCellRenderer(new PeptideSequenceCellRenderer());

    // delta mass column
    TableColumnExt deltaMassColumn =
        (TableColumnExt)
            table.getColumn(PeptideTableModel.TableHeader.DELTA_MASS_COLUMN.getHeader());
    double minLimit =
        Double.parseDouble(
            Desktop.getInstance().getDesktopContext().getProperty("delta.mz.min.limit"));
    double maxLimit =
        Double.parseDouble(
            Desktop.getInstance().getDesktopContext().getProperty("delta.mz.max.limit"));
    DeltaMZRenderer renderer = new DeltaMZRenderer(minLimit, maxLimit);
    deltaMassColumn.setCellRenderer(renderer);

    // peptide sequence present in protein sequence
    TableColumnExt peptideFitColumn =
        (TableColumnExt) table.getColumn(PeptideTableModel.TableHeader.PEPTIDE_FIT.getHeader());
    peptideFitColumn.setCellRenderer(new PeptideFitCellRenderer());
    peptideFitColumn.setVisible(false);

    // hide modified peptide sequence
    TableColumnExt peptideSeqColumn =
        (TableColumnExt)
            table.getColumn(PeptideTableModel.TableHeader.PEPTIDE_PTM_MASS_COLUMN.getHeader());
    peptideSeqColumn.setVisible(false);

    // hide protein id column
    TableColumnExt proteinIdColumn =
        (TableColumnExt)
            table.getColumn(PeptideTableModel.TableHeader.IDENTIFICATION_ID.getHeader());
    proteinIdColumn.setVisible(false);

    // hide peptide id column
    TableColumnExt peptideIdColumn =
        (TableColumnExt) table.getColumn(PeptideTableModel.TableHeader.PEPTIDE_ID.getHeader());
    peptideIdColumn.setVisible(false);

    // set protein name column width
    TableColumnExt proteinNameColumn =
        (TableColumnExt) table.getColumn(PeptideTableModel.TableHeader.PROTEIN_NAME.getHeader());
    proteinNameColumn.setPreferredWidth(200);

    // hide the protein name column
    proteinNameColumn.setVisible(false);

    // protein status column
    TableColumnExt proteinStatusColumn =
        (TableColumnExt) table.getColumn(PeptideTableModel.TableHeader.PROTEIN_STATUS.getHeader());
    proteinStatusColumn.setVisible(false);

    // sequence coverage column
    TableColumnExt coverageColumn =
        (TableColumnExt)
            table.getColumn(PeptideTableModel.TableHeader.PROTEIN_SEQUENCE_COVERAGE.getHeader());
    coverageColumn.setCellRenderer(new SequenceCoverageRenderer());
    coverageColumn.setVisible(false);

    // add hyper link click listener
    String protAccColumnHeader =
        PeptideTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader();
    table.addMouseMotionListener(new TableCellMouseMotionListener(table, protAccColumnHeader));
    table.addMouseListener(
        new HyperLinkCellMouseClickListener(
            table, protAccColumnHeader, new ProteinAccHyperLinkGenerator()));

    // ptm accession hyperlink
    TableColumnExt protAcc =
        (TableColumnExt)
            table.getColumn(
                PeptideTableModel.TableHeader.MAPPED_PROTEIN_ACCESSION_COLUMN.getHeader());
    protAcc.setCellRenderer(new HyperLinkCellRenderer());

    // set peptide column width
    peptideColumn.setPreferredWidth(200);

    // hide spectrum id column
    String spectrumIdHeader = PeptideTableModel.TableHeader.SPECTRUM_ID.getHeader();
    TableColumnExt spectrumIdColumn = (TableColumnExt) table.getColumn(spectrumIdHeader);
    spectrumIdColumn.setVisible(false);

    // additional column
    String additionalColHeader = PeptideTableModel.TableHeader.ADDITIONAL.getHeader();
    TableColumnExt additionalCol = (TableColumnExt) table.getColumn(additionalColHeader);
    Icon icon =
        GUIUtilities.loadIcon(
            Desktop.getInstance().getDesktopContext().getProperty("view.detail.small.icon"));
    additionalCol.setCellRenderer(new IconRenderer(icon));
    additionalCol.setMaxWidth(50);

    // hide pI column
    String pIHeader =
        PeptideTableModel.TableHeader.THEORITICAL_ISOELECTRIC_POINT_COLUMN.getHeader();
    TableColumnExt pICol = (TableColumnExt) table.getColumn(pIHeader);
    pICol.setVisible(false);

    // add mouse motion listener
    table.addMouseMotionListener(new TableCellMouseMotionListener(table, additionalColHeader));
    table.addMouseListener(new ShowParamsMouseListener(controller, table, additionalColHeader));

    return table;
  }