Search in sources :

Example 1 with JSparklinesIntegerColorTableCellRenderer

use of no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer in project peptide-shaker by compomics.

the class SpectrumIdentificationPanel method setTableProperties.

/**
 * Set up the properties of the tables.
 */
private void setTableProperties() {
    // correct the color for the upper right corner
    JPanel spectrumCorner = new JPanel();
    spectrumCorner.setBackground(spectrumTable.getTableHeader().getBackground());
    spectrumTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, spectrumCorner);
    JPanel idResultsCorner = new JPanel();
    idResultsCorner.setBackground(searchResultsTable.getTableHeader().getBackground());
    idResultsTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, idResultsCorner);
    peptideShakerJTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    searchResultsTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    peptideShakerJTable.getTableHeader().setReorderingAllowed(false);
    spectrumTable.getTableHeader().setReorderingAllowed(false);
    searchResultsTable.getTableHeader().setReorderingAllowed(false);
    spectrumTable.setAutoCreateRowSorter(true);
    // make sure that the user is made aware that the tool is doing something during sorting of the spectrum table
    spectrumTable.getRowSorter().addRowSorterListener(new RowSorterListener() {

        @Override
        public void sorterChanged(RowSorterEvent e) {
            if (e.getType() == RowSorterEvent.Type.SORT_ORDER_CHANGED) {
                peptideShakerGUI.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
                spectrumTable.getTableHeader().setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
                // change the peptide shaker icon to a "waiting version"
                peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker-orange.gif")));
            } else if (e.getType() == RowSorterEvent.Type.SORTED) {
                peptideShakerGUI.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
                spectrumTable.getTableHeader().setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
                // change the peptide shaker icon to a "waiting version"
                peptideShakerGUI.setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
            }
        }
    });
    spectrumTable.getTableHeader().addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            spectrumTableMouseClicked(e);
        }
    });
    peptideShakerJTable.getColumn(" ").setMinWidth(30);
    peptideShakerJTable.getColumn(" ").setMaxWidth(30);
    peptideShakerJTable.getColumn("  ").setMinWidth(30);
    peptideShakerJTable.getColumn("  ").setMaxWidth(30);
    spectrumTable.getColumn(" ").setMinWidth(50);
    spectrumTable.getColumn(" ").setMaxWidth(50);
    spectrumTable.getColumn("  ").setMinWidth(30);
    spectrumTable.getColumn("  ").setMaxWidth(30);
    spectrumTable.getColumn("Confidence").setMaxWidth(90);
    spectrumTable.getColumn("Confidence").setMinWidth(90);
    searchResultsTable.getColumn(" ").setMinWidth(30);
    searchResultsTable.getColumn(" ").setMaxWidth(30);
    searchResultsTable.getColumn("SE").setMinWidth(37);
    searchResultsTable.getColumn("SE").setMaxWidth(37);
    searchResultsTable.getColumn("Rnk").setMinWidth(37);
    searchResultsTable.getColumn("Rnk").setMaxWidth(37);
    searchResultsTable.getColumn("  ").setMinWidth(30);
    searchResultsTable.getColumn("  ").setMaxWidth(30);
    peptideShakerJTable.getColumn("ID").setMaxWidth(37);
    peptideShakerJTable.getColumn("ID").setMinWidth(37);
    spectrumTable.getColumn("ID").setMaxWidth(37);
    spectrumTable.getColumn("ID").setMinWidth(37);
    peptideShakerJTable.getColumn("Confidence").setMaxWidth(90);
    peptideShakerJTable.getColumn("Confidence").setMinWidth(90);
    searchResultsTable.getColumn("Confidence").setMaxWidth(90);
    searchResultsTable.getColumn("Confidence").setMinWidth(90);
    searchResultsTable.getColumn("Charge").setMaxWidth(90);
    searchResultsTable.getColumn("Charge").setMinWidth(90);
    // set up the psm color map
    HashMap<Integer, java.awt.Color> softwareAgreementColorMap = new HashMap<>();
    // id softwares agree with PTM certainty
    softwareAgreementColorMap.put(AGREEMENT_WITH_MODS, peptideShakerGUI.getSparklineColor());
    // id softwares agree on peptide but not ptm certainty
    softwareAgreementColorMap.put(AGREEMENT, java.awt.Color.CYAN);
    // id softwares don't agree
    softwareAgreementColorMap.put(CONFLICT, java.awt.Color.YELLOW);
    // some id softwares id'ed some didn't
    softwareAgreementColorMap.put(PARTIALLY_MISSING, java.awt.Color.ORANGE);
    // set up the psm tooltip map
    HashMap<Integer, String> idSoftwareTooltipMap = new HashMap<>();
    idSoftwareTooltipMap.put(AGREEMENT_WITH_MODS, "ID Software Agree");
    idSoftwareTooltipMap.put(AGREEMENT, "ID Software Agree - PTM Certainty Issues");
    idSoftwareTooltipMap.put(CONFLICT, "ID Software Disagree");
    idSoftwareTooltipMap.put(PARTIALLY_MISSING, "ID Software(s) Missing");
    peptideShakerJTable.getColumn("ID").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(java.awt.Color.lightGray, softwareAgreementColorMap, idSoftwareTooltipMap));
    peptideShakerJTable.getColumn("Protein(s)").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    peptideShakerJTable.getColumn("Confidence").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) peptideShakerJTable.getColumn("Confidence").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
    searchResultsTable.getColumn("SE").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(java.awt.Color.lightGray, Advocate.getAdvocateColorMap(), Advocate.getAdvocateToolTipMap()));
    searchResultsTable.getColumn("Confidence").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) searchResultsTable.getColumn("Confidence").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
    searchResultsTable.getColumn("Charge").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 10d, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) searchResultsTable.getColumn("Charge").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 30);
    // set up the psm color map
    HashMap<Integer, java.awt.Color> idSoftwareSpectrumLevelColorMap = new HashMap<>();
    // id softwares agree with PTM certainty
    idSoftwareSpectrumLevelColorMap.put(AGREEMENT_WITH_MODS, peptideShakerGUI.getSparklineColor());
    // id softwares agree on peptide but not ptm certainty
    idSoftwareSpectrumLevelColorMap.put(AGREEMENT, java.awt.Color.CYAN);
    // id softwares don't agree
    idSoftwareSpectrumLevelColorMap.put(CONFLICT, java.awt.Color.YELLOW);
    // some id softwares id'ed some didn't
    idSoftwareSpectrumLevelColorMap.put(PARTIALLY_MISSING, java.awt.Color.ORANGE);
    // no psm
    idSoftwareSpectrumLevelColorMap.put(NO_ID, java.awt.Color.lightGray);
    // set up the psm tooltip map
    HashMap<Integer, String> idSoftwareSpectrumLevelTooltipMap = new HashMap<>();
    idSoftwareSpectrumLevelTooltipMap.put(AGREEMENT_WITH_MODS, "ID Software Agree");
    idSoftwareSpectrumLevelTooltipMap.put(AGREEMENT, "ID Software Agree - PTM Certainty Issues");
    idSoftwareSpectrumLevelTooltipMap.put(CONFLICT, "ID Software Disagree");
    idSoftwareSpectrumLevelTooltipMap.put(PARTIALLY_MISSING, "ID Software(s) Missing");
    idSoftwareSpectrumLevelTooltipMap.put(NO_ID, "(No PSM)");
    spectrumTable.getColumn("ID").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(java.awt.Color.lightGray, idSoftwareSpectrumLevelColorMap, idSoftwareSpectrumLevelTooltipMap));
    spectrumTable.getColumn("m/z").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, peptideShakerGUI.getSparklineColor()));
    spectrumTable.getColumn("Charge").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 4d, peptideShakerGUI.getSparklineColor()));
    spectrumTable.getColumn("Int").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 1000d, peptideShakerGUI.getSparklineColor()));
    spectrumTable.getColumn("RT (min)").setCellRenderer(new JSparklinesIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, 0d, 1000d, 10d, peptideShakerGUI.getSparklineColor(), peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("m/z").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Charge").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 30);
    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Int").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    ((JSparklinesIntervalChartTableCellRenderer) spectrumTable.getColumn("RT (min)").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() + 5);
    ((JSparklinesIntervalChartTableCellRenderer) spectrumTable.getColumn("RT (min)").getCellRenderer()).showReferenceLine(true, 0.02, java.awt.Color.BLACK);
    spectrumTable.getColumn("Confidence").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Confidence").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
    spectrumTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    spectrumTable.getColumn("Protein(s)").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    // set up the table header tooltips
    idSoftwareTableToolTips = new ArrayList<>();
    idSoftwareTableToolTips.add(null);
    idSoftwareTableToolTips.add("Identification Software");
    idSoftwareTableToolTips.add("Validated Peptide Spectrum Matches");
    idSoftwareTableToolTips.add("Unique Pepttide-Spectrum Matches");
    idSoftwareTableToolTips.add("Unassigned Spectra");
    idSoftwareTableToolTips.add("Identificaiton Rate (%)");
    if (peptideShakerGUI.getDisplayParameters().showScores()) {
        spectrumTable.getColumn("Score").setMaxWidth(90);
        spectrumTable.getColumn("Score").setMinWidth(90);
        peptideShakerJTable.getColumn("Score").setMaxWidth(90);
        peptideShakerJTable.getColumn("Score").setMinWidth(90);
        searchResultsTable.getColumn("Score").setMaxWidth(90);
        searchResultsTable.getColumn("Score").setMinWidth(90);
        spectrumTable.getColumn("Score").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
        ((JSparklinesBarChartTableCellRenderer) spectrumTable.getColumn("Score").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
        peptideShakerJTable.getColumn("Score").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, peptideShakerGUI.getSparklineColor()));
        ((JSparklinesBarChartTableCellRenderer) peptideShakerJTable.getColumn("Score").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
        searchResultsTable.getColumn("Score").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, peptideShakerGUI.getSparklineColor()));
        ((JSparklinesBarChartTableCellRenderer) searchResultsTable.getColumn("Score").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
        spectrumTableToolTips = new ArrayList<>();
        spectrumTableToolTips.add(null);
        spectrumTableToolTips.add("ID Software Agreement");
        spectrumTableToolTips.add("Spectrum Title");
        spectrumTableToolTips.add("Precursor m/z");
        spectrumTableToolTips.add("Precursor Charge");
        spectrumTableToolTips.add("Precursor Intensity");
        spectrumTableToolTips.add("Precursor Retention Time in Minutes");
        spectrumTableToolTips.add("Peptide Sequence");
        spectrumTableToolTips.add("Mapping Protein(s)");
        spectrumTableToolTips.add("Peptide Spectrum Match Score");
        spectrumTableToolTips.add("Peptide Spectrum Match Confidence");
        spectrumTableToolTips.add("Validated");
        peptideShakerTableToolTips = new ArrayList<>();
        peptideShakerTableToolTips.add(null);
        peptideShakerTableToolTips.add("ID Software Agreement");
        peptideShakerTableToolTips.add("Peptide Sequence");
        peptideShakerTableToolTips.add("Mapping Protein(s)");
        peptideShakerTableToolTips.add("Peptide Spectrum Match score");
        peptideShakerTableToolTips.add("Peptide Spectrum Match Confidence");
        peptideShakerTableToolTips.add("Validated");
        idResultsTableToolTips = new ArrayList<>();
        idResultsTableToolTips.add("Peptide Rank");
        idResultsTableToolTips.add("Search Engine / Identification Software");
        idResultsTableToolTips.add("Search Engine Rank / Identification Software Rank");
        idResultsTableToolTips.add("Peptide Sequence");
        idResultsTableToolTips.add("Precursor Charge");
        idResultsTableToolTips.add("Peptide Spectrum Match Score");
        idResultsTableToolTips.add("Peptide Spectrum Match Confidence");
        idResultsTableToolTips.add("Validated");
    } else {
        // set up the table header tooltips
        spectrumTableToolTips = new ArrayList<>();
        spectrumTableToolTips.add(null);
        spectrumTableToolTips.add("ID Software Agreement");
        spectrumTableToolTips.add("Spectrum Title");
        spectrumTableToolTips.add("Precursor m/z");
        spectrumTableToolTips.add("Precursor Charge");
        spectrumTableToolTips.add("Precursor Intensity");
        spectrumTableToolTips.add("Precursor Retention Time in Minutes");
        spectrumTableToolTips.add("Peptide Sequence");
        spectrumTableToolTips.add("Mapping Protein(s)");
        spectrumTableToolTips.add("Peptide Spectrum Match Confidence");
        spectrumTableToolTips.add("Validated");
        peptideShakerTableToolTips = new ArrayList<>();
        peptideShakerTableToolTips.add(null);
        peptideShakerTableToolTips.add("ID Software Agreement");
        peptideShakerTableToolTips.add("Peptide Sequence");
        peptideShakerTableToolTips.add("Mapping Protein(s)");
        peptideShakerTableToolTips.add("Peptide Spectrum Match Confidence");
        peptideShakerTableToolTips.add("Validated");
        idResultsTableToolTips = new ArrayList<>();
        idResultsTableToolTips.add("Peptide Rank");
        idResultsTableToolTips.add("Search Engine / Identification Software");
        idResultsTableToolTips.add("Search Engine Rank / Identification Software Rank");
        idResultsTableToolTips.add("Peptide Sequence");
        idResultsTableToolTips.add("Precursor Charge");
        idResultsTableToolTips.add("Peptide Spectrum Match Confidence");
        idResultsTableToolTips.add("Validated");
    }
}
Also used : JPanel(javax.swing.JPanel) MouseEvent(java.awt.event.MouseEvent) HashMap(java.util.HashMap) MouseAdapter(java.awt.event.MouseAdapter) JSparklinesIntegerIconTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) JSparklinesIntervalChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer) RowSorterEvent(javax.swing.event.RowSorterEvent) JSparklinesBarChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer) RowSorterListener(javax.swing.event.RowSorterListener) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer)

Example 2 with JSparklinesIntegerColorTableCellRenderer

use of no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer in project peptide-shaker by compomics.

the class ProteinStructurePanel method setPeptideTableProperties.

/**
 * Set up the properties of the peptide table.
 */
private void setPeptideTableProperties() {
    peptideTable.getColumn(" ").setMaxWidth(50);
    peptideTable.getColumn(" ").setMinWidth(50);
    peptideTable.getColumn("PDB").setMinWidth(50);
    peptideTable.getColumn("PDB").setMaxWidth(50);
    peptideTable.getColumn("Start").setMinWidth(50);
    // the validated column
    peptideTable.getColumn("").setMaxWidth(30);
    peptideTable.getColumn("").setMinWidth(30);
    // the selected columns
    peptideTable.getColumn("  ").setMaxWidth(30);
    peptideTable.getColumn("  ").setMinWidth(30);
    // the protein inference column
    peptideTable.getColumn("PI").setMaxWidth(37);
    peptideTable.getColumn("PI").setMinWidth(37);
    peptideTable.getTableHeader().setReorderingAllowed(false);
    // set up the peptide inference color map
    HashMap<Integer, Color> peptideInferenceColorMap = new HashMap<>();
    peptideInferenceColorMap.put(PSParameter.NOT_GROUP, peptideShakerGUI.getSparklineColor());
    peptideInferenceColorMap.put(PSParameter.RELATED, Color.YELLOW);
    peptideInferenceColorMap.put(PSParameter.RELATED_AND_UNRELATED, Color.ORANGE);
    peptideInferenceColorMap.put(PSParameter.UNRELATED, Color.RED);
    // set up the peptide inference tooltip map
    HashMap<Integer, String> peptideInferenceTooltipMap = new HashMap<>();
    peptideInferenceTooltipMap.put(PSParameter.NOT_GROUP, "Unique to a single protein");
    peptideInferenceTooltipMap.put(PSParameter.RELATED, "Belongs to a group of related proteins");
    peptideInferenceTooltipMap.put(PSParameter.RELATED_AND_UNRELATED, "Belongs to a group of related and unrelated proteins");
    peptideInferenceTooltipMap.put(PSParameter.UNRELATED, "Belongs to unrelated proteins");
    peptideTable.getColumn("PI").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(peptideShakerGUI.getSparklineColor(), peptideInferenceColorMap, peptideInferenceTooltipMap));
    peptideTable.getColumn("Start").setCellRenderer(new JSparklinesMultiIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100d, 100d, peptideShakerGUI.getSparklineColor()));
    peptideTable.getColumn("PDB").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/pdb.png")), null, "Mapped to PDB Structure", null));
    peptideTable.getColumn("").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    peptideTable.getColumn("  ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/star_yellow.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), "Starred", null, null));
}
Also used : JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) HashMap(java.util.HashMap) JSparklinesMultiIntervalChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesMultiIntervalChartTableCellRenderer) Color(java.awt.Color) JSparklinesIntegerIconTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer) TrueFalseIconRenderer(no.uib.jsparklines.extra.TrueFalseIconRenderer)

Example 3 with JSparklinesIntegerColorTableCellRenderer

use of no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer in project peptide-shaker by compomics.

the class PrideReshakeGUI method setUpGui.

/**
 * Set up the GUI.
 */
private void setUpGui() {
    clearProjectFiltersLabel.setVisible(false);
    setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icons/peptide-shaker.gif")));
    // set up the reshakeable files
    reshakeableFiles = new HashMap<>();
    // add pride xml and mgf
    reshakeableFiles.put("RESULT", new ArrayList<>());
    reshakeableFiles.get("RESULT").add(".xml");
    reshakeableFiles.get("RESULT").add(".xml.gz");
    reshakeableFiles.get("RESULT").add(".xml.zip");
    reshakeableFiles.put("PEAK", new ArrayList<>());
    reshakeableFiles.get("PEAK").add(ProteoWizardMsFormat.mgf.fileNameEnding);
    reshakeableFiles.get("PEAK").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".gz");
    reshakeableFiles.get("PEAK").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".zip");
    // add the raw file formats
    reshakeableFiles.put("RAW", new ArrayList<>());
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.raw.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.raw.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.raw.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzML.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzML.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzML.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzXML.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzXML.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mzXML.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.baf.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.baf.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.baf.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.fid.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.fid.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.fid.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.yep.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.yep.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.yep.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.d.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.d.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.d.fileNameEnding + ".zip");
    // reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.wiff.fileNameEnding); // @TODO: also requries the corresponding .scan file...
    // reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.wiff.fileNameEnding + ".gz");
    // reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.wiff.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mz5.fileNameEnding);
    // then check for incorrect labeling...
    reshakeableFiles.put("OTHER", new ArrayList<>());
    reshakeableFiles.get("OTHER").add(ProteoWizardMsFormat.mgf.fileNameEnding);
    reshakeableFiles.get("OTHER").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".gz");
    reshakeableFiles.get("OTHER").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".zip");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mgf.fileNameEnding);
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".gz");
    reshakeableFiles.get("RAW").add(ProteoWizardMsFormat.mgf.fileNameEnding + ".zip");
    // the files from which settings can be extracted
    searchSettingsFiles = new HashMap<>();
    searchSettingsFiles.put("RESULT", new ArrayList<>());
    searchSettingsFiles.get("RESULT").add(".xml");
    searchSettingsFiles.get("RESULT").add(".xml.gz");
    searchSettingsFiles.get("RESULT").add(".xml.zip");
    searchSettingsFiles.get("RESULT").add(".mzid");
    searchSettingsFiles.get("RESULT").add(".mzid.gz");
    searchSettingsFiles.get("RESULT").add(".mzid.zip");
    int fixedColumnWidth = 110;
    projectsTable.getColumn("Accession").setMaxWidth(fixedColumnWidth);
    projectsTable.getColumn("Accession").setMinWidth(fixedColumnWidth);
    projectsTable.getColumn(" ").setMaxWidth(50);
    projectsTable.getColumn(" ").setMinWidth(50);
    projectsTable.getColumn("#Assays").setMaxWidth(fixedColumnWidth);
    projectsTable.getColumn("#Assays").setMinWidth(fixedColumnWidth);
    projectsTable.getColumn("Date").setMaxWidth(fixedColumnWidth);
    projectsTable.getColumn("Date").setMinWidth(fixedColumnWidth);
    projectsTable.getColumn("Type").setMaxWidth(fixedColumnWidth);
    projectsTable.getColumn("Type").setMinWidth(fixedColumnWidth);
    projectsTable.getColumn("  ").setMaxWidth(30);
    projectsTable.getColumn("  ").setMinWidth(30);
    assaysTable.getColumn("Accession").setMaxWidth(fixedColumnWidth);
    assaysTable.getColumn("Accession").setMinWidth(fixedColumnWidth);
    assaysTable.getColumn(" ").setMaxWidth(50);
    assaysTable.getColumn(" ").setMinWidth(50);
    assaysTable.getColumn("#Proteins").setMaxWidth(fixedColumnWidth);
    assaysTable.getColumn("#Proteins").setMinWidth(fixedColumnWidth);
    assaysTable.getColumn("#Peptides").setMaxWidth(fixedColumnWidth);
    assaysTable.getColumn("#Peptides").setMinWidth(fixedColumnWidth);
    assaysTable.getColumn("#Spectra").setMaxWidth(fixedColumnWidth);
    assaysTable.getColumn("#Spectra").setMinWidth(fixedColumnWidth);
    assaysTable.getColumn("  ").setMaxWidth(30);
    assaysTable.getColumn("  ").setMinWidth(30);
    filesTable.getColumn("Assay").setMaxWidth(fixedColumnWidth);
    filesTable.getColumn("Assay").setMinWidth(fixedColumnWidth);
    filesTable.getColumn(" ").setMaxWidth(50);
    filesTable.getColumn(" ").setMinWidth(50);
    filesTable.getColumn("  ").setMaxWidth(30);
    filesTable.getColumn("  ").setMinWidth(30);
    filesTable.getColumn("Download").setMaxWidth(fixedColumnWidth);
    filesTable.getColumn("Download").setMinWidth(fixedColumnWidth);
    filesTable.getColumn("Type").setMaxWidth(fixedColumnWidth);
    filesTable.getColumn("Type").setMinWidth(fixedColumnWidth);
    filesTable.getColumn("Size (MB)").setMaxWidth(fixedColumnWidth);
    filesTable.getColumn("Size (MB)").setMinWidth(fixedColumnWidth);
    // make sure that the scroll panes are see-through
    projectsScrollPane.getViewport().setOpaque(false);
    assayTableScrollPane.getViewport().setOpaque(false);
    filesTableScrollPane.getViewport().setOpaque(false);
    projectsTable.setAutoCreateRowSorter(true);
    assaysTable.setAutoCreateRowSorter(true);
    filesTable.setAutoCreateRowSorter(true);
    projectsTable.getTableHeader().setReorderingAllowed(false);
    assaysTable.getTableHeader().setReorderingAllowed(false);
    filesTable.getTableHeader().setReorderingAllowed(false);
    // correct the color for the upper right corner
    JPanel projectsCorner = new JPanel();
    projectsCorner.setBackground(projectsTable.getTableHeader().getBackground());
    projectsScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, projectsCorner);
    JPanel assayCorner = new JPanel();
    assayCorner.setBackground(assaysTable.getTableHeader().getBackground());
    assayTableScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, assayCorner);
    JPanel filesCorner = new JPanel();
    filesCorner.setBackground(filesTable.getTableHeader().getBackground());
    filesTableScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, filesCorner);
    projectsTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    assaysTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    filesTable.getColumn("Assay").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    filesTable.getColumn("Download").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    filesTable.getColumn("  ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/accept-new.png")), null, "Reshakeable", null));
    // set up the peptide inference color map
    HashMap<Integer, Color> clusterScoringColorMap = new HashMap<>();
    clusterScoringColorMap.put(0, peptideShakerGUI.getSparklineColorNotFound());
    clusterScoringColorMap.put(1, peptideShakerGUI.getSparklineColor());
    clusterScoringColorMap.put(2, peptideShakerGUI.getUtilitiesUserParameters().getSparklineColorPossible());
    clusterScoringColorMap.put(3, peptideShakerGUI.getUtilitiesUserParameters().getSparklineColorDoubtful());
    clusterScoringColorMap.put(4, peptideShakerGUI.getSparklineColorNonValidated());
    // set up the peptide inference tooltip map
    HashMap<Integer, String> clusterScoringTooltipMap = new HashMap<>();
    clusterScoringTooltipMap.put(0, "Not yet classified");
    clusterScoringTooltipMap.put(1, "High confidence");
    clusterScoringTooltipMap.put(2, "Good confidence");
    clusterScoringTooltipMap.put(3, "Moderate confidence");
    clusterScoringTooltipMap.put(4, "Low confidence");
    projectsTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(peptideShakerGUI.getSparklineColorNotFound(), clusterScoringColorMap, clusterScoringTooltipMap));
    assaysTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(peptideShakerGUI.getSparklineColorNotFound(), clusterScoringColorMap, clusterScoringTooltipMap));
    projectsTableToolTips = new ArrayList<>();
    projectsTableToolTips.add(null);
    projectsTableToolTips.add("Project Accession Number");
    projectsTableToolTips.add("Project Title");
    projectsTableToolTips.add("Project Tags");
    projectsTableToolTips.add("Species");
    projectsTableToolTips.add("Tissue Types");
    projectsTableToolTips.add("Post Translational Modifications");
    projectsTableToolTips.add("Instruments");
    projectsTableToolTips.add("Number of Assays");
    projectsTableToolTips.add("Publication Date (yyyy-mm-dd)");
    projectsTableToolTips.add("Project Type");
    projectsTableToolTips.add("Confidence Category");
    assaysTableToolTips = new ArrayList<>();
    assaysTableToolTips.add(null);
    assaysTableToolTips.add("Assay Accession Number");
    assaysTableToolTips.add("Assay Title");
    assaysTableToolTips.add("Diseases");
    assaysTableToolTips.add("Species");
    assaysTableToolTips.add("Tissues");
    assaysTableToolTips.add("Post Translational Modifications");
    assaysTableToolTips.add("Instruments");
    assaysTableToolTips.add("Number of Proteins");
    assaysTableToolTips.add("Number of Peptides");
    assaysTableToolTips.add("Number of Spectra");
    assaysTableToolTips.add("Confidence Category");
    filesTableToolTips = new ArrayList<>();
    filesTableToolTips.add(null);
    filesTableToolTips.add("Assay Accession Numbers");
    filesTableToolTips.add("File Type");
    filesTableToolTips.add("File");
    filesTableToolTips.add("Download File");
    filesTableToolTips.add("File Size (MB)");
    filesTableToolTips.add("Reshakeable");
    ((TitledBorder) projectsPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "PRIDE Projects");
    ((TitledBorder) assaysPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Assays");
    ((TitledBorder) filesPanel.getBorder()).setTitle(PeptideShakerGUI.TITLED_BORDER_HORIZONTAL_PADDING + "Files");
    // get the cluster categories
    getClusterAnnotations();
    reshakableCheckBoxActionPerformed(null);
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) HashMap(java.util.HashMap) Color(java.awt.Color) TitledBorder(javax.swing.border.TitledBorder) TrueFalseIconRenderer(no.uib.jsparklines.extra.TrueFalseIconRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer)

Example 4 with JSparklinesIntegerColorTableCellRenderer

use of no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer in project peptide-shaker by compomics.

the class ModificationSiteInferenceDialog method setTableProperties.

/**
 * Set up the properties of the tables.
 */
private void setTableProperties() {
    ptmSiteTableScrollPane.getViewport().setOpaque(false);
    ptmsTableScrollPane.getViewport().setOpaque(false);
    ptmSiteTable.getTableHeader().setReorderingAllowed(false);
    ptmsTable.getTableHeader().setReorderingAllowed(false);
    // centrally align the column headers
    TableCellRenderer renderer = ptmSiteTable.getTableHeader().getDefaultRenderer();
    JLabel label = (JLabel) renderer;
    label.setHorizontalAlignment(JLabel.CENTER);
    // remove the column header in the ptm table
    ptmsTableScrollPane.setColumnHeaderView(null);
    // cell renderers
    ptmSiteTable.getColumn("").setCellRenderer(new AlignedTableCellRenderer(SwingConstants.CENTER, Color.LIGHT_GRAY));
    for (int i = 1; i < ptmSiteTable.getColumnCount(); i++) {
        ptmSiteTable.getColumn(ptmSiteTable.getColumnName(i)).setCellRenderer(new NimbusCheckBoxRenderer());
    }
    ptmsTable.getColumn("").setCellRenderer(new AlignedTableCellRenderer(SwingConstants.CENTER, Color.LIGHT_GRAY));
    ptmSiteTable.getColumn("").setMinWidth(35);
    ptmSiteTable.getColumn("").setMaxWidth(35);
    ptmsTable.getColumn("").setMinWidth(35);
    ptmsTable.getColumn("").setMaxWidth(35);
    // set up the PTM confidence color map
    HashMap<Integer, Color> ptmConfidenceColorMap = new HashMap<>();
    ptmConfidenceColorMap.put(ModificationScoring.NOT_FOUND, Color.lightGray);
    ptmConfidenceColorMap.put(ModificationScoring.RANDOM, Color.RED);
    ptmConfidenceColorMap.put(ModificationScoring.DOUBTFUL, Color.ORANGE);
    ptmConfidenceColorMap.put(ModificationScoring.CONFIDENT, Color.YELLOW);
    ptmConfidenceColorMap.put(ModificationScoring.VERY_CONFIDENT, peptideShakerGUI.getSparklineColor());
    // set up the PTM confidence tooltip map
    ptmConfidenceTooltipMap = new HashMap<>();
    ptmConfidenceTooltipMap.put(ModificationScoring.NOT_FOUND, "Not Found");
    ptmConfidenceTooltipMap.put(ModificationScoring.RANDOM, "Random Assignment");
    ptmConfidenceTooltipMap.put(ModificationScoring.DOUBTFUL, "Doubtful Assignment");
    ptmConfidenceTooltipMap.put(ModificationScoring.CONFIDENT, "Confident Assignment");
    ptmConfidenceTooltipMap.put(ModificationScoring.VERY_CONFIDENT, "Very Confident Assignment");
    for (int i = 1; i < ptmsTable.getColumnCount(); i++) {
        ptmsTable.getColumn(ptmsTable.getColumnName(i)).setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(peptideShakerGUI.getSparklineColor(), ptmConfidenceColorMap, ptmConfidenceTooltipMap));
    }
}
Also used : TableCellRenderer(javax.swing.table.TableCellRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) AlignedTableCellRenderer(com.compomics.util.gui.renderers.AlignedTableCellRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) HashMap(java.util.HashMap) NimbusCheckBoxRenderer(no.uib.jsparklines.extra.NimbusCheckBoxRenderer) Color(java.awt.Color) AlignedTableCellRenderer(com.compomics.util.gui.renderers.AlignedTableCellRenderer) JLabel(javax.swing.JLabel)

Example 5 with JSparklinesIntegerColorTableCellRenderer

use of no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer in project peptide-shaker by compomics.

the class ModificationsPanel method setTableProperties.

/**
 * Set up the properties of the tables.
 */
private void setTableProperties() {
    // correct the color for the upper right corner
    JPanel modificationCorner = new JPanel();
    modificationCorner.setBackground(modificationJTable.getTableHeader().getBackground());
    modificationJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, modificationCorner);
    JPanel modifiedPeptidesCorner = new JPanel();
    modifiedPeptidesCorner.setBackground(peptidesTable.getTableHeader().getBackground());
    peptidesTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, modifiedPeptidesCorner);
    JPanel relatedPeptidesCorner = new JPanel();
    relatedPeptidesCorner.setBackground(relatedPeptidesTable.getTableHeader().getBackground());
    relatedPeptidesTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, relatedPeptidesCorner);
    JPanel psmMatchesCorner = new JPanel();
    psmMatchesCorner.setBackground(selectedPsmsTable.getTableHeader().getBackground());
    psmsModifiedTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, psmMatchesCorner);
    JPanel psmRelatedMatchesCorner = new JPanel();
    psmRelatedMatchesCorner.setBackground(relatedPsmsTable.getTableHeader().getBackground());
    psmsRelatedTableJScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, psmRelatedMatchesCorner);
    JPanel aScoreTableCorner = new JPanel();
    aScoreTableCorner.setBackground(relatedPsmsTable.getTableHeader().getBackground());
    psmAScoresScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, aScoreTableCorner);
    JPanel deltaScoreTableCorner = new JPanel();
    deltaScoreTableCorner.setBackground(relatedPsmsTable.getTableHeader().getBackground());
    psmDeltaScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, deltaScoreTableCorner);
    modificationJTable.getColumn("  ").setMaxWidth(35);
    modificationJTable.getColumn("  ").setMinWidth(35);
    modificationJTable.getColumn("#").setMaxWidth(50);
    modificationJTable.getColumn("#").setMinWidth(50);
    peptidesTable.getColumn("   ").setMaxWidth(30);
    peptidesTable.getColumn("   ").setMinWidth(30);
    peptidesTable.getColumn(" ").setMaxWidth(45);
    peptidesTable.getColumn(" ").setMinWidth(45);
    peptidesTable.getColumn("Modification").setMaxWidth(45);
    peptidesTable.getColumn("Modification").setMinWidth(45);
    peptidesTable.getColumn("  ").setMaxWidth(30);
    peptidesTable.getColumn("  ").setMinWidth(30);
    peptidesTable.getColumn("PI").setMaxWidth(37);
    peptidesTable.getColumn("PI").setMinWidth(37);
    peptidesTable.getColumn("Peptide").setMaxWidth(80);
    peptidesTable.getColumn("Peptide").setMinWidth(80);
    relatedPeptidesTable.getColumn("   ").setMaxWidth(30);
    relatedPeptidesTable.getColumn("   ").setMinWidth(30);
    relatedPeptidesTable.getColumn(" ").setMaxWidth(45);
    relatedPeptidesTable.getColumn(" ").setMinWidth(45);
    relatedPeptidesTable.getColumn("PI").setMaxWidth(37);
    relatedPeptidesTable.getColumn("PI").setMinWidth(37);
    relatedPeptidesTable.getColumn("  ").setMaxWidth(30);
    relatedPeptidesTable.getColumn("  ").setMinWidth(30);
    relatedPeptidesTable.getColumn("Modification").setMaxWidth(45);
    relatedPeptidesTable.getColumn("Modification").setMinWidth(45);
    relatedPeptidesTable.getColumn("Peptide").setMaxWidth(80);
    relatedPeptidesTable.getColumn("Peptide").setMinWidth(80);
    selectedPsmsTable.getColumn("   ").setMaxWidth(30);
    selectedPsmsTable.getColumn("   ").setMinWidth(30);
    selectedPsmsTable.getColumn(" ").setMaxWidth(45);
    selectedPsmsTable.getColumn(" ").setMinWidth(45);
    selectedPsmsTable.getColumn("Modification").setMaxWidth(45);
    selectedPsmsTable.getColumn("Modification").setMinWidth(45);
    selectedPsmsTable.getColumn("Charge").setMaxWidth(90);
    selectedPsmsTable.getColumn("Charge").setMinWidth(90);
    selectedPsmsTable.getColumn("  ").setMaxWidth(30);
    selectedPsmsTable.getColumn("  ").setMinWidth(30);
    relatedPsmsTable.getColumn("   ").setMaxWidth(30);
    relatedPsmsTable.getColumn("   ").setMinWidth(30);
    relatedPsmsTable.getColumn(" ").setMaxWidth(45);
    relatedPsmsTable.getColumn(" ").setMinWidth(45);
    relatedPsmsTable.getColumn("Modification").setMaxWidth(45);
    relatedPsmsTable.getColumn("Modification").setMinWidth(45);
    relatedPsmsTable.getColumn("Charge").setMaxWidth(90);
    relatedPsmsTable.getColumn("Charge").setMinWidth(90);
    relatedPsmsTable.getColumn("  ").setMaxWidth(30);
    relatedPsmsTable.getColumn("  ").setMinWidth(30);
    peptidesTable.getTableHeader().setReorderingAllowed(false);
    relatedPeptidesTable.getTableHeader().setReorderingAllowed(false);
    selectedPsmsTable.getTableHeader().setReorderingAllowed(false);
    relatedPsmsTable.getTableHeader().setReorderingAllowed(false);
    psmAScoresTable.getTableHeader().setReorderingAllowed(false);
    psmDeltaScoresTable.getTableHeader().setReorderingAllowed(false);
    // centrally align the column headers
    TableCellRenderer renderer = psmAScoresTable.getTableHeader().getDefaultRenderer();
    JLabel label = (JLabel) renderer;
    label.setHorizontalAlignment(JLabel.CENTER);
    renderer = psmDeltaScoresTable.getTableHeader().getDefaultRenderer();
    label = (JLabel) renderer;
    label.setHorizontalAlignment(JLabel.CENTER);
    // set up the protein inference color map
    HashMap<Integer, Color> proteinInferenceColorMap = new HashMap<>();
    proteinInferenceColorMap.put(PSParameter.NOT_GROUP, peptideShakerGUI.getSparklineColor());
    proteinInferenceColorMap.put(PSParameter.RELATED, Color.YELLOW);
    proteinInferenceColorMap.put(PSParameter.RELATED_AND_UNRELATED, Color.ORANGE);
    proteinInferenceColorMap.put(PSParameter.UNRELATED, Color.RED);
    // set up the protein inference tooltip map
    proteinInferenceTooltipMap = new HashMap<>();
    proteinInferenceTooltipMap.put(PSParameter.NOT_GROUP, "Unique to a single protein");
    proteinInferenceTooltipMap.put(PSParameter.RELATED, "Belongs to a group of related proteins");
    proteinInferenceTooltipMap.put(PSParameter.RELATED_AND_UNRELATED, "Belongs to a group of related and unrelated proteins");
    proteinInferenceTooltipMap.put(PSParameter.UNRELATED, "Belongs to unrelated proteins");
    peptidesTable.getColumn("PI").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, proteinInferenceColorMap, proteinInferenceTooltipMap));
    relatedPeptidesTable.getColumn("PI").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, proteinInferenceColorMap, proteinInferenceTooltipMap));
    peptidesTable.getColumn("   ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/star_yellow.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), "Starred", null, null));
    relatedPeptidesTable.getColumn("   ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/star_yellow.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), "Starred", null, null));
    // set up the modification confidence color map
    HashMap<Integer, Color> modificationConfidenceColorMap = new HashMap<>();
    modificationConfidenceColorMap.put(ModificationScoring.NOT_FOUND, Color.lightGray);
    modificationConfidenceColorMap.put(ModificationScoring.RANDOM, Color.RED);
    modificationConfidenceColorMap.put(ModificationScoring.DOUBTFUL, Color.ORANGE);
    modificationConfidenceColorMap.put(ModificationScoring.CONFIDENT, Color.YELLOW);
    modificationConfidenceColorMap.put(ModificationScoring.VERY_CONFIDENT, peptideShakerGUI.getSparklineColor());
    // set up the modification confidence tooltip map
    modificationConfidenceTooltipMap = new HashMap<>();
    modificationConfidenceTooltipMap.put(-1, "(No Modifications)");
    modificationConfidenceTooltipMap.put(ModificationScoring.RANDOM, "Random Assignment");
    modificationConfidenceTooltipMap.put(ModificationScoring.DOUBTFUL, "Doubtful Assignment");
    modificationConfidenceTooltipMap.put(ModificationScoring.CONFIDENT, "Confident Assignment");
    modificationConfidenceTooltipMap.put(ModificationScoring.VERY_CONFIDENT, "Very Confident Assignment");
    peptidesTable.getColumn("Modification").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, modificationConfidenceColorMap, modificationConfidenceTooltipMap));
    relatedPeptidesTable.getColumn("Modification").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, modificationConfidenceColorMap, modificationConfidenceTooltipMap));
    selectedPsmsTable.getColumn("Modification").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, modificationConfidenceColorMap, modificationConfidenceTooltipMap));
    relatedPsmsTable.getColumn("Modification").setCellRenderer(new JSparklinesIntegerColorTableCellRenderer(Color.lightGray, modificationConfidenceColorMap, modificationConfidenceTooltipMap));
    peptidesTable.getColumn("Peptide").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) peptidesTable.getColumn("Peptide").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
    peptidesTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    relatedPeptidesTable.getColumn("Peptide").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) relatedPeptidesTable.getColumn("Peptide").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 20, peptideShakerGUI.getScoreAndConfidenceDecimalFormat());
    relatedPeptidesTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    selectedPsmsTable.getColumn("Charge").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 10.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) selectedPsmsTable.getColumn("Charge").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 30);
    selectedPsmsTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    selectedPsmsTable.getColumn("RT").setCellRenderer(new JSparklinesIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, 0d, 1000d, 10d, peptideShakerGUI.getSparklineColor(), peptideShakerGUI.getSparklineColor()));
    ((JSparklinesIntervalChartTableCellRenderer) selectedPsmsTable.getColumn("RT").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() + 5);
    ((JSparklinesIntervalChartTableCellRenderer) selectedPsmsTable.getColumn("RT").getCellRenderer()).showReferenceLine(true, 0.02, java.awt.Color.BLACK);
    selectedPsmsTable.getColumn("   ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/star_yellow.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), "Starred", null, null));
    relatedPsmsTable.getColumn("Charge").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 10.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) relatedPsmsTable.getColumn("Charge").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() - 30);
    relatedPsmsTable.getColumn("  ").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(MatchValidationLevel.getIconMap(this.getClass()), MatchValidationLevel.getTooltipMap()));
    relatedPsmsTable.getColumn("RT").setCellRenderer(new JSparklinesIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, 0d, 1000d, 10d, peptideShakerGUI.getSparklineColor(), peptideShakerGUI.getSparklineColor()));
    ((JSparklinesIntervalChartTableCellRenderer) relatedPsmsTable.getColumn("RT").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth() + 5);
    ((JSparklinesIntervalChartTableCellRenderer) relatedPsmsTable.getColumn("RT").getCellRenderer()).showReferenceLine(true, 0.02, java.awt.Color.BLACK);
    relatedPsmsTable.getColumn("   ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/star_yellow.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), new ImageIcon(this.getClass().getResource("/icons/star_grey.png")), "Starred", null, null));
    // modification color coding
    modificationJTable.getColumn("  ").setCellRenderer(new JSparklinesColorTableCellRenderer());
    // set up the table header tooltips
    selectedPeptidesTableToolTips = new ArrayList<>();
    selectedPeptidesTableToolTips.add(null);
    selectedPeptidesTableToolTips.add("Starred");
    selectedPeptidesTableToolTips.add("Peptide Inference Class");
    selectedPeptidesTableToolTips.add("Peptide Sequence");
    selectedPeptidesTableToolTips.add("Modification Location Confidence");
    selectedPeptidesTableToolTips.add("Peptide Confidence");
    selectedPeptidesTableToolTips.add("Peptide Validated");
    relatedPeptidesTableToolTips = new ArrayList<>();
    relatedPeptidesTableToolTips.add(null);
    relatedPeptidesTableToolTips.add("Starred");
    relatedPeptidesTableToolTips.add("Peptide Inference Class");
    relatedPeptidesTableToolTips.add("Peptide Sequence");
    relatedPeptidesTableToolTips.add("Modification Location Confidence");
    relatedPeptidesTableToolTips.add("Peptide Confidence");
    relatedPeptidesTableToolTips.add("Peptide Validated");
    selectedPsmsTableToolTips = new ArrayList<>();
    selectedPsmsTableToolTips.add(null);
    selectedPsmsTableToolTips.add("Starred");
    selectedPsmsTableToolTips.add("Peptide Sequence");
    selectedPsmsTableToolTips.add("Modification Location Confidence");
    selectedPsmsTableToolTips.add("Precursor Charge");
    selectedPsmsTableToolTips.add("Precursor Retention Time");
    selectedPsmsTableToolTips.add("PSM Validated");
    relatedPsmsTableToolTips = new ArrayList<>();
    relatedPsmsTableToolTips.add(null);
    relatedPsmsTableToolTips.add("Starred");
    relatedPsmsTableToolTips.add("Peptide Sequence");
    relatedPsmsTableToolTips.add("Modification Location Confidence");
    relatedPsmsTableToolTips.add("Precursor Charge");
    relatedPsmsTableToolTips.add("Precursor Retention Time");
    relatedPsmsTableToolTips.add("PSM Validated");
    modificationTableToolTips = new ArrayList<>();
    modificationTableToolTips.add("Color");
    modificationTableToolTips.add("Name");
    modificationTableToolTips.add("Frequency");
}
Also used : JSparklinesBarChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer) TableCellRenderer(javax.swing.table.TableCellRenderer) JSparklinesIntegerIconTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer) JSparklinesIntervalChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) JSparklinesColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesColorTableCellRenderer) HashMap(java.util.HashMap) JSparklinesIntegerIconTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer) JSparklinesColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesColorTableCellRenderer) TrueFalseIconRenderer(no.uib.jsparklines.extra.TrueFalseIconRenderer) JSparklinesIntegerColorTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer) JSparklinesIntervalChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer) JSparklinesBarChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer)

Aggregations

HashMap (java.util.HashMap)6 JSparklinesIntegerColorTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer)6 Color (java.awt.Color)4 TrueFalseIconRenderer (no.uib.jsparklines.extra.TrueFalseIconRenderer)4 JSparklinesIntegerIconTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer)4 HtmlLinksRenderer (no.uib.jsparklines.extra.HtmlLinksRenderer)3 JSparklinesBarChartTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer)3 ImageIcon (javax.swing.ImageIcon)2 JPanel (javax.swing.JPanel)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 JSparklinesIntervalChartTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer)2 AlignedTableCellRenderer (com.compomics.util.gui.renderers.AlignedTableCellRenderer)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 DecimalFormat (java.text.DecimalFormat)1 ArrayList (java.util.ArrayList)1 JLabel (javax.swing.JLabel)1 TitledBorder (javax.swing.border.TitledBorder)1 RowSorterEvent (javax.swing.event.RowSorterEvent)1 RowSorterListener (javax.swing.event.RowSorterListener)1