/*
* AidaCloudAdapter2D.java
*
* Created on March 8, 2001, 11:08 AM
*/
package hep.aida.ref.plotter.adapter;
import hep.aida.ICloud2D;
import hep.aida.IHistogram2D;
import hep.aida.ref.histogram.Cloud2D;
import hep.aida.ref.histogram.HistUtils;
import jas.hist.DataSource;
import jas.hist.HasScatterPlotData;
import jas.hist.HasStatistics;
import jas.hist.HasStyle;
import jas.hist.JASHistScatterPlotStyle;
import jas.hist.JASHistStyle;
import jas.hist.Rebinnable2DHistogramData;
import jas.hist.ScatterEnumeration;
import jas.hist.Statistics;
/**
*
* @author manj
* @version $Id: AIDACloudAdapter2D.java 13402 2007-11-02 21:19:21Z serbo $
*/
public class AIDACloudAdapter2D extends AIDACloudAdapter implements Rebinnable2DHistogramData, HasScatterPlotData, HasStatistics, HasStyle
{
public AIDACloudAdapter2D(ICloud2D cloud)
{
super(cloud);
this.cloud=cloud;
xBins=50;
yBins=50;
String tmp = null;
try {
tmp = cloud.annotation().value("xAxisType");
if (tmp != null && tmp.equalsIgnoreCase("date")) xAxisType = DataSource.DATE;
} catch (IllegalArgumentException e) {}
try {
tmp = cloud.annotation().value("yAxisType");
if (tmp != null && tmp.equalsIgnoreCase("date")) xAxisType = DataSource.DATE;
} catch (IllegalArgumentException e) {}
style = new JASHistScatterPlotStyle();
}
public double[][][] rebin(int xbins, double xmin, double xmax,
int ybins, double ymin, double ymax,
boolean wantErrors, boolean hurry, boolean overflow)
{
setValid();
IHistogram2D histo;
if(isRebinnable()) histo=HistUtils.toShowableHistogram(cloud,xbins,xmin,xmax,ybins,ymin,ymax);
else histo=cloud.histogram();
double[][][] data=new double [2][histo.xAxis().bins()][histo.yAxis().bins()];
for(int i=0;i
Ads help maintain this website.