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; |
115 |
|
111 |
/** |
116 |
/** |
112 |
* Constructor |
117 |
* Constructor |
113 |
*/ |
118 |
*/ |
Lines 144-149
Link Here
|
144 |
if (root.getChildCount() == 1) { |
149 |
if (root.getChildCount() == 1) { |
145 |
jTree.expandPath(new TreePath(root)); |
150 |
jTree.expandPath(new TreePath(root)); |
146 |
} |
151 |
} |
|
|
152 |
if (autoScrollCB.isSelected() && root.getChildCount() > 1) |
153 |
{ |
154 |
jTree.scrollRowToVisible(root.getChildCount()-1); |
155 |
} |
147 |
} |
156 |
} |
148 |
|
157 |
|
149 |
private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) { |
158 |
private void addSubResults(DefaultMutableTreeNode currNode, SampleResult res) { |
Lines 252-274
Link Here
|
252 |
jTree.addTreeSelectionListener(this); |
261 |
jTree.addTreeSelectionListener(this); |
253 |
jTree.setRootVisible(false); |
262 |
jTree.setRootVisible(false); |
254 |
jTree.setShowsRootHandles(true); |
263 |
jTree.setShowsRootHandles(true); |
255 |
|
|
|
256 |
JScrollPane treePane = new JScrollPane(jTree); |
264 |
JScrollPane treePane = new JScrollPane(jTree); |
257 |
treePane.setPreferredSize(new Dimension(200, 300)); |
265 |
treePane.setPreferredSize(new Dimension(200, 300)); |
258 |
|
266 |
|
259 |
VerticalPanel leftPane = new VerticalPanel(); |
267 |
VerticalPanel leftPane = new VerticalPanel(); |
260 |
leftPane.add(treePane, BorderLayout.CENTER); |
268 |
leftPane.add(treePane, BorderLayout.CENTER); |
261 |
leftPane.add(createComboRender(), BorderLayout.SOUTH); |
269 |
|
262 |
|
270 |
VerticalPanel leftDownPane = new VerticalPanel(); |
|
|
271 |
leftDownPane.add(createComboRender(), BorderLayout.NORTH); |
272 |
autoScrollCB = createASCheckBox("view_results_autoscroll", Color.BLACK); |
273 |
leftDownPane.add(autoScrollCB, BorderLayout.SOUTH); |
274 |
leftPane.add(leftDownPane, BorderLayout.SOUTH); |
263 |
return leftPane; |
275 |
return leftPane; |
264 |
} |
276 |
} |
265 |
|
277 |
|
266 |
/** |
278 |
/** |
|
|
279 |
* Create auto scroll checkbox |
280 |
* @param labelResourceName |
281 |
* @param color |
282 |
* @return {@link JCheckBox} |
283 |
*/ |
284 |
private JCheckBox createASCheckBox(String labelResourceName, Color color) { |
285 |
JCheckBox checkBox = new JCheckBox(JMeterUtils.getResString(labelResourceName)); |
286 |
checkBox.setSelected(false); |
287 |
checkBox.addItemListener(this); |
288 |
checkBox.setForeground(color); |
289 |
return checkBox; |
290 |
} |
291 |
|
292 |
/** |
267 |
* Create the drop-down list to changer render |
293 |
* Create the drop-down list to changer render |
268 |
* @return List of all render (implement ResultsRender) |
294 |
* @return List of all render (implement ResultsRender) |
269 |
*/ |
295 |
*/ |
270 |
private Component createComboRender() { |
296 |
private Component createComboRender() { |
271 |
ComboBoxModel nodesModel = new DefaultComboBoxModel(); |
297 |
ComboBoxModel nodesModel = new DefaultComboBoxModel(); |
|
|
298 |
|
272 |
// drop-down list for renderer |
299 |
// drop-down list for renderer |
273 |
selectRenderPanel = new JComboBox(nodesModel); |
300 |
selectRenderPanel = new JComboBox(nodesModel); |
274 |
selectRenderPanel.setActionCommand(COMBO_CHANGE_COMMAND); |
301 |
selectRenderPanel.setActionCommand(COMBO_CHANGE_COMMAND); |
Lines 379-382
Link Here
|
379 |
} |
406 |
} |
380 |
} |
407 |
} |
381 |
|
408 |
|
|
|
409 |
/** |
410 |
* Handler for Checkbox |
411 |
*/ |
412 |
public void itemStateChanged(ItemEvent e) { |
413 |
// NOOP state is held by component |
414 |
} |
415 |
|
382 |
} |
416 |
} |