in src/components/src/main/java/org/apache/jmeter/visualizers/RespTimeGraphVisualizer.java [510:567]
public void actionPerformed(ActionEvent event) {
boolean forceReloadData = false;
final Object eventSource = event.getSource();
if (eventSource == displayButton) {
actionMakeGraph();
} else if (eventSource == saveGraph) {
saveGraphToFile = true;
try {
ActionRouter.getInstance().getAction(
ActionNames.SAVE_GRAPHICS,SaveGraphics.class.getName()).doAction(
new ActionEvent(this,event.getID(),ActionNames.SAVE_GRAPHICS));
} catch (Exception e) {
log.error(e.getMessage());
}
} else if (eventSource == syncWithName) {
graphTitle.setText(getName());
} else if (eventSource == dynamicGraphSize) {
enableDynamicGraph(dynamicGraphSize.isSelected());
} else if (eventSource == samplerSelection) {
enableSamplerSelection(samplerSelection.isSelected());
if (!samplerSelection.isSelected()) {
// Force reload data
forceReloadData = true;
}
}
// Not 'else if' because forceReloadData
if (eventSource == applyFilterBtn || eventSource == intervalButton || forceReloadData) {
if (eventSource == intervalButton) {
intervalValue = Integer.parseInt(intervalField.getText());
}
if (eventSource == applyFilterBtn && samplerSelection.isSelected() && samplerMatchLabel.getText() != null
&& samplerMatchLabel.getText().length() > 0) {
pattern = createPattern(samplerMatchLabel.getText());
} else if (forceReloadData) {
pattern = null;
}
if (getFile() != null && getFile().length() > 0) {
// Reload data from file
clearData();
FilePanel filePanel = (FilePanel) getFilePanel();
filePanel.actionPerformed(event);
} else {
// Reload data form internal list of results
synchronized (lockInterval) {
if (internalList.size() >= 2) {
List<RespTimeGraphDataBean> tempList = new ArrayList<>();
tempList.addAll(internalList);
this.clearData();
for (RespTimeGraphDataBean data : tempList) {
SampleResult sr = new SampleResult(data.getStartTime(), data.getTime());
sr.setSampleLabel(data.getSamplerLabel());
this.add(sr);
}
}
}
}
}
}