View | Details | Raw Unified | Return to bug 42246
Collapse All | Expand All

(-)src/components/org/apache/jmeter/visualizers/ViewResultsFullVisualizer.java (-7 / +38 lines)
Lines 28-33 Link Here
28
import java.awt.Dimension;
28
import java.awt.Dimension;
29
import java.awt.event.ActionEvent;
29
import java.awt.event.ActionEvent;
30
import java.awt.event.ActionListener;
30
import java.awt.event.ActionListener;
31
import java.awt.event.ItemEvent;
32
import java.awt.event.ItemListener;
31
import java.io.IOException;
33
import java.io.IOException;
32
import java.util.Collections;
34
import java.util.Collections;
33
import java.util.List;
35
import java.util.List;
Lines 35-40 Link Here
35
import javax.swing.ComboBoxModel;
37
import javax.swing.ComboBoxModel;
36
import javax.swing.DefaultComboBoxModel;
38
import javax.swing.DefaultComboBoxModel;
37
import javax.swing.ImageIcon;
39
import javax.swing.ImageIcon;
40
import javax.swing.JCheckBox;
38
import javax.swing.JComboBox;
41
import javax.swing.JComboBox;
39
import javax.swing.JScrollPane;
42
import javax.swing.JScrollPane;
40
import javax.swing.JSplitPane;
43
import javax.swing.JSplitPane;
Lines 62-68 Link Here
62
 *
65
 *
63
 */
66
 */
64
public class ViewResultsFullVisualizer extends AbstractVisualizer
67
public class ViewResultsFullVisualizer extends AbstractVisualizer
65
implements ActionListener, TreeSelectionListener, Clearable {
68
implements ActionListener, TreeSelectionListener, Clearable, ItemListener {
66
69
67
    private static final long serialVersionUID = 7338676747296593842L;
70
    private static final long serialVersionUID = 7338676747296593842L;
68
71
Lines 108-113 Link Here
108
111
109
    private TreeSelectionEvent lastSelectionEvent;
112
    private TreeSelectionEvent lastSelectionEvent;
110
113
114
	private JCheckBox autoScrollCB;
111
    /**
115
    /**
112
     * Constructor
116
     * Constructor
113
     */
117
     */
Lines 144-150 Link Here
144
        if (root.getChildCount() == 1) {
148
        if (root.getChildCount() == 1) {
145
            jTree.expandPath(new TreePath(root));
149
            jTree.expandPath(new TreePath(root));
146
        }
150
        }
147
    }
151
		if (autoScrollCB.isSelected() && root.getChildCount() > 1) {
152
			jTree.scrollRowToVisible(root.getChildCount() - 1);
153
		}
154
	}
148
155
149
    private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) {
156
    private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) {
150
        SampleResult[] subResults = res.getSubResults();
157
        SampleResult[] subResults = res.getSubResults();
Lines 252-268 Link Here
252
        jTree.addTreeSelectionListener(this);
259
        jTree.addTreeSelectionListener(this);
253
        jTree.setRootVisible(false);
260
        jTree.setRootVisible(false);
254
        jTree.setShowsRootHandles(true);
261
        jTree.setShowsRootHandles(true);
255
256
        JScrollPane treePane = new JScrollPane(jTree);
262
        JScrollPane treePane = new JScrollPane(jTree);
257
        treePane.setPreferredSize(new Dimension(200, 300));
263
        treePane.setPreferredSize(new Dimension(200, 300));
258
264
259
        VerticalPanel leftPane = new VerticalPanel();
265
		VerticalPanel leftPane = new VerticalPanel();
260
        leftPane.add(treePane, BorderLayout.CENTER);
266
		leftPane.add(treePane, BorderLayout.CENTER);
261
        leftPane.add(createComboRender(), BorderLayout.SOUTH);
262
267
263
        return leftPane;
268
		VerticalPanel leftDownPane = new VerticalPanel();
269
		leftDownPane.add(createComboRender(), BorderLayout.NORTH);
270
		autoScrollCB = createASCheckBox("view_results_autoscroll", Color.BLACK);
271
		leftDownPane.add(autoScrollCB, BorderLayout.SOUTH);
272
		leftPane.add(leftDownPane, BorderLayout.SOUTH);
273
		return leftPane;
264
    }
274
    }
265
275
276
	/**
277
	 * Create auto scroll checkbox
278
	 * @param labelResourceName
279
	 * @param color
280
	 * @return {@link JCheckBox}
281
	 */
282
	private JCheckBox createASCheckBox(String labelResourceName, Color color) {
283
		JCheckBox checkBox = new JCheckBox(JMeterUtils
284
				.getResString(labelResourceName));
285
		checkBox.setSelected(false);
286
		checkBox.addItemListener(this);
287
		checkBox.setForeground(color);
288
		return checkBox;
289
	}
290
    
266
    /**
291
    /**
267
     * Create the drop-down list to changer render
292
     * Create the drop-down list to changer render
268
     * @return List of all render (implement ResultsRender)
293
     * @return List of all render (implement ResultsRender)
Lines 379-382 Link Here
379
        }
404
        }
380
    }
405
    }
381
406
407
	/**
408
	 * Handler for Checkbox
409
	 */
410
	public void itemStateChanged(ItemEvent e) {
411
		// NOOP state is held by component
412
	}
382
}
413
}
(-)src/components/org/apache/jmeter/visualizers/AssertionVisualizer.java (+1 lines)
Lines 56-61 Link Here
56
        sb.append("\n"); // $NON-NLS-1$
56
        sb.append("\n"); // $NON-NLS-1$
57
        synchronized (textArea) {
57
        synchronized (textArea) {
58
            textArea.append(sb.toString());
58
            textArea.append(sb.toString());
59
			textArea.setCaretPosition(textArea.getText().length());
59
        }
60
        }
60
    }
61
    }
61
62

Return to bug 42246