jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject [jmeter] branch master updated: Bug 64282 - Throughput Controller : Improve UX
Date Sun, 29 Mar 2020 13:56:23 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


The following commit(s) were added to refs/heads/master by this push:
     new 31f8a9f  Bug 64282 - Throughput Controller : Improve UX
31f8a9f is described below

commit 31f8a9f4d208ce86d372c07931592ce5bdf0ff17
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Sun Mar 29 15:56:08 2020 +0200

    Bug 64282 - Throughput Controller : Improve UX
---
 .../control/gui/ThroughputControllerGui.java       | 31 +++++++++++-----------
 .../apache/jmeter/resources/messages.properties    |  1 +
 .../apache/jmeter/resources/messages_fr.properties |  1 +
 xdocs/changes.xml                                  |  1 +
 4 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/components/src/main/java/org/apache/jmeter/control/gui/ThroughputControllerGui.java
b/src/components/src/main/java/org/apache/jmeter/control/gui/ThroughputControllerGui.java
index b6d7dc8..ef7b864 100644
--- a/src/components/src/main/java/org/apache/jmeter/control/gui/ThroughputControllerGui.java
+++ b/src/components/src/main/java/org/apache/jmeter/control/gui/ThroughputControllerGui.java
@@ -17,23 +17,24 @@
 
 package org.apache.jmeter.control.gui;
 
+import java.awt.BorderLayout;
 import java.awt.event.ItemEvent;
 
+import javax.swing.BorderFactory;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 
 import org.apache.jmeter.control.ThroughputController;
 import org.apache.jmeter.gui.GUIMenuSortOrder;
 import org.apache.jmeter.gui.TestElementMetadata;
-import org.apache.jmeter.gui.util.CheckBoxPanel;
 import org.apache.jmeter.gui.util.MenuInfo;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jorphan.gui.layout.VerticalLayout;
+
+import net.miginfocom.swing.MigLayout;
 
 @GUIMenuSortOrder(MenuInfo.SORT_ORDER_DEFAULT+1)
 @TestElementMetadata(labelResource = "throughput_control_title")
@@ -55,8 +56,6 @@ public class ThroughputControllerGui extends AbstractControllerGui {
 
     private final String BYPERCENT_LABEL = JMeterUtils.getResString("throughput_control_bypercent_label");
// $NON-NLS-1$
 
-    private final String THROUGHPUT_LABEL = JMeterUtils.getResString("throughput_control_tplabel");
// $NON-NLS-1$
-
     private final String PERTHREAD_LABEL = JMeterUtils.getResString("throughput_control_perthread_label");
// $NON-NLS-1$
 
     public ThroughputControllerGui() {
@@ -126,9 +125,10 @@ public class ThroughputControllerGui extends AbstractControllerGui {
     }
 
     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));
+        setLayout(new BorderLayout());
         setBorder(makeBorder());
-        add(makeTitlePanel());
+
+        JPanel panel = new JPanel(new MigLayout("fillx, wrap 2", "[][fill,grow]"));
 
         DefaultComboBoxModel<String> styleModel = new DefaultComboBoxModel<>();
         styleModel.addElement(BYNUMBER_LABEL);
@@ -141,19 +141,15 @@ public class ThroughputControllerGui extends AbstractControllerGui {
                 style = ThroughputController.BYPERCENT;
             }
         });
-        add(styleBox);
 
-        // TYPE FIELD
-        JPanel tpPanel = new JPanel();
-        JLabel tpLabel = new JLabel(THROUGHPUT_LABEL);
-        tpPanel.add(tpLabel);
+        panel.add(JMeterUtils.labelFor(styleBox, "throughput_control_mode"));
+        panel.add(styleBox);
 
         // TEXT FIELD
         throughput = new JTextField(15);
-        tpPanel.add(throughput);
+        panel.add(JMeterUtils.labelFor(throughput, "throughput_control_tplabel"));
+        panel.add(throughput);
         throughput.setText("1"); // $NON-NLS-1$
-        tpPanel.add(throughput);
-        add(tpPanel);
 
         // PERTHREAD FIELD
         perthread = new JCheckBox(PERTHREAD_LABEL, isPerThread);
@@ -164,6 +160,9 @@ public class ThroughputControllerGui extends AbstractControllerGui {
                 isPerThread = false;
             }
         });
-        add(CheckBoxPanel.wrap(perthread));
+        panel.add(perthread, "span 2");
+
+        add(makeTitlePanel(), BorderLayout.NORTH);
+        add(panel, BorderLayout.CENTER);
     }
 }
diff --git a/src/core/src/main/resources/org/apache/jmeter/resources/messages.properties b/src/core/src/main/resources/org/apache/jmeter/resources/messages.properties
index 847188e..662149e 100644
--- a/src/core/src/main/resources/org/apache/jmeter/resources/messages.properties
+++ b/src/core/src/main/resources/org/apache/jmeter/resources/messages.properties
@@ -1306,6 +1306,7 @@ threadgroup_same_user=Same user on each iteration
 threadgroup_different_user=Different User on Each Iteration
 throughput_control_bynumber_label=Total Executions
 throughput_control_bypercent_label=Percent Executions
+throughput_control_mode=Based on
 throughput_control_perthread_label=Per User
 throughput_control_title=Throughput Controller
 throughput_control_tplabel=Throughput
diff --git a/src/core/src/main/resources/org/apache/jmeter/resources/messages_fr.properties
b/src/core/src/main/resources/org/apache/jmeter/resources/messages_fr.properties
index 5bf1b41..a09d15f 100644
--- a/src/core/src/main/resources/org/apache/jmeter/resources/messages_fr.properties
+++ b/src/core/src/main/resources/org/apache/jmeter/resources/messages_fr.properties
@@ -1295,6 +1295,7 @@ threadgroup_same_user=Même utilisateur à chaque itération
 threadgroup_different_user=Utilisateur différent à chaque itération
 throughput_control_bynumber_label=Exécutions totales
 throughput_control_bypercent_label=Pourcentage d'exécution
+throughput_control_mode=Basé sur
 throughput_control_perthread_label=Par utilisateur
 throughput_control_title=Contrôleur Débit
 throughput_control_tplabel=Débit \:
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 93e8c7b..c948c13 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -119,6 +119,7 @@ For instance: log viewer, JSR223 code editor were not previously scaled
with zoo
 <ul>
     <li><bug>64277</bug>ForEach Controller: Improve UX</li>
     <li><bug>64280</bug>If Controller: Improve UX</li>
+    <li><bug>64282</bug>Throughput Controller: Improve UX</li>
 </ul>
 
 <h3>Listeners</h3>


Mime
View raw message