Search in sources :

Example 1 with AlignedListCellRenderer

use of com.compomics.util.gui.renderers.AlignedListCellRenderer in project peptide-shaker by compomics.

the class ProjectsFilterDialog method setUpGUI.

/**
 * Set up the GUI
 */
private void setUpGUI() {
    // set the padding for the combo boxes
    JComponent c = (JComponent) speciesComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    speciesComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) speciesComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    c = (JComponent) tissuesComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    tissuesComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) tissuesComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    c = (JComponent) ptmsComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    ptmsComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) ptmsComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    c = (JComponent) tagsComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    tagsComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) tagsComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    c = (JComponent) instrumentsComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    instrumentsComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) instrumentsComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    c = (JComponent) typeComboBox.getRenderer();
    c.setBorder(BorderFactory.createEmptyBorder(4, 14, 4, 4));
    typeComboBox.setRenderer((ListCellRenderer) c);
    ((JTextField) typeComboBox.getEditor().getEditorComponent()).setMargin(new Insets(2, 10, 2, 2));
    // add key listeners for the combo boxes
    speciesComboBox.getEditor().getEditorComponent().addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent event) {
            filterInputGiven();
        }
    });
    assaysComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    typeComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    categoryComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
}
Also used : KeyEvent(java.awt.event.KeyEvent) AlignedListCellRenderer(com.compomics.util.gui.renderers.AlignedListCellRenderer) Insets(java.awt.Insets) KeyAdapter(java.awt.event.KeyAdapter) JComponent(javax.swing.JComponent) JTextField(javax.swing.JTextField)

Example 2 with AlignedListCellRenderer

use of com.compomics.util.gui.renderers.AlignedListCellRenderer in project peptide-shaker by compomics.

the class MatchValidationDialog method setUpGui.

/**
 * Set up the GUI.
 */
private void setUpGui() {
    // make sure that the scroll panes are see-through
    qualityFiltersTableScrollPane.getViewport().setOpaque(false);
    // disable column reordering
    qualityFiltersTable.getTableHeader().setReorderingAllowed(false);
    // set the validation combo box
    validationLevelJComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    validationLevelJComboBox.setEditable(false);
    // set up the table header tooltips
    validationTableToolTips = new ArrayList<>(3);
    validationTableToolTips.add(null);
    validationTableToolTips.add("Quality Test");
    validationTableToolTips.add("Passed");
}
Also used : AlignedListCellRenderer(com.compomics.util.gui.renderers.AlignedListCellRenderer)

Example 3 with AlignedListCellRenderer

use of com.compomics.util.gui.renderers.AlignedListCellRenderer in project peptide-shaker by compomics.

the class NewDialog method setUpGui.

/**
 * Set up the GUI.
 */
private void setUpGui() {
    initComponents();
    settingsComboBox.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    typeCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    idFilesTxt.setText(idFiles.size() + " file(s) selected");
    spectrumFilesTxt.setText(spectrumFiles.size() + " file(s) selected");
    fastaFileTxt.setText("");
    processingTxt.setText(processingParameters.getnThreads() + " cores");
    // set the search parameters
    Vector parameterList = new Vector();
    parameterList.add("-- Select --");
    for (String tempParameters : identificationParametersFactory.getParametersList()) {
        parameterList.add(tempParameters);
    }
    settingsComboBox.setModel(new javax.swing.DefaultComboBoxModel(parameterList));
    validateInput();
    GuiUtilities.installEscapeCloseOperation(this);
}
Also used : AlignedListCellRenderer(com.compomics.util.gui.renderers.AlignedListCellRenderer) javax.swing(javax.swing) Vector(java.util.Vector)

Example 4 with AlignedListCellRenderer

use of com.compomics.util.gui.renderers.AlignedListCellRenderer in project peptide-shaker by compomics.

the class SpectrumCountingSettingsDialog method setUpGui.

/**
 * Set up the GUI.
 */
private void setUpGui() {
    methodCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    validationLevelCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    normalizationCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    unitCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
}
Also used : AlignedListCellRenderer(com.compomics.util.gui.renderers.AlignedListCellRenderer)

Example 5 with AlignedListCellRenderer

use of com.compomics.util.gui.renderers.AlignedListCellRenderer in project peptide-shaker by compomics.

the class ProteinInferencePeptideLevelDialog method setUpGUI.

/**
 * Set up the GUI.
 */
private void setUpGUI() {
    // make the tabs go from right to left
    tabbedPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
    protInferenceTypeCmb.setRenderer(new AlignedListCellRenderer(SwingConstants.CENTER));
    // make sure that the scroll panes are see-through
    proteinsJScrollPane.getViewport().setOpaque(false);
    otherProteinsJScrollPane.getViewport().setOpaque(false);
    // set up the table properties
    otherProteinJTable.getTableHeader().setReorderingAllowed(false);
    otherProteinJTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    retainedProteinJTable.getTableHeader().setReorderingAllowed(false);
    retainedProteinJTable.getColumn("Accession").setCellRenderer(new HtmlLinksRenderer(TableProperties.getSelectedRowHtmlTagFontColor(), TableProperties.getNotSelectedRowHtmlTagFontColor()));
    retainedProteinJTable.getColumn(" ").setMinWidth(50);
    retainedProteinJTable.getColumn(" ").setMaxWidth(50);
    retainedProteinJTable.getColumn("Gene").setMinWidth(90);
    retainedProteinJTable.getColumn("Gene").setMaxWidth(90);
    retainedProteinJTable.getColumn("Chr").setMinWidth(90);
    retainedProteinJTable.getColumn("Chr").setMaxWidth(90);
    retainedProteinJTable.getColumn("Evidence").setMinWidth(90);
    retainedProteinJTable.getColumn("Evidence").setMaxWidth(90);
    retainedProteinJTable.getColumn("Enz").setMinWidth(50);
    retainedProteinJTable.getColumn("Enz").setMaxWidth(50);
    otherProteinJTable.getColumn(" ").setMinWidth(50);
    otherProteinJTable.getColumn(" ").setMaxWidth(50);
    otherProteinJTable.getColumn("Gene").setMinWidth(90);
    otherProteinJTable.getColumn("Gene").setMaxWidth(90);
    otherProteinJTable.getColumn("Chr").setMinWidth(90);
    otherProteinJTable.getColumn("Chr").setMaxWidth(90);
    otherProteinJTable.getColumn("Evidence").setMinWidth(90);
    otherProteinJTable.getColumn("Evidence").setMaxWidth(90);
    otherProteinJTable.getColumn("Enz").setMinWidth(50);
    otherProteinJTable.getColumn("Enz").setMaxWidth(50);
    // set the preferred size of the accession column
    Integer width = ProteinTableModel.getPreferredAccessionColumnWidth(otherProteinJTable, otherProteinJTable.getColumn("Accession").getModelIndex(), 6, peptideShakerGUI.getMetrics().getMaxProteinAccessionLength());
    if (width != null) {
        otherProteinJTable.getColumn("Accession").setMinWidth(width);
        otherProteinJTable.getColumn("Accession").setMaxWidth(width);
    } else {
        otherProteinJTable.getColumn("Accession").setMinWidth(15);
        otherProteinJTable.getColumn("Accession").setMaxWidth(Integer.MAX_VALUE);
    }
    otherProteinJTable.getColumn("Chr").setCellRenderer(new ChromosomeTableCellRenderer(Color.WHITE, Color.BLACK));
    HashMap<Integer, ImageIcon> enzymeIcons = new HashMap<>();
    enzymeIcons.put(0, new ImageIcon(this.getClass().getResource("/icons/warning-red.png")));
    enzymeIcons.put(1, new ImageIcon(this.getClass().getResource("/icons/warning-new.png")));
    enzymeIcons.put(2, new ImageIcon(this.getClass().getResource("/icons/selected_green-new.png")));
    HashMap<Integer, String> enzymeIconTooltips = new HashMap<>();
    enzymeIconTooltips.put(0, "Non-enzymatic");
    enzymeIconTooltips.put(1, "Semi-enzymatic");
    enzymeIconTooltips.put(2, "Enzymatic");
    otherProteinJTable.getColumn("Enz").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(enzymeIcons, enzymeIconTooltips));
    // set the preferred size of the accession column
    width = ProteinTableModel.getPreferredAccessionColumnWidth(retainedProteinJTable, retainedProteinJTable.getColumn("Accession").getModelIndex(), 6, peptideShakerGUI.getMetrics().getMaxProteinAccessionLength());
    if (width != null) {
        retainedProteinJTable.getColumn("Accession").setMinWidth(width);
        retainedProteinJTable.getColumn("Accession").setMaxWidth(width);
    } else {
        retainedProteinJTable.getColumn("Accession").setMinWidth(15);
        retainedProteinJTable.getColumn("Accession").setMaxWidth(Integer.MAX_VALUE);
    }
    retainedProteinJTable.getColumn("Chr").setCellRenderer(new ChromosomeTableCellRenderer(Color.WHITE, Color.BLACK));
    retainedProteinJTable.getColumn("Enz").setCellRenderer(new JSparklinesIntegerIconTableCellRenderer(enzymeIcons, enzymeIconTooltips));
    // set up the table header tooltips
    retainedProteinsTableToolTips = new ArrayList<>();
    retainedProteinsTableToolTips.add(null);
    retainedProteinsTableToolTips.add("Protein Accession");
    retainedProteinsTableToolTips.add("Protein Description");
    retainedProteinsTableToolTips.add("Gene Name");
    retainedProteinsTableToolTips.add("Chromosome Number");
    retainedProteinsTableToolTips.add("Protein Evidence Level");
    retainedProteinsTableToolTips.add("Enzymatic Peptide");
    otherProteinsTableToolTips = new ArrayList<>();
    otherProteinsTableToolTips.add(null);
    otherProteinsTableToolTips.add("Protein Accession");
    otherProteinsTableToolTips.add("Protein Description");
    otherProteinsTableToolTips.add("Gene Name");
    otherProteinsTableToolTips.add("Chromosome Number");
    otherProteinsTableToolTips.add("Protein Evidence Level");
    otherProteinsTableToolTips.add("Enzymatic Peptide");
    // update the panel border with the nubmer of rows in the table
    ((TitledBorder) retainedProteinsPanel.getBorder()).setTitle("Retained Proteins (" + retainedProteinJTable.getRowCount() + ")");
    ((TitledBorder) otherProteinsPanel.getBorder()).setTitle("Other Proteins (" + otherProteinJTable.getRowCount() + ")");
}
Also used : AlignedListCellRenderer(com.compomics.util.gui.renderers.AlignedListCellRenderer) ImageIcon(javax.swing.ImageIcon) ChromosomeTableCellRenderer(no.uib.jsparklines.extra.ChromosomeTableCellRenderer) HashMap(java.util.HashMap) JSparklinesIntegerIconTableCellRenderer(no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer) TitledBorder(javax.swing.border.TitledBorder) HtmlLinksRenderer(no.uib.jsparklines.extra.HtmlLinksRenderer)

Aggregations

AlignedListCellRenderer (com.compomics.util.gui.renderers.AlignedListCellRenderer)5 Insets (java.awt.Insets)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 HashMap (java.util.HashMap)1 Vector (java.util.Vector)1 javax.swing (javax.swing)1 ImageIcon (javax.swing.ImageIcon)1 JComponent (javax.swing.JComponent)1 JTextField (javax.swing.JTextField)1 TitledBorder (javax.swing.border.TitledBorder)1 ChromosomeTableCellRenderer (no.uib.jsparklines.extra.ChromosomeTableCellRenderer)1 HtmlLinksRenderer (no.uib.jsparklines.extra.HtmlLinksRenderer)1 JSparklinesIntegerIconTableCellRenderer (no.uib.jsparklines.renderers.JSparklinesIntegerIconTableCellRenderer)1