khammond 01/10/02 06:01:18
Modified: src/org/apache/jmeter/visualizers AssertionVisualizer.java
Log:
Added license text. New GUI style.
Revision Changes Path
1.2 +149 -60
jakarta-jmeter/src/org/apache/jmeter/visualizers/AssertionVisualizer.java
Index: AssertionVisualizer.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/org/apache/jmeter/visualizers/AssertionVisualizer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AssertionVisualizer.java 2001/08/16 23:36:57 1.1
+++ AssertionVisualizer.java 2001/10/02 13:01:18 1.2
@@ -1,60 +1,149 @@
-package org.apache.jmeter.visualizers;
-
-import java.awt.*;
-import javax.swing.*;
-
-import org.apache.jmeter.gui.ModelSupported;
-import org.apache.jmeter.reporters.AssertionReporter;
-import org.apache.jmeter.samplers.Clearable;
-
-/************************************************************
- * Title: Jakarta-JMeter Description: Copyright: Copyright (c) 2001 Company:
- * Apache
- *
- *@author Michael Stover
- *@created $Date: 2001/08/16 23:36:57 $
- *@version 1.0
- ***********************************************************/
-
-public class AssertionVisualizer extends JPanel implements ModelSupported,Clearable
-{
-
- AssertionReporter model;
- private JTextArea display;
-
- /************************************************************
- * !ToDo (Constructor description)
- ***********************************************************/
- public AssertionVisualizer()
- {
- }
-
- public void setModel(Object model)
- {
- this.model = (AssertionReporter)model;
- this.model.setListener(this);
- init();
- }
-
- private void init()
- {
- display = new JTextArea();
- this.setLayout(new GridLayout(1,1));
- this.add(display);
- }
-
- public void updateGui()
- {
- model.next();
- display.append(model.getSampleLabel());
- display.append(model.getAssertionResult());
- display.append("\n");
- }
-
- public void clear()
- {
- display.setText("");
- }
-
-
-}
+/*
+ * ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2001 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" and
+ * "Apache JMeter" must not be used to endorse or promote products
+ * derived from this software without prior written permission. For
+ * written permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * "Apache JMeter", nor may "Apache" appear in their name, without
+ * prior written permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+
+package org.apache.jmeter.visualizers;
+
+import java.awt.*;
+import javax.swing.*;
+import javax.swing.border.*;
+
+import org.apache.jmeter.gui.ModelSupported;
+import org.apache.jmeter.reporters.AssertionReporter;
+import org.apache.jmeter.samplers.Clearable;
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jmeter.gui.*;
+
+/************************************************************
+ * Title: Jakarta-JMeter Description: Copyright: Copyright (c) 2001 Company:
+ * Apache
+ *
+ *@author Michael Stover
+ *@created $Date: 2001/10/02 13:01:18 $
+ *@version 1.0
+ ***********************************************************/
+
+public class AssertionVisualizer extends JPanel implements ModelSupported,Clearable
+{
+ AssertionReporter model;
+
+ private JTextArea textArea;
+ private NamePanel namePanel;
+
+ /************************************************************
+ * !ToDo (Constructor description)
+ ***********************************************************/
+ public AssertionVisualizer()
+ {
+ }
+
+ public void setModel(Object model)
+ {
+ this.model = (AssertionReporter)model;
+ this.model.setListener(this);
+ init();
+ }
+
+ private void init()
+ {
+ this.setLayout(new VerticalLayout(5, VerticalLayout.LEFT,
VerticalLayout.TOP));
+
+ // 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(JMeterUtils.getResString("assertion_visualizer_title"));
+ Font curFont = panelTitleLabel.getFont();
+ int curFontSize = curFont.getSize();
+ curFontSize += 4;
+ panelTitleLabel.setFont(new Font(curFont.getFontName(),
curFont.getStyle(), curFontSize));
+ mainPanel.add(panelTitleLabel);
+
+ // NAME
+ namePanel = new NamePanel(model);
+ mainPanel.add(namePanel);
+
+ // TEXTAREA LABEL
+ JLabel textAreaLabel = new
JLabel(JMeterUtils.getResString("assertion_textarea_label"));
+ mainPanel.add(textAreaLabel);
+
+ // TEXTAREA
+ textArea = new JTextArea(10, 40);
+ textArea.setEditable(false);
+ textArea.setLineWrap(false);
+ JScrollPane areaScrollPane = new JScrollPane(textArea);
+
areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+
areaScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+ //areaScrollPane.setPreferredSize(new Dimension(250, 250));
+ mainPanel.add(areaScrollPane);
+
+ this.add(mainPanel);
+ }
+
+ public void updateGui()
+ {
+ model.next();
+ textArea.append(model.getSampleLabel());
+ textArea.append(model.getAssertionResult());
+ textArea.append("\n");
+ }
+
+ public void clear()
+ {
+ textArea.setText("");
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]