use of net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraItemLabelGenerator in project mzmine2 by mzmine.
the class SpectraPlot method removeDataPointProcessingResultDataSets.
public synchronized void removeDataPointProcessingResultDataSets() {
for (int i = 0; i < plot.getDatasetCount(); i++) {
XYDataset dataSet = plot.getDataset(i);
if (dataSet instanceof DPPResultsDataSet) {
plot.setDataset(i, null);
}
}
// when adding DPPResultDataSet the label generator is overwritten, revert here
SpectraItemLabelGenerator labelGenerator = new SpectraItemLabelGenerator(this);
plot.getRenderer().setDefaultItemLabelGenerator(labelGenerator);
}
use of net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraItemLabelGenerator in project mzmine2 by mzmine.
the class SpectraPlot method setPlotMode.
/**
* This will set either centroid or continuous renderer to the first data set, assuming that
* dataset with index 0 contains the raw data.
*/
public void setPlotMode(MassSpectrumType plotMode) {
this.plotMode = plotMode;
XYDataset dataSet = plot.getDataset(0);
if (!(dataSet instanceof ScanDataSet))
return;
XYItemRenderer newRenderer;
if (plotMode == MassSpectrumType.CENTROIDED) {
newRenderer = new PeakRenderer(SpectraVisualizerWindow.scanColor, false);
} else {
newRenderer = new ContinuousRenderer(SpectraVisualizerWindow.scanColor, false);
((ContinuousRenderer) newRenderer).setDefaultShapesVisible(dataPointsVisible);
}
// Add label generator for the dataset
SpectraItemLabelGenerator labelGenerator = new SpectraItemLabelGenerator(this);
newRenderer.setDefaultItemLabelGenerator(labelGenerator);
newRenderer.setDefaultItemLabelsVisible(itemLabelsVisible);
newRenderer.setDefaultItemLabelPaint(labelsColor);
plot.setRenderer(0, newRenderer);
}
use of net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraItemLabelGenerator in project mzmine2 by mzmine.
the class SpectraPlot method addDataSet.
public synchronized void addDataSet(XYDataset dataSet, Color color, boolean transparency) {
XYItemRenderer newRenderer;
if (dataSet instanceof ScanDataSet) {
ScanDataSet scanDataSet = (ScanDataSet) dataSet;
Scan scan = scanDataSet.getScan();
if (scan.getSpectrumType() == MassSpectrumType.CENTROIDED)
newRenderer = new PeakRenderer(color, transparency);
else {
newRenderer = new ContinuousRenderer(color, transparency);
((ContinuousRenderer) newRenderer).setDefaultShapesVisible(dataPointsVisible);
}
// Add label generator for the dataset
SpectraItemLabelGenerator labelGenerator = new SpectraItemLabelGenerator(this);
newRenderer.setDefaultItemLabelGenerator(labelGenerator);
newRenderer.setDefaultItemLabelsVisible(itemLabelsVisible);
newRenderer.setDefaultItemLabelPaint(labelsColor);
} else {
newRenderer = new PeakRenderer(color, transparency);
}
plot.setDataset(numOfDataSets, dataSet);
plot.setRenderer(numOfDataSets, newRenderer);
numOfDataSets++;
if (dataSet instanceof ScanDataSet)
checkAndRunController();
}
Aggregations