Search in sources :

Example 46 with GroupLayout

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

the class GradientLegendPanel method createExpressionLegendPanel.

private static JPanel createExpressionLegendPanel(DataSetColorRange range) {
    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    ParallelGroup hGroup = layout.createParallelGroup(Alignment.CENTER, true);
    SequentialGroup vGroup = layout.createSequentialGroup();
    layout.setHorizontalGroup(hGroup);
    layout.setVerticalGroup(vGroup);
    ColorGradientWidget legend = ColorGradientWidget.getInstance("", range.getTheme(), range.getRange(), true, ColorGradientWidget.LEGEND_POSITION.NA);
    hGroup.addComponent(legend, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE);
    vGroup.addComponent(legend, 25, 25, 25);
    if (LookAndFeelUtil.isAquaLAF())
        panel.setOpaque(false);
    panel.revalidate();
    panel.setOpaque(false);
    return panel;
}
Also used : ColorGradientWidget(org.mskcc.colorgradient.ColorGradientWidget) JPanel(javax.swing.JPanel) ParallelGroup(javax.swing.GroupLayout.ParallelGroup) SequentialGroup(javax.swing.GroupLayout.SequentialGroup) GroupLayout(javax.swing.GroupLayout)

Example 47 with GroupLayout

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

the class SettingsPopupPanel method createContents.

/**
	 * Cannot use JComboBox on a JPopupMenu because of a bug in swing: 
	 * http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4799266
	 */
private void createContents() {
    JLabel distanceLabel = new JLabel("  Hierarchical Cluster - Distance Metric  ");
    cosineRadio = new JRadioButton("Cosine");
    euclideanRadio = new JRadioButton("Euclidean");
    pearsonRadio = new JRadioButton("Pearson Correlation");
    JPanel distanceRadioPanel = createButtonPanel(cosineRadio, euclideanRadio, pearsonRadio);
    cosineRadio.addActionListener(cosineListener = dmListenerFor(Distance.COSINE));
    euclideanRadio.addActionListener(euclideanListener = dmListenerFor(Distance.EUCLIDEAN));
    pearsonRadio.addActionListener(pearsonListener = dmListenerFor(Distance.PEARSON));
    SwingUtil.makeSmall(distanceLabel);
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setAutoCreateContainerGaps(false);
    layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
    layout.setHorizontalGroup(layout.createParallelGroup().addComponent(distanceLabel).addComponent(distanceRadioPanel));
    layout.setVerticalGroup(layout.createSequentialGroup().addGap(5).addComponent(distanceLabel).addComponent(distanceRadioPanel).addGap(5));
}
Also used : JPanel(javax.swing.JPanel) JRadioButton(javax.swing.JRadioButton) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Example 48 with GroupLayout

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

the class DriversView 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() {
    fileLabel = new JLabel();
    fileTextField = new ZapTextField();
    browseButton = new JButton();
    nameLabel = new JLabel();
    nameTextField = new ZapTextField();
    slotLabel = new JLabel();
    slotTextField = new ZapTextField();
    slotListIndexLabel = new JLabel();
    slotListIndexTextField = new ZapTextField();
    addButton = new JButton();
    deleteButton = new JButton();
    closeButton = new JButton();
    driverScrollPane = new JScrollPane();
    driverTable = new JTable();
    setTitle(Constant.messages.getString("certificates.pkcs11.drivers.title"));
    fileLabel.setText(Constant.messages.getString("certificates.pkcs11.drivers.label.path"));
    browseButton.setText(Constant.messages.getString("certificates.pkcs11.drivers.button.browse"));
    browseButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            browseButtonActionPerformed(evt);
        }
    });
    nameLabel.setText(Constant.messages.getString("certificates.pkcs11.drivers.label.name"));
    slotLabel.setText(Constant.messages.getString("certificates.pkcs11.drivers.label.slot"));
    slotListIndexLabel.setText(Constant.messages.getString("certificates.pkcs11.drivers.label.slotIndex"));
    addButton.setText(Constant.messages.getString("certificates.pkcs11.drivers.button.add"));
    addButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            addButtonActionPerformed(evt);
        }
    });
    deleteButton.setText(Constant.messages.getString("certificates.pkcs11.drivers.button.delete"));
    deleteButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            deleteButtonActionPerformed(evt);
        }
    });
    closeButton.setText(Constant.messages.getString("certificates.pkcs11.drivers.button.close"));
    closeButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
            closeButtonActionPerformed(evt);
        }
    });
    driverTable.setModel(driverTableModel);
    driverScrollPane.setViewportView(driverTable);
    // as only one of these parameters is actually used.
    if (!Model.getSingleton().getOptionsParam().getExperimentalFeaturesParam().isExerimentalSliSupportEnabled()) {
        slotTextField.setEnabled(false);
    }
    final GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(fileLabel).addComponent(nameLabel).addComponent(slotLabel).addComponent(slotListIndexLabel).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false).addComponent(nameTextField, GroupLayout.Alignment.LEADING).addComponent(slotTextField, GroupLayout.Alignment.LEADING).addComponent(slotListIndexTextField, GroupLayout.Alignment.LEADING).addComponent(fileTextField, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(addButton, GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE).addComponent(browseButton)))).addContainerGap(165, Short.MAX_VALUE)).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addGap(499, 499, 499).addComponent(closeButton, GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE).addContainerGap()).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(driverScrollPane, GroupLayout.DEFAULT_SIZE, 561, Short.MAX_VALUE).addContainerGap()).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap(499, Short.MAX_VALUE).addComponent(deleteButton).addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addComponent(fileLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addComponent(browseButton, 0, 0, Short.MAX_VALUE).addComponent(fileTextField)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(nameLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(nameTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(slotLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(slotTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)).addGap(28, 28, 28).addComponent(slotListIndexLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(slotListIndexTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addComponent(addButton, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)).addGap(28, 28, 28).addComponent(driverScrollPane, GroupLayout.PREFERRED_SIZE, 195, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(deleteButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE).addComponent(closeButton, GroupLayout.PREFERRED_SIZE, 10, GroupLayout.PREFERRED_SIZE).addContainerGap()));
    layout.linkSize(SwingConstants.VERTICAL, new Component[] { addButton, browseButton, closeButton, deleteButton, fileTextField, nameTextField });
    for (int i = 0; i < driverTableModel.getColumnCount(); i++) {
        driverTable.getColumnModel().getColumn(i).setPreferredWidth(driverTableModel.getPreferredWith(i));
    }
    pack();
}
Also used : JScrollPane(javax.swing.JScrollPane) ActionListener(java.awt.event.ActionListener) ZapTextField(org.zaproxy.zap.utils.ZapTextField) ActionEvent(java.awt.event.ActionEvent) JTable(javax.swing.JTable) JButton(javax.swing.JButton) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Example 49 with GroupLayout

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

the class DialogAddPermittedAddress method getFieldsPanel.

@Override
protected JPanel getFieldsPanel() {
    JPanel fieldsPanel = new JPanel();
    GroupLayout layout = new GroupLayout(fieldsPanel);
    fieldsPanel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    JLabel domainLabel = new JLabel(DOMAIN_FIELD_LABEL);
    JLabel regexLabel = new JLabel(REGEX_FIELD_LABEL);
    JLabel enabledLabel = new JLabel(ENABLED_FIELD_LABEL);
    layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(domainLabel).addComponent(enabledLabel).addComponent(regexLabel)).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getAddressTextField()).addComponent(getEnabledCheckBox()).addComponent(getRegexCheckBox())));
    layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(domainLabel).addComponent(getAddressTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(regexLabel).addComponent(getRegexCheckBox())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(enabledLabel).addComponent(getEnabledCheckBox())));
    return fieldsPanel;
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Example 50 with GroupLayout

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

the class DialogAddToken method getFieldsPanel.

@Override
protected JPanel getFieldsPanel() {
    JPanel fieldsPanel = new JPanel();
    GroupLayout layout = new GroupLayout(fieldsPanel);
    fieldsPanel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    JLabel nameLabel = new JLabel(NAME_FIELD_LABEL);
    JLabel enabledLabel = new JLabel(ENABLED_FIELD_LABEL);
    layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(nameLabel).addComponent(enabledLabel)).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getNameTextField()).addComponent(getEnabledCheckBox())));
    layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(nameLabel).addComponent(getNameTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(enabledLabel).addComponent(getEnabledCheckBox())));
    return fieldsPanel;
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Aggregations

GroupLayout (javax.swing.GroupLayout)61 JPanel (javax.swing.JPanel)43 JLabel (javax.swing.JLabel)36 JButton (javax.swing.JButton)17 JScrollPane (javax.swing.JScrollPane)11 ActionEvent (java.awt.event.ActionEvent)9 ActionListener (java.awt.event.ActionListener)9 JCheckBox (javax.swing.JCheckBox)9 JTextField (javax.swing.JTextField)9 AfterInjection (org.baderlab.csplugins.enrichmentmap.AfterInjection)8 JFormattedTextField (javax.swing.JFormattedTextField)6 Dimension (java.awt.Dimension)5 JTable (javax.swing.JTable)5 Color (java.awt.Color)4 JRadioButton (javax.swing.JRadioButton)4 JSpinner (javax.swing.JSpinner)4 SpinnerNumberModel (javax.swing.SpinnerNumberModel)4 MouseEvent (java.awt.event.MouseEvent)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)3 Arrays (java.util.Arrays)3