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 140-150
Link Here
|
140 |
treeModel.insertNodeInto(assertionNode, currNode, assertionIndex++); |
144 |
treeModel.insertNodeInto(assertionNode, currNode, assertionIndex++); |
141 |
} |
145 |
} |
142 |
} |
146 |
} |
143 |
|
|
|
144 |
if (root.getChildCount() == 1) { |
147 |
if (root.getChildCount() == 1) { |
145 |
jTree.expandPath(new TreePath(root)); |
148 |
jTree.expandPath(new TreePath(root)); |
146 |
} |
149 |
} |
147 |
} |
150 |
if (autoScrollCB.isSelected() && root.getChildCount() > 1) { |
|
|
151 |
jTree.scrollRowToVisible(root.getChildCount() - 1); |
152 |
} |
153 |
} |
148 |
|
154 |
|
149 |
private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) { |
155 |
private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) { |
150 |
SampleResult[] subResults = res.getSubResults(); |
156 |
SampleResult[] subResults = res.getSubResults(); |
Lines 252-269
Link Here
|
252 |
jTree.addTreeSelectionListener(this); |
258 |
jTree.addTreeSelectionListener(this); |
253 |
jTree.setRootVisible(false); |
259 |
jTree.setRootVisible(false); |
254 |
jTree.setShowsRootHandles(true); |
260 |
jTree.setShowsRootHandles(true); |
255 |
|
|
|
256 |
JScrollPane treePane = new JScrollPane(jTree); |
261 |
JScrollPane treePane = new JScrollPane(jTree); |
257 |
treePane.setPreferredSize(new Dimension(200, 300)); |
262 |
treePane.setPreferredSize(new Dimension(200, 300)); |
258 |
|
263 |
|
259 |
VerticalPanel leftPane = new VerticalPanel(); |
264 |
VerticalPanel leftPane = new VerticalPanel(); |
260 |
leftPane.add(treePane, BorderLayout.CENTER); |
265 |
leftPane.add(treePane, BorderLayout.CENTER); |
261 |
leftPane.add(createComboRender(), BorderLayout.SOUTH); |
266 |
VerticalPanel leftDownPane = new VerticalPanel(); |
262 |
|
267 |
leftDownPane.add(createComboRender(), BorderLayout.NORTH); |
|
|
268 |
autoScrollCB = createASCheckBox("view_results_autoscroll", Color.BLACK); |
269 |
leftDownPane.add(autoScrollCB, BorderLayout.SOUTH); |
270 |
leftPane.add(leftDownPane, BorderLayout.SOUTH); |
263 |
return leftPane; |
271 |
return leftPane; |
264 |
} |
272 |
} |
265 |
|
273 |
|
266 |
/** |
274 |
/** |
|
|
275 |
* Create auto scroll checkbox |
276 |
* |
277 |
* @param labelResourceName |
278 |
* @param color |
279 |
* @return {@link JCheckBox} |
280 |
*/ |
281 |
private JCheckBox createASCheckBox(String labelResourceName, Color color) { |
282 |
JCheckBox checkBox = new JCheckBox( |
283 |
JMeterUtils.getResString(labelResourceName)); |
284 |
checkBox.setSelected(false); |
285 |
checkBox.addItemListener(this); |
286 |
checkBox.setForeground(color); |
287 |
return checkBox; |
288 |
} |
289 |
|
290 |
/** |
267 |
* Create the drop-down list to changer render |
291 |
* Create the drop-down list to changer render |
268 |
* @return List of all render (implement ResultsRender) |
292 |
* @return List of all render (implement ResultsRender) |
269 |
*/ |
293 |
*/ |
Lines 352-358
Link Here
|
352 |
} |
376 |
} |
353 |
|
377 |
|
354 |
private static class ResultsNodeRenderer extends DefaultTreeCellRenderer { |
378 |
private static class ResultsNodeRenderer extends DefaultTreeCellRenderer { |
355 |
|
|
|
356 |
private static final long serialVersionUID = 4159626601097711565L; |
379 |
private static final long serialVersionUID = 4159626601097711565L; |
357 |
|
380 |
|
358 |
@Override |
381 |
@Override |
Lines 379-382
Link Here
|
379 |
} |
402 |
} |
380 |
} |
403 |
} |
381 |
|
404 |
|
|
|
405 |
/** |
406 |
* Handler for Checkbox |
407 |
*/ |
408 |
public void itemStateChanged(ItemEvent e) { |
409 |
// NOOP state is held by component |
410 |
} |
382 |
} |
411 |
} |