jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject [jmeter] 02/02: Bug 64281 - Counter Config: Improve UX
Date Sun, 29 Mar 2020 11:35:27 GMT
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 8b7cc736ac9fbf0bb4673181d0e8be3fec8ab986
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 13:35:11 2020 +0200

    Bug 64281 - Counter Config: Improve UX
---
 .../jmeter/modifiers/gui/CounterConfigGui.java     | 65 ++++++++++++++--------
 xdocs/changes.xml                                  |  1 +
 2 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/src/components/src/main/java/org/apache/jmeter/modifiers/gui/CounterConfigGui.java
b/src/components/src/main/java/org/apache/jmeter/modifiers/gui/CounterConfigGui.java
index 9c57cfd..655bb99 100644
--- a/src/components/src/main/java/org/apache/jmeter/modifiers/gui/CounterConfigGui.java
+++ b/src/components/src/main/java/org/apache/jmeter/modifiers/gui/CounterConfigGui.java
@@ -17,31 +17,33 @@
 
 package org.apache.jmeter.modifiers.gui;
 
+import java.awt.BorderLayout;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 
+import javax.swing.BorderFactory;
 import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
 
 import org.apache.jmeter.config.gui.AbstractConfigGui;
 import org.apache.jmeter.gui.TestElementMetadata;
-import org.apache.jmeter.gui.util.CheckBoxPanel;
 import org.apache.jmeter.modifiers.CounterConfig;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.JLabeledTextField;
-import org.apache.jorphan.gui.layout.VerticalLayout;
+
+import net.miginfocom.swing.MigLayout;
 
 @TestElementMetadata(labelResource = "counter_config_title")
 public class CounterConfigGui extends AbstractConfigGui implements ActionListener {
     private static final long serialVersionUID = 240L;
 
-    private JLabeledTextField startField;
-    private JLabeledTextField incrField;
-    private JLabeledTextField endField;
-    private JLabeledTextField varNameField;
-    private JLabeledTextField formatField;
+    private JTextField startField;
+    private JTextField incrField;
+    private JTextField endField;
+    private JTextField varNameField;
+    private JTextField formatField;
     private JCheckBox resetCounterOnEachThreadGroupIteration;
-
     private JCheckBox perUserField;
 
     public CounterConfigGui() {
@@ -121,25 +123,40 @@ public class CounterConfigGui extends AbstractConfigGui implements ActionListene
 
     private void init() { // WARNING: called from ctor so must not be overridden (i.e. must
be private or final)
         setBorder(makeBorder());
-        setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
+        setLayout(new BorderLayout());
+
+        JPanel counterPanel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
+        counterPanel.setBorder(BorderFactory.createEtchedBorder());
+
+        startField = new JTextField(20);
+        counterPanel.add(JMeterUtils.labelFor(startField, "start_value"));
+        counterPanel.add(startField);
+
+        incrField = new JTextField(20);
+        counterPanel.add(JMeterUtils.labelFor(incrField, "increment"));
+        counterPanel.add(incrField);
+
+        endField = new JTextField(20);
+        counterPanel.add(JMeterUtils.labelFor(endField, "max_value"));
+        counterPanel.add(endField);
+
+        formatField = new JTextField(20);
+        counterPanel.add(JMeterUtils.labelFor(formatField, "format"));
+        counterPanel.add(formatField);
+
+        varNameField = new JTextField(20);
+        counterPanel.add(JMeterUtils.labelFor(varNameField, "var_name"));
+        counterPanel.add(varNameField);
 
-        startField = new JLabeledTextField(JMeterUtils.getResString("start_value"));//$NON-NLS-1$
-        incrField = new JLabeledTextField(JMeterUtils.getResString("increment"));//$NON-NLS-1$
-        endField = new JLabeledTextField(JMeterUtils.getResString("max_value"));//$NON-NLS-1$
-        varNameField = new JLabeledTextField(JMeterUtils.getResString("var_name"));//$NON-NLS-1$
-        formatField = new JLabeledTextField(JMeterUtils.getResString("format"));//$NON-NLS-1$
         perUserField = new JCheckBox(JMeterUtils.getResString("counter_per_user"));//$NON-NLS-1$
+        perUserField.addActionListener(this);
+        counterPanel.add(perUserField, "span 2");
+
         resetCounterOnEachThreadGroupIteration = new JCheckBox(JMeterUtils.getResString("counter_reset_per_tg_iteration"));//$NON-NLS-1$
-        add(makeTitlePanel());
-        add(startField);
-        add(incrField);
-        add(endField);
-        add(formatField);
-        add(varNameField);
-        add(CheckBoxPanel.wrap(perUserField));
-        add(CheckBoxPanel.wrap(resetCounterOnEachThreadGroupIteration));
+        counterPanel.add(resetCounterOnEachThreadGroupIteration, "span 2");
 
-        perUserField.addActionListener(this);
+        add(makeTitlePanel(), BorderLayout.NORTH);
+        add(counterPanel, BorderLayout.CENTER);
     }
 
     /**
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index b42b7d2..93e8c7b 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -130,6 +130,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled
with zoo
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
 <ul>
     <li><bug>64091</bug>Precise Throughput Timer schedule generation is
improved significantly (e.g. 2 seconds for 10M samples)</li>
+    <li><bug>64281</bug>Counter Config: Improve UX</li>
 </ul>
 
 <h3>Functions</h3>


Mime
View raw message