Package com.compomics.util.gui.tablemodels

Examples of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel


                        null, selectedProteins, true, false, true, true, true,
                        true, true, true, true, false, true,
                        true, true, true, true, true, false, true, false, false, false, true, true);
            } else if (tableIndex == TableIndex.PEPTIDE_TABLE) {
                ArrayList<String> selectedPeptides = getDisplayedPeptides();
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
                outputGenerator.getPeptidesOutput(
                        null, selectedPeptides, null, true, false, true, true, true, true, true,
                        true, true, true, true, true, true, true, true, false, false, false, proteinKey, true);
            } else if (tableIndex == TableIndex.PSM_TABLE) {
                ArrayList<String> selectedPsms = getDisplayedPsms();
View Full Code Here


        String proteinKey = PeptideShakerGUI.NO_SELECTION;
        String peptideKey = PeptideShakerGUI.NO_SELECTION;
        String psmKey = PeptideShakerGUI.NO_SELECTION;

        if (proteinTable.getSelectedRow() != -1) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
        }
        if (peptideTable.getSelectedRow() != -1) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
            peptideKey = peptideKeys.get(tableModel.getViewIndex(peptideTable.getSelectedRow()));
        }
        if (psmTable.getSelectedRow() != -1) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
            psmKey = psmKeys.get(tableModel.getViewIndex(psmTable.getSelectedRow()));
        }

        peptideShakerGUI.setSelectedItems(proteinKey, peptideKey, psmKey);
    }
View Full Code Here

     * @return the row of the desired protein
     */
    private int getProteinRow(String proteinKey) {
        int modelIndex = proteinKeys.indexOf(proteinKey);
        if (modelIndex >= 0) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            return tableModel.getRowNumber(modelIndex);
        } else {
            return -1;
        }
    }
View Full Code Here

     * @return the row of the desired peptide
     */
    private int getPeptideRow(String peptideKey) {
        int modelIndex = peptideKeys.indexOf(peptideKey);
        if (modelIndex >= 0) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
            return tableModel.getRowNumber(modelIndex);
        } else {
            return -1;
        }
    }
View Full Code Here

     * @return the row of the desired psm
     */
    private int getPsmRow(String psmKey) {
        int modelIndex = psmKeys.indexOf(psmKey);
        if (modelIndex >= 0) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
            return tableModel.getRowNumber(modelIndex);
        } else {
            return -1;
        }
    }
View Full Code Here

            // new peptide, reset spectrum boundaries
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                    updateSpectrum(tableModel.getViewIndex(psmTable.getSelectedRow()), true);
                }
            });

            // reset the range
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    ((CategoryPlot) coverageChart.getChart().getPlot()).getRangeAxis().setRange(oldRange);
                    coverageChart.revalidate();
                    coverageChart.repaint();
                }
            });

        } else {
            // show popup menu
            JPopupMenu peptidesPopupMenu = new JPopupMenu();

            for (ResidueAnnotation currentAnnotation : allAnnotation) {
                if (currentAnnotation.isClickable()) {
                    String text = "<html>" + (peptidesPopupMenu.getComponentCount() + 1) + ": " + currentAnnotation.getAnnotation() + "</html>";
                    final String peptideKey = currentAnnotation.getIdentifier();
                    JMenuItem menuItem = new JMenuItem(text);
                    menuItem.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent evt) {

                            // select the peptide
                            peptideShakerGUI.setSelectedItems(peptideShakerGUI.getSelectedProteinKey(), peptideKey, PeptideShakerGUI.NO_SELECTION);
                            updateSelection(true);

                            // update the psms
                            peptideShakerGUI.setSelectedItems(peptideShakerGUI.getSelectedProteinKey(), peptideKey, PeptideShakerGUI.NO_SELECTION);

                            // update the psm selection
                            updatePsmSelection(peptideTable.getSelectedRow());

                            // new peptide, reset spectrum boundaries
                            SwingUtilities.invokeLater(new Runnable() {
                                @Override
                                public void run() {
                                    SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                                    updateSpectrum(tableModel.getViewIndex(psmTable.getSelectedRow()), true);
                                }
                            });

                            // reset the range
                            // invoke later to give time for components to update
View Full Code Here

TOP

Related Classes of com.compomics.util.gui.tablemodels.SelfUpdatingTableModel

Copyright © 2018 www.massapicom. 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.