Search in sources :

Example 86 with JPanel

use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.

the class EdgeWidthDialog method createSignatureSetPanel.

private JPanel createSignatureSetPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(LookAndFeelUtil.createTitledBorder("Signature Set (Post Analysis)"));
    panel.setLayout(new GridBagLayout());
    GridBagConstraints gbc;
    JLabel pValueLabel = new JLabel("p-value:  ");
    gbc = gridBagConstraints(0, 0);
    gbc.weightx = 1.0;
    panel.add(pValueLabel, gbc);
    JLabel lessThan100 = new JLabel("<= cutoff/100     ");
    gbc = gridBagConstraints(1, 0);
    panel.add(lessThan100, gbc);
    JLabel lessThan10 = new JLabel("<= cutoff/10     ");
    gbc = gridBagConstraints(2, 0);
    panel.add(lessThan10, gbc);
    JLabel greaterThan = new JLabel("> cutoff/10     ");
    gbc = gridBagConstraints(3, 0);
    panel.add(greaterThan, gbc);
    // Width
    JLabel widthLabel = new JLabel("Width:");
    gbc = gridBagConstraints(0, 1);
    panel.add(widthLabel, gbc);
    lessThan100Text = new JFormattedTextField(new DecimalFormat());
    lessThan100Text.setPreferredSize(new Dimension(50, lessThan100Text.getPreferredSize().height));
    lessThan100Text.setHorizontalAlignment(JTextField.RIGHT);
    gbc = gridBagConstraints(1, 1);
    gbc.insets = new Insets(5, 5, 5, 0);
    panel.add(lessThan100Text, gbc);
    lessThan10Text = new JFormattedTextField(new DecimalFormat());
    lessThan10Text.setPreferredSize(new Dimension(50, lessThan10Text.getPreferredSize().height));
    lessThan10Text.setHorizontalAlignment(JTextField.RIGHT);
    gbc = gridBagConstraints(2, 1);
    gbc.insets = new Insets(5, 5, 5, 0);
    panel.add(lessThan10Text, gbc);
    greaterThanText = new JFormattedTextField(new DecimalFormat());
    greaterThanText.setPreferredSize(new Dimension(50, greaterThanText.getPreferredSize().height));
    greaterThanText.setHorizontalAlignment(JTextField.RIGHT);
    gbc = gridBagConstraints(3, 1);
    gbc.insets = new Insets(5, 5, 5, 0);
    panel.add(greaterThanText, gbc);
    makeSmall(pValueLabel, lessThan100, lessThan10, greaterThan, widthLabel, lessThan100Text, lessThan10Text, greaterThanText);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) DecimalFormat(java.text.DecimalFormat) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 87 with JPanel

use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.

the class EdgeWidthDialog method createGenesetOverlapPanel.

private JPanel createGenesetOverlapPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(LookAndFeelUtil.createTitledBorder("Geneset Overlap"));
    panel.setLayout(new GridBagLayout());
    GridBagConstraints gbc;
    // Similarity Coefficient
    JLabel similarityLabel = new JLabel("Similarity Coefficient:    ");
    gbc = gridBagConstraints(0, 0);
    gbc.weightx = 1.0;
    panel.add(similarityLabel, gbc);
    JLabel lowerBound = new JLabel(String.format("%.1f", similarityCutoff));
    lowerBound.setHorizontalAlignment(JLabel.RIGHT);
    gbc = gridBagConstraints(1, 0);
    panel.add(lowerBound, gbc);
    // hardcoded
    JLabel upperBound = new JLabel("1.0");
    upperBound.setHorizontalAlignment(JLabel.RIGHT);
    gbc = gridBagConstraints(2, 0);
    panel.add(upperBound, gbc);
    JLabel spacer = new JLabel("");
    gbc = gridBagConstraints(3, 0);
    panel.add(spacer, gbc);
    // Width
    JLabel widthLabel = new JLabel("Width:");
    gbc = gridBagConstraints(0, 1);
    panel.add(widthLabel, gbc);
    emLowerWidthText = new JFormattedTextField(new DecimalFormat());
    emLowerWidthText.setPreferredSize(new Dimension(50, emLowerWidthText.getPreferredSize().height));
    emLowerWidthText.setHorizontalAlignment(JTextField.RIGHT);
    gbc = gridBagConstraints(1, 1);
    gbc.insets = new Insets(5, 5, 5, 0);
    panel.add(emLowerWidthText, gbc);
    emUpperWidthText = new JFormattedTextField(new DecimalFormat());
    emUpperWidthText.setPreferredSize(new Dimension(50, emUpperWidthText.getPreferredSize().height));
    emUpperWidthText.setHorizontalAlignment(JTextField.RIGHT);
    gbc = gridBagConstraints(2, 1);
    gbc.insets = new Insets(5, 5, 5, 0);
    panel.add(emUpperWidthText, gbc);
    JLabel mappingText = new JLabel("(continuous mapping) ");
    gbc = gridBagConstraints(3, 1);
    panel.add(mappingText, gbc);
    makeSmall(similarityLabel, lowerBound, upperBound, spacer, widthLabel, emLowerWidthText, emUpperWidthText, mappingText);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) DecimalFormat(java.text.DecimalFormat) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 88 with JPanel

use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.

the class EdgeWidthDialog method createContents.

private void createContents() {
    JPanel genesetOverlapPanel = createGenesetOverlapPanel();
    JPanel signatureSetPanel = createSignatureSetPanel();
    JPanel widthPanel = new JPanel();
    widthPanel.setLayout(new BoxLayout(widthPanel, BoxLayout.Y_AXIS));
    widthPanel.add(genesetOverlapPanel);
    widthPanel.add(Box.createVerticalStrut(5));
    widthPanel.add(signatureSetPanel);
    JPanel buttonPanel = createButtonPanel();
    JPanel panel = new JPanel();
    final GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(widthPanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createSequentialGroup().addComponent(widthPanel, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(buttonPanel, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
    add(panel);
}
Also used : JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout) GroupLayout(javax.swing.GroupLayout)

Example 89 with JPanel

use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.

the class LegendPanel method updateNodeColorPanel.

private void updateNodeColorPanel(Collection<EMDataSet> dataSets, EnrichmentMap map) {
    JPanel p = getNodeColorPanel();
    p.removeAll();
    if (dataSets != null && dataSets.size() == 1) {
        EMDataSet ds = dataSets.iterator().next();
        ColorLegendPanel clp = new ColorLegendPanel(Colors.MAX_PHENOTYPE_1, Colors.MAX_PHENOTYPE_2, ds.getEnrichments().getPhenotype1(), ds.getEnrichments().getPhenotype2());
        GroupLayout layout = (GroupLayout) p.getLayout();
        layout.setHorizontalGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(clp, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGap(0, 0, Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(clp));
        p.setVisible(true);
    } else {
        p.setVisible(false);
    }
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) EMDataSet(org.baderlab.csplugins.enrichmentmap.model.EMDataSet)

Example 90 with JPanel

use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.

the class PostAnalysisInputPanel method createContent.

@AfterInjection
private void createContent() {
    JPanel analysisTypePanel = createAnalysisTypePanel();
    JPanel namePanel = createNamePanel();
    final GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setAutoCreateContainerGaps(false);
    layout.setAutoCreateGaps(false);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(analysisTypePanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(namePanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(getUserInputScrollPane(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createSequentialGroup().addComponent(analysisTypePanel, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(namePanel, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getUserInputScrollPane(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
    if (LookAndFeelUtil.isAquaLAF())
        setOpaque(false);
    initialize();
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) AfterInjection(org.baderlab.csplugins.enrichmentmap.AfterInjection)

Aggregations

JPanel (javax.swing.JPanel)4487 JLabel (javax.swing.JLabel)1843 BorderLayout (java.awt.BorderLayout)1461 JButton (javax.swing.JButton)1180 Dimension (java.awt.Dimension)1107 GridBagLayout (java.awt.GridBagLayout)1071 ActionEvent (java.awt.event.ActionEvent)1019 GridBagConstraints (java.awt.GridBagConstraints)954 JScrollPane (javax.swing.JScrollPane)901 ActionListener (java.awt.event.ActionListener)871 BoxLayout (javax.swing.BoxLayout)801 Insets (java.awt.Insets)724 FlowLayout (java.awt.FlowLayout)667 JTextField (javax.swing.JTextField)532 JCheckBox (javax.swing.JCheckBox)458 GridLayout (java.awt.GridLayout)375 JComboBox (javax.swing.JComboBox)267 EmptyBorder (javax.swing.border.EmptyBorder)252 JTable (javax.swing.JTable)224 Color (java.awt.Color)210