if (dataSet instanceof ScanDataSet) {
ScanDataSet scanDataSet = (ScanDataSet) dataSet;
Scan scan = scanDataSet.getScan();
if (scan.isCentroided())
newRenderer = new PeakRenderer(color, transparency);
else {
newRenderer = new ContinuousRenderer(color, transparency);
((ContinuousRenderer) newRenderer)
.setBaseShapesVisible(dataPointsVisible);
}
// Add label generator for the dataset
SpectraItemLabelGenerator labelGenerator = new SpectraItemLabelGenerator(
this);
newRenderer.setBaseItemLabelGenerator(labelGenerator);
newRenderer.setBaseItemLabelsVisible(itemLabelsVisible);
newRenderer.setBaseItemLabelPaint(labelsColor);
} else {
newRenderer = new PeakRenderer(color, transparency);
}
plot.setDataset(numOfDataSets, dataSet);
plot.setRenderer(numOfDataSets, newRenderer);
numOfDataSets++;