Search in sources :

Example 1 with GroupLayout

use of javax.swing.GroupLayout in project zaproxy by zaproxy.

the class CertificateView method initComponents.

/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
private void initComponents() {
    closeButton = new JButton();
    certificateScrollPane = new JScrollPane();
    certificateTextArea = new ZapTextArea();
    //TODO: Constant for messages.properties
    setTitle("Certificate");
    //TODO: Constant for messages.properties
    closeButton.setText("Close");
    closeButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent evt) {
            closeButtonActionPerformed(evt);
        }
    });
    certificateScrollPane.setViewportView(certificateTextArea);
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(closeButton, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE).addComponent(certificateScrollPane, GroupLayout.DEFAULT_SIZE, 658, Short.MAX_VALUE)).addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(certificateScrollPane, GroupLayout.DEFAULT_SIZE, 439, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(closeButton).addContainerGap()));
    pack();
}
Also used : JScrollPane(javax.swing.JScrollPane) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) GroupLayout(javax.swing.GroupLayout) ZapTextArea(org.zaproxy.zap.utils.ZapTextArea)

Example 2 with GroupLayout

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

the class PostAnalysisInputPanel method createNamePanel.

private JPanel createNamePanel() {
    nameText = new JTextField();
    makeSmall(nameText);
    JPanel panel = new JPanel();
    panel.setBorder(LookAndFeelUtil.createTitledBorder("Data Set Name (optional)"));
    final GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(nameText, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(nameText, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
    if (LookAndFeelUtil.isAquaLAF())
        panel.setOpaque(false);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) JTextField(javax.swing.JTextField)

Example 3 with GroupLayout

use of javax.swing.GroupLayout 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 4 with GroupLayout

use of javax.swing.GroupLayout 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 5 with GroupLayout

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

the class LegendPanel method getNodeChartPanel.

private JPanel getNodeChartPanel() {
    if (nodeChartPanel == null) {
        nodeChartPanel = createStyleLegendPanel(null);
        nodeChartPanel.setToolTipText("Node Charts");
        int h = 200;
        if (options.getChartOptions() != null) {
            if (options.getChartOptions().getType() == ChartType.HEAT_STRIPS && options.getDataSets().size() > 4)
                h = 300;
            else if (options.getChartOptions().getType() == ChartType.HEAT_MAP)
                h = Math.max(180, 62 + options.getDataSets().size() * 24);
        }
        GroupLayout layout = (GroupLayout) nodeChartPanel.getLayout();
        layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(chartLegendPanel, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
        layout.setVerticalGroup(layout.createSequentialGroup().addComponent(chartLegendPanel, PREFERRED_SIZE, h, h));
    }
    return nodeChartPanel;
}
Also used : GroupLayout(javax.swing.GroupLayout) Paint(java.awt.Paint)

Aggregations

GroupLayout (javax.swing.GroupLayout)191 JPanel (javax.swing.JPanel)132 JLabel (javax.swing.JLabel)79 JButton (javax.swing.JButton)51 ActionEvent (java.awt.event.ActionEvent)42 JScrollPane (javax.swing.JScrollPane)37 ActionListener (java.awt.event.ActionListener)23 JTextField (javax.swing.JTextField)22 Dimension (java.awt.Dimension)21 AbstractAction (javax.swing.AbstractAction)20 JSeparator (javax.swing.JSeparator)15 JCheckBox (javax.swing.JCheckBox)14 ParallelGroup (javax.swing.GroupLayout.ParallelGroup)10 SequentialGroup (javax.swing.GroupLayout.SequentialGroup)10 JComboBox (javax.swing.JComboBox)10 Color (java.awt.Color)9 Font (java.awt.Font)9 JTable (javax.swing.JTable)9 PropertyChangeListener (java.beans.PropertyChangeListener)8 AfterInjection (org.baderlab.csplugins.enrichmentmap.AfterInjection)8