Example usage for org.jfree.chart.plot FastScatterPlot setPaint

List of usage examples for org.jfree.chart.plot FastScatterPlot setPaint

Introduction

In this page you can find the example usage for org.jfree.chart.plot FastScatterPlot setPaint.

Prototype

public void setPaint(Paint paint) 

Source Link

Document

Sets the color for the data points and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:org.fhcrc.cpl.viewer.gui.ProteinMatcherFrame.java

protected void showPredictedHydroTimePlot() {
    //clone because we're sorting
    Feature[] regressionMS2FeatureArray = _regressionMS2Features.getFeatures().clone();
    Arrays.sort(regressionMS2FeatureArray, new Feature.ScanAscComparator());
    int numQualifyingFeatures = 0;
    for (int i = 0; i < regressionMS2FeatureArray.length; i++) {
        if (MS2ExtraInfoDef.getPeptideProphet(regressionMS2FeatureArray[i]) >= minPeptideProphet)
            numQualifyingFeatures++;//from  w ww .  j a va2 s.  c om
    }
    float[][] scatterPlotData = new float[2][numQualifyingFeatures];
    int[] sortedScanArray = new int[numQualifyingFeatures];
    int arrayIndex = 0;
    for (int i = 0; i < regressionMS2FeatureArray.length; i++) {
        if (MS2ExtraInfoDef.getPeptideProphet(regressionMS2FeatureArray[i]) >= minPeptideProphet) {
            Feature ms2Feature = regressionMS2FeatureArray[i];
            scatterPlotData[0][arrayIndex] = (float) AmtUtilities
                    .calculateNormalizedHydrophobicity(MS2ExtraInfoDef.getFirstPeptide(ms2Feature));
            //                scatterPlotData[1][arrayIndex] = ms2Feature.getScan();
            sortedScanArray[arrayIndex] = ms2Feature.getScan();
            arrayIndex++;
        }
    }
    MSRun run = (MSRun) ApplicationContext.getProperty(SharedProperties.MS_RUN);
    double[] timesArrayTemp = AmtUtilities.getTimesForSortedScanArray(run, sortedScanArray);
    float[] timesArray = new float[timesArrayTemp.length];
    for (int i = 0; i < timesArrayTemp.length; i++)
        timesArray[i] = (float) timesArrayTemp[i];
    scatterPlotData[1] = timesArray;

    FastScatterPlot scatterPlot = new FastScatterPlot(scatterPlotData,
            new NumberAxis(TextProvider.getText("CALCULATED_HYDROPHOBICITY")),
            new NumberAxis(TextProvider.getText("TIME")));
    scatterPlot.setPaint(Color.BLUE);
    scatterPlot.setOutlineStroke(new BasicStroke(10));
    ChartDialog chartDialog = new ChartDialog(scatterPlot);
    chartDialog.setLocation(getLocation());
    chartDialog.setVisible(true);
}