Search in sources :

Example 11 with HorizontalPanel

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

the class HttpTestSampleGui method createEmbeddedRsrcPanel.

protected JPanel createEmbeddedRsrcPanel() {
    // retrieve Embedded resources
    // $NON-NLS-1$
    retrieveEmbeddedResources = new JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images"));
    // add a listener to activate or not concurrent dwn.
    retrieveEmbeddedResources.addItemListener(e -> {
        if (e.getStateChange() == ItemEvent.SELECTED) {
            enableConcurrentDwn(true);
        } else {
            enableConcurrentDwn(false);
        }
    });
    // Download concurrent resources
    // $NON-NLS-1$
    concurrentDwn = new JCheckBox(JMeterUtils.getResString("web_testing_concurrent_download"));
    concurrentDwn.addItemListener(e -> {
        if (retrieveEmbeddedResources.isSelected() && e.getStateChange() == ItemEvent.SELECTED) {
            concurrentPool.setEnabled(true);
        } else {
            concurrentPool.setEnabled(false);
        }
    });
    // 2 column size
    concurrentPool = new JTextField(2);
    concurrentPool.setMinimumSize(new Dimension(10, (int) concurrentPool.getPreferredSize().getHeight()));
    concurrentPool.setMaximumSize(new Dimension(30, (int) concurrentPool.getPreferredSize().getHeight()));
    final JPanel embeddedRsrcPanel = new HorizontalPanel();
    embeddedRsrcPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(// $NON-NLS-1$
    "web_testing_retrieve_title")));
    embeddedRsrcPanel.add(retrieveEmbeddedResources);
    embeddedRsrcPanel.add(concurrentDwn);
    embeddedRsrcPanel.add(concurrentPool);
    // Embedded URL match regex
    // $NON-NLS-1$
    embeddedRE = new JLabeledTextField(JMeterUtils.getResString("web_testing_embedded_url_pattern"), 20);
    embeddedRsrcPanel.add(embeddedRE);
    return embeddedRsrcPanel;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Example 12 with HorizontalPanel

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

the class HttpTestSampleGui method getProxyServerPanel.

/**
     * Create a panel containing the proxy server details
     *
     * @return the panel
     */
protected final JPanel getProxyServerPanel() {
    JPanel proxyServer = new HorizontalPanel();
    proxyServer.add(getProxyHostPanel(), BorderLayout.CENTER);
    proxyServer.add(getProxyPortPanel(), BorderLayout.EAST);
    JPanel proxyLogin = new HorizontalPanel();
    proxyLogin.add(getProxyUserPanel());
    proxyLogin.add(getProxyPassPanel());
    JPanel proxyServerPanel = new HorizontalPanel();
    proxyServerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("web_proxy_server_title")));
    proxyServerPanel.add(proxyServer);
    proxyServerPanel.add(proxyLogin);
    return proxyServerPanel;
}
Also used : JPanel(javax.swing.JPanel) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel)

Example 13 with HorizontalPanel

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

the class HttpMirrorControlGui method createPortPanel.

private JPanel createPortPanel() {
    portField = new JTextField(HttpMirrorControl.DEFAULT_PORT_S, 8);
    portField.setName(HttpMirrorControl.PORT);
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("port"));
    label.setLabelFor(portField);
    maxPoolSizeField = new JTextField(Integer.toString(HttpMirrorControl.DEFAULT_MAX_POOL_SIZE), 8);
    maxPoolSizeField.setName(HttpMirrorControl.MAX_POOL_SIZE);
    // $NON-NLS-1$
    JLabel mpsLabel = new JLabel(JMeterUtils.getResString("httpmirror_max_pool_size"));
    mpsLabel.setLabelFor(maxPoolSizeField);
    maxQueueSizeField = new JTextField(Integer.toString(HttpMirrorControl.DEFAULT_MAX_QUEUE_SIZE), 8);
    maxQueueSizeField.setName(HttpMirrorControl.MAX_QUEUE_SIZE);
    // $NON-NLS-1$
    JLabel mqsLabel = new JLabel(JMeterUtils.getResString("httpmirror_max_queue_size"));
    mqsLabel.setLabelFor(maxQueueSizeField);
    HorizontalPanel panel = new HorizontalPanel();
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("httpmirror_settings")));
    panel.add(label);
    panel.add(portField);
    panel.add(mpsLabel);
    panel.add(maxPoolSizeField);
    panel.add(mqsLabel);
    panel.add(maxQueueSizeField);
    panel.add(Box.createHorizontalStrut(10));
    return panel;
}
Also used : HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 14 with HorizontalPanel

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

the class HttpTestSampleGui method getImplementationPanel.

/**
     * Create a panel containing the implementation details
     *
     * @return the panel
     */
protected final JPanel getImplementationPanel() {
    JPanel implPanel = new HorizontalPanel();
    implPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("web_server_client")));
    // $NON-NLS-1$
    implPanel.add(new JLabel(JMeterUtils.getResString("http_implementation")));
    // $NON-NLS-1$
    httpImplementation.addItem("");
    implPanel.add(httpImplementation);
    return implPanel;
}
Also used : JPanel(javax.swing.JPanel) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel)

Example 15 with HorizontalPanel

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

the class TestActionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    // Target
    HorizontalPanel targetPanel = new HorizontalPanel();
    targetPanel.add(new JLabel(targetLabel));
    DefaultComboBoxModel<String> targetModel = new DefaultComboBoxModel<>();
    targetModel.addElement(threadTarget);
    targetModel.addElement(testTarget);
    targetBox = new JComboBox<>(targetModel);
    targetBox.addActionListener(evt -> {
        if (((String) targetBox.getSelectedItem()).equals(threadTarget)) {
            target = TestAction.THREAD;
        } else {
            target = TestAction.TEST;
        }
    });
    targetPanel.add(targetBox);
    add(targetPanel);
    // Action
    HorizontalPanel actionPanel = new HorizontalPanel();
    ButtonGroup actionButtons = new ButtonGroup();
    pauseButton = new JRadioButton(pauseAction, true);
    pauseButton.addChangeListener(evt -> {
        if (pauseButton.isSelected()) {
            action = TestAction.PAUSE;
            durationField.setEnabled(true);
            targetBox.setEnabled(true);
        }
    });
    stopButton = new JRadioButton(stopAction, false);
    stopButton.addChangeListener(evt -> {
        if (stopButton.isSelected()) {
            action = TestAction.STOP;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    stopNowButton = new JRadioButton(stopNowAction, false);
    stopNowButton.addChangeListener(evt -> {
        if (stopNowButton.isSelected()) {
            action = TestAction.STOP_NOW;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    restartNextLoopButton = new JRadioButton(restartNextLoopAction, false);
    restartNextLoopButton.addChangeListener(evt -> {
        if (restartNextLoopButton.isSelected()) {
            action = TestAction.RESTART_NEXT_LOOP;
            durationField.setEnabled(false);
            targetBox.setSelectedIndex(TestAction.THREAD);
            targetBox.setEnabled(false);
        }
    });
    actionButtons.add(pauseButton);
    actionButtons.add(stopButton);
    actionButtons.add(stopNowButton);
    actionButtons.add(restartNextLoopButton);
    actionPanel.add(new JLabel(actionLabel));
    actionPanel.add(pauseButton);
    actionPanel.add(stopButton);
    actionPanel.add(stopNowButton);
    actionPanel.add(restartNextLoopButton);
    add(actionPanel);
    // Duration
    HorizontalPanel durationPanel = new HorizontalPanel();
    durationField = new JTextField(15);
    // $NON-NLS-1$
    durationField.setText("");
    durationPanel.add(new JLabel(durationLabel));
    durationPanel.add(durationField);
    add(durationPanel);
}
Also used : JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) 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