Search in sources :

Example 36 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class ProxyControlGui method createGroupingPanel.

private JPanel createGroupingPanel() {
    DefaultComboBoxModel<String> m = new DefaultComboBoxModel<>();
    // Note: position of these elements in the menu *must* match the
    // corresponding ProxyControl.GROUPING_* values.
    // $NON-NLS-1$
    m.addElement(JMeterUtils.getResString("grouping_no_groups"));
    // $NON-NLS-1$
    m.addElement(JMeterUtils.getResString("grouping_add_separators"));
    // $NON-NLS-1$
    m.addElement(JMeterUtils.getResString("grouping_in_controllers"));
    // $NON-NLS-1$
    m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
    // $NON-NLS-1$
    m.addElement(JMeterUtils.getResString("grouping_in_transaction_controllers"));
    groupingMode = new JComboBox<>(m);
    groupingMode.setPreferredSize(new Dimension(150, 20));
    groupingMode.setSelectedIndex(0);
    groupingMode.addItemListener(this);
    // $NON-NLS-1$
    JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
    label2.setLabelFor(groupingMode);
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(label2);
    panel.add(groupingMode);
    return panel;
}
Also used : HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) Dimension(java.awt.Dimension)

Example 37 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class ProxyControlGui method createPortPanel.

private JPanel createPortPanel() {
    portField = new JTextField(ProxyControl.DEFAULT_PORT_S, 20);
    portField.setName(PORTFIELD);
    portField.addKeyListener(this);
    Dimension portPreferredSize = portField.getPreferredSize();
    portField.setMinimumSize(new Dimension((int) Math.round(portPreferredSize.width * 0.75), portPreferredSize.height));
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("port"));
    label.setLabelFor(portField);
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(label);
    panel.add(portField);
    // $NON-NLS-1$
    sslDomains = new JLabeledTextField(JMeterUtils.getResString("proxy_domains"));
    sslDomains.setEnabled(ProxyControl.isDynamicMode());
    if (ProxyControl.isDynamicMode()) {
        sslDomains.setToolTipText(JMeterUtils.getResString("proxy_domains_dynamic_mode_tooltip"));
    } else {
        sslDomains.setToolTipText(JMeterUtils.getResString("proxy_domains_dynamic_mode_tooltip_java6"));
    }
    GridBagLayout gridBagLayout = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.NONE;
    gbc.gridheight = 1;
    gbc.gridwidth = 1;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 1;
    gbc.weighty = 1;
    JPanel gPane = new JPanel(gridBagLayout);
    gPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("proxy_general_settings")));
    gPane.add(panel, gbc.clone());
    gbc.gridx++;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.weightx = 6;
    gPane.add(sslDomains, gbc);
    return gPane;
}
Also used : JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Aggregations

HorizontalPanel (org.apache.jmeter.gui.util.HorizontalPanel)37 JPanel (javax.swing.JPanel)30 JLabel (javax.swing.JLabel)17 BorderLayout (java.awt.BorderLayout)15 JTextField (javax.swing.JTextField)15 VerticalPanel (org.apache.jmeter.gui.util.VerticalPanel)11 JCheckBox (javax.swing.JCheckBox)10 Dimension (java.awt.Dimension)6 JLabeledTextField (org.apache.jorphan.gui.JLabeledTextField)6 ButtonGroup (javax.swing.ButtonGroup)5 JRadioButton (javax.swing.JRadioButton)4 GridBagConstraints (java.awt.GridBagConstraints)3 GridBagLayout (java.awt.GridBagLayout)3 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)3 FlowLayout (java.awt.FlowLayout)2 JPasswordField (javax.swing.JPasswordField)2 JScrollPane (javax.swing.JScrollPane)2 JTabbedPane (javax.swing.JTabbedPane)2 Color (java.awt.Color)1 Format (java.text.Format)1