Package com.compomics.util.gui.tablemodels

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


            newItemSelection();
            updateSpectrum(row, false);

            if (column == psmTable.getColumn("  ").getModelIndex()) {
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                String key = psmKeys.get(tableModel.getViewIndex(row));
                if ((Boolean) psmTable.getValueAt(row, column)) {
                    peptideShakerGUI.getStarHider().starPsm(key);
                } else {
                    peptideShakerGUI.getStarHider().unStarPsm(key);
                }
            }

            if (column == 2 && evt != null && evt.getButton() == 1) {
                peptideShakerGUI.jumpToTab(PeptideShakerGUI.SPECTRUM_ID_TAB_INDEX);
            }

            // open the match validation level dialog
            if (column == psmTable.getColumn("").getModelIndex() && evt != null && evt.getButton() == MouseEvent.BUTTON1) {
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                String key = psmKeys.get(tableModel.getViewIndex(row));
                Identification identification = peptideShakerGUI.getIdentification();
                PSMaps pSMaps = new PSMaps();
                pSMaps = (PSMaps) identification.getUrParam(pSMaps);
                try {
                    MatchValidationDialog matchValidationDialog = new MatchValidationDialog(peptideShakerGUI, peptideShakerGUI.getExceptionHandler(),
View Full Code Here


        int column = proteinTable.getSelectedColumn();

        int proteinIndex = -1;

        if (row != -1) {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            proteinIndex = tableModel.getViewIndex(row);
        }

        if (evt == null || (evt.getButton() == MouseEvent.BUTTON1 && (proteinIndex != -1 && column != -1))) {

            if (proteinIndex != -1) {
View Full Code Here

        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);
                }
            }
View Full Code Here

                // check if we ought to show a tooltip with mod details
                String sequence = (String) peptideTable.getValueAt(row, column);

                if (sequence.contains("<span")) {
                    try {
                        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                        String peptideKey = peptideKeys.get(tableModel.getViewIndex(row));
                        String tooltip = peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey));
                        peptideTable.setToolTipText(tooltip);
                    } catch (Exception e) {
                        peptideShakerGUI.catchException(e);
                        e.printStackTrace();
View Full Code Here

                // check if we ought to show a tooltip with mod details
                String sequence = (String) psmTable.getValueAt(row, column);

                if (sequence.contains("<span")) {
                    try {
                        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                        int peptideIndex = tableModel.getViewIndex(peptideTable.getSelectedRow());
                        String peptideKey = peptideKeys.get(peptideIndex);
                        PeptideMatch currentPeptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);

                        tableModel = (SelfUpdatingTableModel) psmTable.getModel();
                        String spectrumKey = psmKeys.get(tableModel.getViewIndex(row));
                        SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                        PeptideAssumption peptideAssumption = spectrumMatch.getBestPeptideAssumption();

                        if (peptideAssumption.getPeptide().getMatchingKey(peptideShakerGUI.getSequenceMatchingPreferences()).equals(currentPeptideMatch.getTheoreticPeptide().getMatchingKey(peptideShakerGUI.getSequenceMatchingPreferences()))) {
                            String tooltip = peptideShakerGUI.getDisplayFeaturesGenerator().getPeptideModificationTooltipAsHtml(currentPeptideMatch);
View Full Code Here

     */
    private void exportSequenceCoverageContextJButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportSequenceCoverageContextJButtonActionPerformed
        try {
            if (proteinTable.getSelectedRow() != -1) {

                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
                Protein protein = sequenceFactory.getProtein(proteinKey);

                String clipboardString = protein.getSequence();
                StringSelection stringSelection = new StringSelection(clipboardString);
                Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
View Full Code Here

     * @param evt
     */
    private void coverageShowAllPeptidesJRadioButtonMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_coverageShowAllPeptidesJRadioButtonMenuItemActionPerformed
        if (proteinTable.getSelectedRow() != -1) {
            try {
                SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
                String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
                ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);
                updateSequenceCoverage(proteinKey, proteinMatch.getMainMatch(), true);
            } catch (Exception e) {
                peptideShakerGUI.catchException(e);
            }
View Full Code Here

     * proteins.
     */
    public void updatePeptidePanelTitle() {
        String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptides (";
        try {
            SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) proteinTable.getModel();
            IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
            String proteinKey = proteinKeys.get(tableModel.getViewIndex(proteinTable.getSelectedRow()));
            ProteinMatch proteinMatch = peptideShakerGUI.getIdentification().getProteinMatch(proteinKey);
            int nValidatedPeptides = identificationFeaturesGenerator.getNValidatedPeptides(proteinKey);
            int nConfidentPeptides = identificationFeaturesGenerator.getNConfidentPeptides(proteinKey);
            int nPeptides = proteinMatch.getPeptideCount();
            if (nConfidentPeptides > 0) {
View Full Code Here

     * @throws java.io.IOException
     * @throws java.lang.ClassNotFoundException
     * @throws java.lang.InterruptedException
     */
    public void updatePsmPanelTitle() throws SQLException, IOException, ClassNotFoundException, InterruptedException {
        SelfUpdatingTableModel tableModel = (SelfUpdatingTableModel) peptideTable.getModel();
        IdentificationFeaturesGenerator identificationFeaturesGenerator = peptideShakerGUI.getIdentificationFeaturesGenerator();
        int peptideIndex = tableModel.getViewIndex(peptideTable.getSelectedRow());
        String peptideKey = peptideKeys.get(peptideIndex);
        int nValidatedPsms = identificationFeaturesGenerator.getNValidatedSpectraForPeptide(peptideKey);
        int nConfidentPsms = identificationFeaturesGenerator.getNConfidentSpectraForPeptide(peptideKey);
        int nPsms = psmTable.getRowCount();
        String title = PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Peptide-Spectrum Matches (";
View Full Code Here

                // get the list of currently selected psms
                ArrayList<String> selectedPsmKeys = new ArrayList<String>();

                // get the currently selected peptide
                SelfUpdatingTableModel peptideTableModel = (SelfUpdatingTableModel) peptideTable.getModel();
                int peptideIndex = peptideTableModel.getViewIndex(peptideTable.getSelectedRow());
                String peptideKey = peptideKeys.get(peptideIndex);
                PeptideMatch selectedPeptideMatch = peptideShakerGUI.getIdentification().getPeptideMatch(peptideKey);
                //peptideShakerGUI.getIdentification().loadSpectrumMatches(selectedPeptideMatch.getSpectrumMatches(), null); // @TODO: not sure if loading all spectra is a good idea when we usually only need some of them??

                // get the currenly selected rows in the psm table
                int[] selectedPsmRows = psmTable.getSelectedRows();
                SelfUpdatingTableModel psmTableModel = (SelfUpdatingTableModel) psmTable.getModel();

                // iterate the selected psms rows
                for (int row : selectedPsmRows) {
                    int psmIndex = psmTableModel.getViewIndex(row);
                    String spectrumKey = psmKeys.get(psmIndex);
                    selectedPsmKeys.add(spectrumKey);
                    SpectrumMatch spectrumMatch = peptideShakerGUI.getIdentification().getSpectrumMatch(spectrumKey);
                    selectedIndexes.add((psmIndex + 1) + " " + spectrumMatch.getBestPeptideAssumption().getIdentificationCharge().toString());
                }
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.