Example usage for org.jfree.chart.renderer.xy XYBlockRenderer setDefaultEntityRadius

List of usage examples for org.jfree.chart.renderer.xy XYBlockRenderer setDefaultEntityRadius

Introduction

In this page you can find the example usage for org.jfree.chart.renderer.xy XYBlockRenderer setDefaultEntityRadius.

Prototype

public void setDefaultEntityRadius(int radius) 

Source Link

Document

Sets the radius of the circle used for the default entity area when no area is specified.

Usage

From source file:net.sf.maltcms.chromaui.chromatogram1Dviewer.ui.Chromatogram1DHeatmapViewTopComponent.java

private XYPlot createPlot(ADataset2D<IChromatogram1D, IScan> ds) {
    XYBlockRenderer xybr = new XYBlockRenderer();
    IPaintScaleProvider ips = Lookup.getDefault().lookup(IPaintScaleProvider.class);
    ips.setMin(ds.getMinZ());/*from  ww w.j  a v a 2 s .com*/
    ips.setMax(ds.getMaxZ());
    PaintScale ps = ips.getPaintScales().get(0);
    xybr.setPaintScale(ps);
    xybr.setDefaultEntityRadius(5);
    xybr.setBlockWidth(0.1);
    xybr.setBlockAnchor(RectangleAnchor.CENTER);
    xybr.setBlockHeight(1.0);
    RTUnit rtUnit = RTUnit.SECONDS;
    xybr.setToolTipGenerator(
            new StandardXYZToolTipGenerator("{0}: @({1}, {2}) = {3}", DecimalFormat.getNumberInstance(),
                    DecimalFormat.getNumberInstance(), DecimalFormat.getNumberInstance()));
    NumberAxis rt1 = new NumberAxis("Retention Time [" + rtUnit.name().toLowerCase() + "]");
    NumberAxis rt2 = new NumberAxis("M/Z");
    rt1.setAutoRange(false);
    rt1.setLowerBound(ds.getMinX());
    rt1.setUpperBound(ds.getMaxX());
    rt1.setRangeWithMargins(ds.getMinX(), ds.getMaxX());
    rt2.setFixedAutoRange(ds.getMaxX() - ds.getMinX());
    rt2.setAutoRange(false);
    rt2.setLowerBound(ds.getMinY());
    rt2.setUpperBound(ds.getMaxY());
    rt2.setFixedAutoRange(ds.getMaxY() - ds.getMinY());
    rt2.setRangeWithMargins(ds.getMinY(), ds.getMaxY());
    XYPlot heatmapPlot = new XYPlot(ds, rt1, rt2, xybr);
    heatmapPlot.setDomainPannable(true);
    heatmapPlot.setRangePannable(true);
    return heatmapPlot;
}