You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by se...@apache.org on 2010/06/23 22:03:49 UTC

svn commit: r957326 - in /jakarta/jmeter/trunk: docs/images/screenshots/ src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/ xdocs/images/screenshots/ xdocs/usermanual/

Author: sebb
Date: Wed Jun 23 20:03:49 2010
New Revision: 957326

URL: http://svn.apache.org/viewvc?rev=957326&view=rev
Log:
Tidy up the JMS GUIs

Modified:
    jakarta/jmeter/trunk/docs/images/screenshots/jmspublisher.png
    jakarta/jmeter/trunk/docs/images/screenshots/jmssubscriber.png
    jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
    jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
    jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java
    jakarta/jmeter/trunk/xdocs/images/screenshots/jmspublisher.png
    jakarta/jmeter/trunk/xdocs/images/screenshots/jmssubscriber.png
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/docs/images/screenshots/jmspublisher.png
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/images/screenshots/jmspublisher.png?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/docs/images/screenshots/jmssubscriber.png
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/images/screenshots/jmssubscriber.png?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java Wed Jun 23 20:03:49 2010
@@ -18,36 +18,31 @@
 
 package org.apache.jmeter.protocol.jms.control.gui;
 
+import java.awt.BorderLayout;
 import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.event.ActionEvent;
 
 import javax.swing.JCheckBox;
 import javax.swing.JOptionPane;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
+import org.apache.jmeter.gui.util.FilePanel;
+import org.apache.jmeter.gui.util.JLabeledRadioI18N;
+import org.apache.jmeter.gui.util.VerticalPanel;
+import org.apache.jmeter.protocol.jms.sampler.PublisherSampler;
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jmeter.gui.util.FilePanel;
-import org.apache.jmeter.gui.util.JLabeledRadioI18N;
-import org.apache.jorphan.gui.JLabeledTextField;
 import org.apache.jorphan.gui.JLabeledTextArea;
-import org.apache.jorphan.gui.layout.VerticalLayout;
-
-import org.apache.jmeter.protocol.jms.sampler.PublisherSampler;
+import org.apache.jorphan.gui.JLabeledTextField;
 
 /**
  * This is the GUI for JMS Publisher <br>
  * Created on: October 13, 2003
  *
  */
-public class JMSPublisherGui extends AbstractSamplerGui implements java.awt.event.ActionListener, ChangeListener {
+public class JMSPublisherGui extends AbstractSamplerGui implements ChangeListener {
 
     private static final long serialVersionUID = 240L;
 
@@ -102,10 +97,6 @@ public class JMSPublisherGui extends Abs
 
     private final JLabeledRadioI18N msgChoice = new JLabeledRadioI18N("jms_message_type", MSGTYPES_ITEMS, TEXT_MSG_RSC); //$NON-NLS-1$
 
-    private final JPanel lookup = new JPanel();
-
-    private final JPanel messagePanel = new JPanel();
-
     public JMSPublisherGui() {
         init();
     }
@@ -169,59 +160,35 @@ public class JMSPublisherGui extends Abs
      * SOAPSampler, since it is common.
      */
     private void init() {
-        this.setLayout(new VerticalLayout(5, VerticalLayout.LEFT, VerticalLayout.TOP));
+        setLayout(new BorderLayout());
+        setBorder(makeBorder());
+        add(makeTitlePanel(), BorderLayout.NORTH);
+
+        JPanel mainPanel = new VerticalPanel();
+        add(mainPanel, BorderLayout.CENTER);
+        
+        mainPanel.add(useProperties);
+        mainPanel.add(jndiICF);
+        mainPanel.add(urlField);
+        mainPanel.add(jndiConnFac);
+        mainPanel.add(jmsDestination);
+        mainPanel.add(useAuth);
+        mainPanel.add(jmsUser);
+        mainPanel.add(jmsPwd);
+        mainPanel.add(iterations);
+
+        mainPanel.add(configChoice);
+        mainPanel.add(msgChoice);
+        mainPanel.add(messageFile);
+        mainPanel.add(randomFile);
+        mainPanel.add(textMessage);
+        Dimension pref = new Dimension(400, 150);
+        textMessage.setPreferredSize(pref);
 
-        // MAIN PANEL
-        JPanel mainPanel = new JPanel();
-        Border margin = new EmptyBorder(10, 10, 5, 10);
-        mainPanel.setBorder(margin);
-        mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
-
-        // TITLE
-        JLabel panelTitleLabel = new JLabel(getStaticLabel());
-        Font curFont = panelTitleLabel.getFont();
-        int curFontSize = curFont.getSize();
-        curFontSize += 4;
-        panelTitleLabel.setFont(new Font(curFont.getFontName(), curFont.getStyle(), curFontSize));
-        mainPanel.add(panelTitleLabel);
-        // NAME
-        mainPanel.add(getNamePanel());
-
-        // Button for browsing webservice wsdl
-
-        lookup.setLayout(new VerticalLayout(6, VerticalLayout.LEFT));
-        mainPanel.add(lookup);
-        lookup.add(useProperties);
         useProperties.addChangeListener(this);
-        lookup.add(jndiICF);
-        lookup.add(urlField);
-        lookup.add(jndiConnFac);
-
+        useAuth.addChangeListener(this);
         configChoice.addChangeListener(this);
         msgChoice.addChangeListener(this);
-
-        JPanel commonParams = new JPanel();
-        commonParams.setLayout(new VerticalLayout(6, VerticalLayout.LEFT));
-        mainPanel.add(commonParams);
-        commonParams.add(jmsDestination);
-        commonParams.add(useAuth);
-        commonParams.add(jmsUser);
-        commonParams.add(jmsPwd);
-        commonParams.add(iterations);
-
-        messagePanel.setLayout(new VerticalLayout(3, VerticalLayout.LEFT));
-        messagePanel.add(configChoice);
-        messagePanel.add(msgChoice);
-        messagePanel.add(messageFile);
-        messagePanel.add(randomFile);
-        messagePanel.add(textMessage);
-        mainPanel.add(messagePanel);
-
-        Dimension pref = new Dimension(400, 200);
-        textMessage.setPreferredSize(pref);
-
-        // we have to add the gui to the change listener
-        this.add(mainPanel);
     }
 
     @Override
@@ -269,31 +236,20 @@ public class JMSPublisherGui extends Abs
     }
 
     /**
-     * method from ActionListener
-     *
-     * @param event
-     *            that occurred
-     */
-    public void actionPerformed(ActionEvent event) {
-    }
-
-    /**
      * When a widget state changes, it will notify this class so we can
      * enable/disable the correct items.
      */
     public void stateChanged(ChangeEvent event) {
-        if (event.getSource() == this.configChoice) {
-            updateConfig(this.configChoice.getText());
-        } else if (event.getSource() == this.msgChoice) {
-            updateMessageType(this.msgChoice.getText());
+        if (event.getSource() == configChoice) {
+            updateConfig(configChoice.getText());
+        } else if (event.getSource() == msgChoice) {
+            updateMessageType(msgChoice.getText());
         } else if (event.getSource() == useProperties) {
-            if (useProperties.isSelected()) {
-                this.jndiICF.setEnabled(false);
-                this.urlField.setEnabled(false);
-            } else {
-                this.jndiICF.setEnabled(true);
-                this.urlField.setEnabled(true);
-            }
+            jndiICF.setEnabled(!useProperties.isSelected());
+            urlField.setEnabled(!useProperties.isSelected());
+        } else if (event.getSource() == useAuth) {
+            jmsUser.setEnabled(!useAuth.isSelected());
+            jmsPwd.setEnabled(!useAuth.isSelected());
         }
     }
 

Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java Wed Jun 23 20:03:49 2010
@@ -186,8 +186,6 @@ public class JMSSamplerGui extends Abstr
         setBorder(makeBorder());
         add(makeTitlePanel(), BorderLayout.NORTH);
 
-        Box mainPanel = Box.createVerticalBox();
-
         JPanel jmsQueueingPanel = new JPanel(new BorderLayout());
         jmsQueueingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
                 JMeterUtils.getResString("jms_queueing"))); //$NON-NLS-1$
@@ -204,8 +202,6 @@ public class JMSSamplerGui extends Abstr
         receiveQueuePanel.add(receiveQueue);
         jmsQueueingPanel.add(receiveQueuePanel, BorderLayout.SOUTH);
 
-        JPanel jndiPanel = createJNDIPanel();
-
         JPanel messagePanel = new JPanel(new BorderLayout());
         messagePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
                 JMeterUtils.getResString("jms_message_title"))); //$NON-NLS-1$
@@ -243,11 +239,13 @@ public class JMSSamplerGui extends Abstr
         jmsPropertiesPanel = new ArgumentsPanel(JMeterUtils.getResString("jms_props")); //$NON-NLS-1$
         messagePanel.add(jmsPropertiesPanel, BorderLayout.SOUTH);
 
+        Box mainPanel = Box.createVerticalBox();
+        add(mainPanel, BorderLayout.CENTER);
         mainPanel.add(jmsQueueingPanel, BorderLayout.NORTH);
         mainPanel.add(messagePanel, BorderLayout.CENTER);
+        JPanel jndiPanel = createJNDIPanel();
         mainPanel.add(jndiPanel, BorderLayout.SOUTH);
 
-        add(mainPanel, BorderLayout.CENTER);
     }
 
     /**

Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java (original)
+++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java Wed Jun 23 20:03:49 2010
@@ -18,31 +18,26 @@
 
 package org.apache.jmeter.protocol.jms.control.gui;
 
-import java.awt.Font;
-import java.awt.event.ActionEvent;
+import java.awt.BorderLayout;
 
 import javax.swing.JCheckBox;
-import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.border.Border;
-import javax.swing.border.EmptyBorder;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
+import org.apache.jmeter.gui.util.JLabeledRadioI18N;
+import org.apache.jmeter.gui.util.VerticalPanel;
+import org.apache.jmeter.protocol.jms.sampler.SubscriberSampler;
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 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 org.apache.jmeter.gui.util.JLabeledRadioI18N;
-import org.apache.jmeter.protocol.jms.sampler.SubscriberSampler;
 
 /**
  * This is the GUI for JMS Subscriber <br>
  *
  */
-public class JMSSubscriberGui extends AbstractSamplerGui implements java.awt.event.ActionListener, ChangeListener {
+public class JMSSubscriberGui extends AbstractSamplerGui implements ChangeListener {
 
     private static final long serialVersionUID = 240L;
 
@@ -76,7 +71,7 @@ public class JMSSubscriberGui extends Ab
     private final JCheckBox readResponse =
         new JCheckBox(JMeterUtils.getResString("jms_read_response"), true); // $NON-NLS-1$
 
-    private JLabeledTextField timeout = 
+    private final JLabeledTextField timeout = 
         new JLabeledTextField(JMeterUtils.getResString("jms_timeout")); //$NON-NLS-1$
 
     //++ Do not change these strings; they are used in JMX files to record the button settings
@@ -91,8 +86,6 @@ public class JMSSubscriberGui extends Ab
     private final JLabeledRadioI18N clientChoice =
         new JLabeledRadioI18N("jms_client_type", CLIENT_ITEMS, RECEIVE_RSC); // $NON-NLS-1$
 
-    private final JPanel lookup = new JPanel();
-
     public JMSSubscriberGui() {
         init();
     }
@@ -137,48 +130,29 @@ public class JMSSubscriberGui extends Ab
      * SOAPSampler, since it is common.
      */
     private void init() {
-        this.setLayout(new VerticalLayout(5, VerticalLayout.LEFT, VerticalLayout.TOP));
+        setLayout(new BorderLayout());
+        setBorder(makeBorder());
+        add(makeTitlePanel(), BorderLayout.NORTH);
+
+        JPanel mainPanel = new VerticalPanel();
+        add(mainPanel, BorderLayout.CENTER);
+        
+        mainPanel.add(useProperties);
+        mainPanel.add(jndiICF);
+        mainPanel.add(urlField);
+        mainPanel.add(jndiConnFac);
+        mainPanel.add(jmsDestination);
+        mainPanel.add(useAuth);
+        mainPanel.add(jmsUser);
+        mainPanel.add(jmsPwd);
+        mainPanel.add(iterations);
+
+        mainPanel.add(readResponse);
+        mainPanel.add(timeout);
+        mainPanel.add(clientChoice);
 
-        // MAIN PANEL
-        JPanel mainPanel = new JPanel();
-        Border margin = new EmptyBorder(10, 10, 5, 10);
-        mainPanel.setBorder(margin);
-        mainPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
-
-        // TITLE
-        JLabel panelTitleLabel = new JLabel(getStaticLabel());
-        Font curFont = panelTitleLabel.getFont();
-        int curFontSize = curFont.getSize();
-        curFontSize += 4;
-        panelTitleLabel.setFont(new Font(curFont.getFontName(), curFont.getStyle(), curFontSize));
-        mainPanel.add(panelTitleLabel);
-        // NAME
-        mainPanel.add(getNamePanel());
-
-        // Button for browsing webservice wsdl
-
-        lookup.setLayout(new VerticalLayout(6, VerticalLayout.LEFT));
-        mainPanel.add(lookup);
-        lookup.add(useProperties);
         useProperties.addChangeListener(this);
-        lookup.add(jndiICF);
-        lookup.add(urlField);
-        lookup.add(jndiConnFac);
-
-        JPanel commonParams = new JPanel();
-        commonParams.setLayout(new VerticalLayout(6, VerticalLayout.LEFT));
-        mainPanel.add(commonParams);
-        commonParams.add(jmsDestination);
-        commonParams.add(useAuth);
-        commonParams.add(jmsUser);
-        commonParams.add(jmsPwd);
-        commonParams.add(iterations);
-        commonParams.add(readResponse);
-        commonParams.add(timeout);
-        commonParams.add(clientChoice);
-
-        // we have to add the gui to the change listener
-        this.add(mainPanel);
+        useAuth.addChangeListener(this);
     }
 
     /**
@@ -220,29 +194,16 @@ public class JMSSubscriberGui extends Ab
     }
 
     /**
-     * method from ActionListener
-     *
-     * @param event
-     *            that occurred
-     */
-    public void actionPerformed(ActionEvent event) {
-        if (event.getSource() == useProperties) {
-        }
-    }
-
-    /**
      * When the state of a widget changes, it will notify the gui. the method
      * then enables or disables certain parameters.
      */
     public void stateChanged(ChangeEvent event) {
         if (event.getSource() == useProperties) {
-            if (useProperties.isSelected()) {
-                this.jndiICF.setEnabled(false);
-                this.urlField.setEnabled(false);
-            } else {
-                this.jndiICF.setEnabled(true);
-                this.urlField.setEnabled(true);
-            }
+            jndiICF.setEnabled(!useProperties.isSelected());
+            urlField.setEnabled(!useProperties.isSelected());
+        } else if (event.getSource() == useAuth) {
+            jmsUser.setEnabled(!useAuth.isSelected());
+            jmsPwd.setEnabled(!useAuth.isSelected());
         }
     }
 }
\ No newline at end of file

Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/jmspublisher.png
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/jmspublisher.png?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/xdocs/images/screenshots/jmssubscriber.png
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/jmssubscriber.png?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
Binary files - no diff available.

Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=957326&r1=957325&r2=957326&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Wed Jun 23 20:03:49 2010
@@ -1130,7 +1130,7 @@ For details, see <complink name="BSF Sam
 </properties>
 </component>
 
-<component name="JMS Publisher" index="&sect-num;.1.13"  width="513" height="742" screenshot="jmspublisher.png">
+<component name="JMS Publisher" index="&sect-num;.1.13"  width="459" height="662" screenshot="jmspublisher.png">
 <note>BETA CODE - the code is still subject to change</note>
 	<description>
 		<p>
@@ -1179,7 +1179,7 @@ This is a very simple implementation; it
 </p>
 </component>
 
-<component name="JMS Subscriber" index="&sect-num;.1.14"  width="513" height="441" screenshot="jmssubscriber.png">
+<component name="JMS Subscriber" index="&sect-num;.1.14"  width="527" height="411" screenshot="jmssubscriber.png">
 <note>BETA CODE - the code is still subject to change</note>
 	<description>
 		<p>



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org