// Plot the times of the total times components
int currPreviousPts = 2;
if (resultList != null) {
for (int i = 0; i < resultList.length; i++) {
SampleResult componentRes = resultList[i];
if (log.isDebugEnabled()) {
log.debug("drawSample1 : componentRes - " + componentRes.getSampleLabel() + " loading time - "
+ componentRes.getTime());
}
data = (int) (componentRes.getTime() * d.height / model.getMax());
data += lastLevel;
currColor = ColorHelper.changeColorCyclicIncrement(currColor, 100);
g.setColor(currColor);
if (!previousPtsAlloc) {
// If first dot, just draw the point
g.drawLine(x % width, d.height - data, x % width, d.height - data - 1);
} else {
// Otherwise, draw from previous point
g.drawLine((previousPts[currPreviousPts].x) % width, previousPts[currPreviousPts].y, x % width,
d.height - data);
}
// Store the current plot
previousPts[currPreviousPts++] = new Point(x % width, d.height - data);
if (noLegendYet) {
gbc.gridx = 0;
gbc.gridy = compCount++;
gbc.anchor = GridBagConstraints.WEST;
gbc.weightx = 1.0;
gbc.insets = new Insets(0, 10, 0, 0);
JLabel compTimeLabel = new JLabel(componentRes.getSampleLabel());
compTimeLabel.setForeground(currColor);
gridBag.setConstraints(compTimeLabel, gbc);
legendPanel.add(compTimeLabel);
}