Search in sources :

Example 1 with HtmlLinksRenderer

use of no.uib.jsparklines.extra.HtmlLinksRenderer 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 HtmlLinksRenderer

use of no.uib.jsparklines.extra.HtmlLinksRenderer in project peptide-shaker by compomics.

the class ProteinStructurePanel method setPdbTablesProperties.

/**
 * Set up the properties of the PDB and PDB chains tables.
 */
private void setPdbTablesProperties() {
    pdbMatchesJTable.getColumn(" ").setMaxWidth(50);
    pdbChainsJTable.getColumn(" ").setMaxWidth(50);
    pdbMatchesJTable.getColumn("PDB").setMaxWidth(50);
    pdbChainsJTable.getColumn("Chain").setMaxWidth(50);
    pdbMatchesJTable.getColumn(" ").setMinWidth(50);
    pdbChainsJTable.getColumn(" ").setMinWidth(50);
    pdbMatchesJTable.getColumn("PDB").setMinWidth(50);
    pdbChainsJTable.getColumn("Chain").setMinWidth(50);
    pdbMatchesJTable.getColumn("Chains").setMinWidth(100);
    pdbMatchesJTable.getColumn("Chains").setMaxWidth(100);
    pdbMatchesJTable.getTableHeader().setReorderingAllowed(false);
    pdbChainsJTable.getTableHeader().setReorderingAllowed(false);
    pdbChainsJTable.setAutoCreateRowSorter(true);
    pdbMatchesJTable.setAutoCreateRowSorter(true);
    pdbMatchesJTable.getColumn("PDB").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    pdbMatchesJTable.getColumn("Chains").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 10.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) pdbMatchesJTable.getColumn("Chains").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    pdbChainsJTable.getColumn("Coverage").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) pdbChainsJTable.getColumn("Coverage").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    pdbChainsJTable.getColumn("PDB-Protein").setCellRenderer(new JSparklinesIntervalChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, 10.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesIntervalChartTableCellRenderer) pdbChainsJTable.getColumn("PDB-Protein").getCellRenderer()).showReferenceLine(true, 0.02, Color.BLACK);
}
Also used : JSparklinesIntervalChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer) JSparklinesBarChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer)

Example 3 with HtmlLinksRenderer

use of no.uib.jsparklines.extra.HtmlLinksRenderer in project peptide-shaker by compomics.

the class OverviewPanel method enableDarkTheme.

/**
 * Enable or disable the dark theme.
 *
 * @param darkTheme enable or disable the dark theme
 */
public void enableDarkTheme(boolean darkTheme) {
    if (darkTheme) {
        proteinTable.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinTable.setForeground(new Color(240, 240, 240));
        proteinTable.setSelectionBackground(Color.DARK_GRAY);
        proteinTable.setSelectionForeground(new Color(240, 240, 240));
        proteinTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), "FEFFFF"));
        ((ChromosomeTableCellRenderer) proteinTable.getColumn("Chr").getCellRenderer()).setFontColors(new Color(240, 240, 240), new Color(240, 240, 240));
        peptideTable.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        peptideTable.setForeground(new Color(240, 240, 240));
        peptideTable.setSelectionBackground(Color.DARK_GRAY);
        peptideTable.setSelectionForeground(new Color(240, 240, 240));
        ((JSparklinesMultiIntervalChartTableCellRenderer) peptideTable.getColumn("Start").getCellRenderer()).showReferenceLine(true, 0.03, Color.WHITE);
        psmTable.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        psmTable.setForeground(new Color(240, 240, 240));
        psmTable.setSelectionBackground(Color.DARK_GRAY);
        psmTable.setSelectionForeground(new Color(240, 240, 240));
        spectrumPanel.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        spectrumPanel.getGraphics().setColor(Color.WHITE);
        ptmChart.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        ptmSequencePanel.getChartPanel().setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        ptmSequencePanel.getChartPanel().getChart().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        ptmSequencePanel.getChartPanel().getChart().getPlot().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().setRangeGridlinePaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setLabelPaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setTickLabelPaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().setDomainGridlinePaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setLabelPaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setTickLabelPaint(Color.WHITE);
        coverageChart.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinSequencePanel.getChartPanel().setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinSequencePanel.getChartPanel().getChart().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinSequencePanel.getChartPanel().getChart().getPlot().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().setRangeGridlinePaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setLabelPaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setTickLabelPaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().setDomainGridlinePaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setLabelPaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setTickLabelPaint(Color.WHITE);
        proteinSequencePanel.setReferenceLine(0.03, Color.WHITE);
        massErrorBubblePlot.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorBubblePlot.getChartPanel().setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorBubblePlot.getChartPanel().getChart().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorBubblePlot.getChartPanel().getChart().getPlot().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.WHITE);
        massErrorPlot.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorPlot.getChartPanel().setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorPlot.getChartPanel().getChart().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorPlot.getChartPanel().getChart().getPlot().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        massErrorPlot.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.WHITE);
        intensityHistogram.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        intensityHistogram.getChartPanel().setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        intensityHistogram.getChartPanel().getChart().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        intensityHistogram.getChartPanel().getChart().getPlot().setBackgroundPaint(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        intensityHistogram.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.WHITE);
        proteinSequencePanel.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
        proteinSequencePanel.setReferenceLine(0.03, Color.WHITE);
        ((TitledBorder) proteinsLayeredPanel.getBorder()).setTitleColor(new Color(240, 240, 240));
        ((TitledBorder) peptidesPanel.getBorder()).setTitleColor(new Color(240, 240, 240));
        ((TitledBorder) psmsPanel.getBorder()).setTitleColor(new Color(240, 240, 240));
        ((TitledBorder) spectrumMainPanel.getBorder()).setTitleColor(new Color(240, 240, 240));
        ((TitledBorder) sequenceCoverageTitledPanel.getBorder()).setTitleColor(new Color(240, 240, 240));
        sequenceFragmentationPanel.setFontColor(new Color(240, 240, 240));
        sequenceFragmentationPanel.setFont(new Font("Segoe UI", Font.BOLD, 14));
        sequenceFragmentationPanel.setBackground(PeptideShakerGUI.DARK_THEME_BACKGROUND_COLOR);
    } else {
        proteinTable.setBackground(Color.WHITE);
        proteinTable.setForeground(Color.BLACK);
        proteinTable.setSelectionBackground(new Color(57, 105, 138));
        proteinTable.setSelectionForeground(Color.WHITE);
        proteinTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
        ((ChromosomeTableCellRenderer) proteinTable.getColumn("Chr").getCellRenderer()).setFontColors(Color.WHITE, Color.BLACK);
        peptideTable.setBackground(Color.WHITE);
        peptideTable.setForeground(Color.BLACK);
        peptideTable.setSelectionBackground(new Color(57, 105, 138));
        peptideTable.setSelectionForeground(Color.WHITE);
        ((JSparklinesMultiIntervalChartTableCellRenderer) peptideTable.getColumn("Start").getCellRenderer()).showReferenceLine(true, 0.02, Color.BLACK);
        psmTable.setBackground(Color.WHITE);
        psmTable.setForeground(Color.BLACK);
        psmTable.setSelectionBackground(new Color(57, 105, 138));
        psmTable.setSelectionForeground(Color.WHITE);
        spectrumPanel.setBackground(Color.WHITE);
        spectrumPanel.getGraphics().setColor(Color.BLACK);
        ptmChart.setBackground(Color.WHITE);
        ptmSequencePanel.getChartPanel().setBackground(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().setBackgroundPaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getPlot().setBackgroundPaint(Color.WHITE);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().setRangeGridlinePaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setLabelPaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setAxisLinePaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setTickLabelPaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().setDomainGridlinePaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setLabelPaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setAxisLinePaint(Color.BLACK);
        ptmSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setTickLabelPaint(Color.BLACK);
        coverageChart.setBackground(Color.WHITE);
        proteinSequencePanel.getChartPanel().setBackground(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().setBackgroundPaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getPlot().setBackgroundPaint(Color.WHITE);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().setRangeGridlinePaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setLabelPaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setAxisLinePaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getRangeAxis().setTickLabelPaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().setDomainGridlinePaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setLabelPaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setAxisLinePaint(Color.BLACK);
        proteinSequencePanel.getChartPanel().getChart().getCategoryPlot().getDomainAxis().setTickLabelPaint(Color.BLACK);
        proteinSequencePanel.setReferenceLine(0.03, Color.BLACK);
        proteinSequencePanel.setBackground(Color.WHITE);
        proteinSequencePanel.setReferenceLine(0.03, Color.BLACK);
        massErrorBubblePlot.setBackground(Color.WHITE);
        massErrorBubblePlot.getChartPanel().setBackground(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().setBackgroundPaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getPlot().setBackgroundPaint(Color.WHITE);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.BLACK);
        massErrorBubblePlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.BLACK);
        massErrorPlot.setBackground(Color.WHITE);
        massErrorPlot.getChartPanel().setBackground(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().setBackgroundPaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getPlot().setBackgroundPaint(Color.WHITE);
        massErrorPlot.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.BLACK);
        massErrorPlot.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.BLACK);
        intensityHistogram.setBackground(Color.WHITE);
        intensityHistogram.getChartPanel().setBackground(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().setBackgroundPaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getPlot().setBackgroundPaint(Color.WHITE);
        intensityHistogram.getChartPanel().getChart().getXYPlot().setRangeGridlinePaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setLabelPaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setAxisLinePaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getRangeAxis().setTickLabelPaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().setDomainGridlinePaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setLabelPaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setAxisLinePaint(Color.BLACK);
        intensityHistogram.getChartPanel().getChart().getXYPlot().getDomainAxis().setTickLabelPaint(Color.BLACK);
        ((TitledBorder) proteinsLayeredPanel.getBorder()).setTitleColor(Color.BLACK);
        ((TitledBorder) peptidesPanel.getBorder()).setTitleColor(Color.BLACK);
        ((TitledBorder) psmsPanel.getBorder()).setTitleColor(Color.BLACK);
        ((TitledBorder) spectrumMainPanel.getBorder()).setTitleColor(Color.BLACK);
        ((TitledBorder) sequenceCoverageTitledPanel.getBorder()).setTitleColor(Color.BLACK);
        sequenceFragmentationPanel.setFontColor(Color.BLACK);
        sequenceFragmentationPanel.setFont(new Font("Segoe UI", Font.BOLD, 14));
        sequenceFragmentationPanel.setBackground(Color.WHITE);
    }
    proteinTable.repaint();
}
Also used : ChromosomeTableCellRenderer(no.uib.jsparklines.extra.ChromosomeTableCellRenderer) TitledBorder(javax.swing.border.TitledBorder) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer)

Example 4 with HtmlLinksRenderer

use of no.uib.jsparklines.extra.HtmlLinksRenderer in project peptide-shaker by compomics.

the class GOEAPanel method setUpGUI.

/**
 * Set up the GUI details.
 */
private void setUpGUI() {
    // correct the color for the upper right corner
    JPanel proteinCorner = new JPanel();
    proteinCorner.setBackground(goMappingsTable.getTableHeader().getBackground());
    proteinsScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, proteinCorner);
    JPanel goMappingsCorner = new JPanel();
    goMappingsCorner.setBackground(goMappingsTable.getTableHeader().getBackground());
    proteinGoMappingsScrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, goMappingsCorner);
    JTableHeader header = goMappingsTable.getTableHeader();
    header.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            super.mouseClicked(e);
            if (peptideShakerGUI.getIdentification() != null) {
                updateGoPlots();
            }
        }
    });
    goMappingsTable.getTableHeader().setReorderingAllowed(false);
    proteinTable.getTableHeader().setReorderingAllowed(false);
    goMappingsTable.setAutoCreateRowSorter(true);
    proteinTable.setAutoCreateRowSorter(true);
    // make sure that the scroll panes are see-through
    proteinGoMappingsScrollPane.getViewport().setOpaque(false);
    proteinsScrollPane.getViewport().setOpaque(false);
    // the index column
    goMappingsTable.getColumn("").setMaxWidth(60);
    goMappingsTable.getColumn("").setMinWidth(60);
    goMappingsTable.getColumn("  ").setMaxWidth(30);
    goMappingsTable.getColumn("  ").setMinWidth(30);
    double significanceLevel = 0.05;
    if (onePercentRadioButton.isSelected()) {
        significanceLevel = 0.01;
    }
    // cell renderers
    goMappingsTable.getColumn("GO Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    goMappingsTable.getColumn("Frequency All (%)").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, Color.RED));
    ((JSparklinesBarChartTableCellRenderer) goMappingsTable.getColumn("Frequency All (%)").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    goMappingsTable.getColumn("Frequency Dataset (%)").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 100.0, peptideShakerGUI.getSparklineColor()));
    ((JSparklinesBarChartTableCellRenderer) goMappingsTable.getColumn("Frequency Dataset (%)").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    goMappingsTable.getColumn("p-value").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, 1.0, peptideShakerGUI.getSparklineColor(), Color.lightGray, significanceLevel));
    ((JSparklinesBarChartTableCellRenderer) goMappingsTable.getColumn("p-value").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    goMappingsTable.getColumn("Log2 Diff").setCellRenderer(new JSparklinesBarChartTableCellRenderer(PlotOrientation.HORIZONTAL, -10.0, 10.0, Color.RED, peptideShakerGUI.getSparklineColor(), Color.lightGray, 0));
    ((JSparklinesBarChartTableCellRenderer) goMappingsTable.getColumn("Log2 Diff").getCellRenderer()).showNumberAndChart(true, TableProperties.getLabelWidth());
    goMappingsTable.getColumn("Frequency (%)").setCellRenderer(new JSparklinesTableCellRenderer(JSparklinesTableCellRenderer.PlotType.barChart, PlotOrientation.HORIZONTAL, 0.0, 100.0));
    goMappingsTable.getColumn("  ").setCellRenderer(new TrueFalseIconRenderer(new ImageIcon(this.getClass().getResource("/icons/selected_green-new.png")), null, "Selected", null));
    // make the tabs in the tabbed pane go from right to left
    goPlotsTabbedPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    // set up the table header tooltips
    mappingsTableToolTips = new ArrayList<>();
    mappingsTableToolTips.add(null);
    mappingsTableToolTips.add("Gene Ontology Accession");
    mappingsTableToolTips.add("Gene Ontology Term");
    mappingsTableToolTips.add("Gene Ontology Domain");
    mappingsTableToolTips.add("Frequency All (%)");
    mappingsTableToolTips.add("Frequency Dataset (%)");
    mappingsTableToolTips.add("Frequency (%) (All & Dataset))");
    mappingsTableToolTips.add("Log2 Difference (Dataset / All)");
    mappingsTableToolTips.add("<html>Hypergeometic Test<br>FDR-Corrected</html>");
    mappingsTableToolTips.add("Selected for Plots");
    proteinTableToolTips = new ArrayList<>();
    proteinTableToolTips.add(null);
    proteinTableToolTips.add("Protein Accession Number");
    proteinTableToolTips.add("Protein Description");
    proteinTableToolTips.add("Protein Sequence Coverage (%) (Confident / Doubtful / Not Validated / Possible)");
    proteinTableToolTips.add("Number of Peptides (Validated / Doubtful / Not Validated)");
    proteinTableToolTips.add("Number of Spectra (Validated / Doubtful / Not Validated)");
    proteinTableToolTips.add("MS2 Quantification");
    proteinTableToolTips.add("Protein Confidence");
    proteinTableToolTips.add("Validated");
}
Also used : JSparklinesTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesTableCellRenderer) ChartMouseEvent(org.jfree.chart.ChartMouseEvent) MouseEvent(java.awt.event.MouseEvent) MouseAdapter(java.awt.event.MouseAdapter) JTableHeader(javax.swing.table.JTableHeader) JSparklinesBarChartTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer) TrueFalseIconRenderer(no.uib.jsparklines.extra.TrueFalseIconRenderer)

Example 5 with HtmlLinksRenderer

use of no.uib.jsparklines.extra.HtmlLinksRenderer 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)

Aggregations

HtmlLinksRenderer (no.uib.jsparklines.extra.HtmlLinksRenderer)10 JSparklinesBarChartTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesBarChartTableCellRenderer)6 JSparklinesIntegerIconTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer)5 HashMap (java.util.HashMap)4 ImageIcon (javax.swing.ImageIcon)4 ChromosomeTableCellRenderer (no.uib.jsparklines.extra.ChromosomeTableCellRenderer)4 TrueFalseIconRenderer (no.uib.jsparklines.extra.TrueFalseIconRenderer)4 Color (java.awt.Color)3 JPanel (javax.swing.JPanel)3 TitledBorder (javax.swing.border.TitledBorder)3 JSparklinesIntegerColorTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntegerColorTableCellRenderer)3 MouseAdapter (java.awt.event.MouseAdapter)2 MouseEvent (java.awt.event.MouseEvent)2 DecimalFormat (java.text.DecimalFormat)2 RowSorterEvent (javax.swing.event.RowSorterEvent)2 RowSorterListener (javax.swing.event.RowSorterListener)2 NimbusCheckBoxRenderer (no.uib.jsparklines.extra.NimbusCheckBoxRenderer)2 JSparklinesArrayListBarChartTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesArrayListBarChartTableCellRenderer)2 JSparklinesIntervalChartTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntervalChartTableCellRenderer)2 AlignedListCellRenderer (com.compomics.util.gui.renderers.AlignedListCellRenderer)1