Example usage for org.jfree.chart.renderer GrayPaintScale GrayPaintScale

List of usage examples for org.jfree.chart.renderer GrayPaintScale GrayPaintScale

Introduction

In this page you can find the example usage for org.jfree.chart.renderer GrayPaintScale GrayPaintScale.

Prototype

public GrayPaintScale() 

Source Link

Document

Creates a new GrayPaintScale instance with default values.

Usage

From source file:org.glotaran.core.datadisplayers.multispec.MultiSpecEditorTopComponent.java

private void updateImagePlot(double minAmp, double maxAmp) {
    PaintScale ps;// w  w w.  j  av  a 2s  .  com
    switch (jcbColorScale.getSelectedIndex()) {
    case 0: {
        ps = new RainbowPaintScale(minAmp, maxAmp);
        break;
    }
    case 1: {
        ps = new RedGreenPaintScale(data.getMinInt(), data.getMaxInt());
        break;
    }
    case 2: {
        ps = new GrayPaintScale();
        break;
    }
    default: {
        ps = new RainbowPaintScale(minAmp, maxAmp);
        break;
    }
    }

    //        PaintScale ps = new RedGreenPaintScale(data.getMinInt(), data.getMaxInt());

    BufferedImage image = ImageUtilities.createColorCodedImage(dataset, ps, false, true);
    XYDataImageAnnotation ann = new XYDataImageAnnotation(image, 0, 0, dataset.GetImageWidth(),
            dataset.GetImageHeigth(), true);

    XYPlot plot = (XYPlot) chartMultiSpec.getPlot();
    plot.getRenderer().removeAnnotations();
    plot.getRenderer().addAnnotation(ann, Layer.BACKGROUND);

    ((PaintScaleLegend) chartMultiSpec.getSubtitle(0)).setScale(ps);
    ((PaintScaleLegend) chartMultiSpec.getSubtitle(0)).getAxis().setRange(minAmp, maxAmp);

}