pom.xml 0000644 0001750 0001750 00000003370 11326056641 012610 0 ustar giovanni giovanni
global
org.freehep
8
4.0.0
org.freehep
jas-plotter
2.2.6
JAS(2) Plotter
JAS(2) Plotter
freehep-maven
Maven FreeHEP
http://java.freehep.org/maven2
maven-surefire-plugin
true
org.freehep
freehep-export
2.1.1
test
javax.help
javahelp
2.0.02
provided
xerces
xercesImpl
2.6.2
junit
junit
scm:svn:svn://svn.freehep.org/svn/freehep/tags/jas-plotter-2.2.6
scm:svn:svn://svn.freehep.org/svn/freehep/tags/jas-plotter-2.2.6
src/ 0000755 0001750 0001750 00000000000 11325547132 012056 5 ustar giovanni giovanni src/test/ 0000755 0001750 0001750 00000000000 11325547133 013036 5 ustar giovanni giovanni src/test/java/ 0000755 0001750 0001750 00000000000 11325547132 013756 5 ustar giovanni giovanni src/test/java/jas/ 0000755 0001750 0001750 00000000000 11325547132 014533 5 ustar giovanni giovanni src/test/java/jas/hist/ 0000755 0001750 0001750 00000000000 11325547132 015502 5 ustar giovanni giovanni src/test/java/jas/hist/test/ 0000755 0001750 0001750 00000000000 11325547133 016462 5 ustar giovanni giovanni src/test/java/jas/hist/test/MemoryDataSource.java 0000644 0001750 0001750 00000005055 11325547133 022555 0 ustar giovanni giovanni package jas.hist.test;
import jas.hist.DataSource;
import jas.hist.HasDataSource;
import jas.hist.HasStyle;
import jas.hist.HistogramUpdate;
import jas.hist.JASHist1DHistogramStyle;
import jas.hist.JASHistStyle;
import jas.hist.Rebinnable1DHistogramData;
import jas.hist.Statistics;
import jas.hist.util.ObserverAdapter;
import java.util.Observable;
public class MemoryDataSource extends ObserverAdapter implements
HasDataSource, Rebinnable1DHistogramData, HasStyle
{
private static final HistogramUpdate hdr = new HistogramUpdate(HistogramUpdate.DATA_UPDATE,true);
private static final int SECONDS = 60;
public MemoryDataSource()
{
super(t);
}
public DataSource getDataSource(String param)
{
return this;
}
public double[][] rebin(int nbin, double min, double max, boolean wantErrors, boolean hurry)
{
double[] result = t.getSnapshot();
double[][] r = { result };
return r;
}
public double getMin()
{
return -SECONDS;
}
public double getMax()
{
return 0;
}
public int getBins()
{
return SECONDS;
}
public boolean isRebinnable()
{
return false;
}
public int getAxisType()
{
return Rebinnable1DHistogramData.INTEGER;
}
public String[] getAxisLabels()
{
return null;
}
public Statistics getStatistics()
{
return null;
}
public String getTitle()
{
return "Java Memory Usage";
}
public JASHistStyle getStyle()
{
JASHist1DHistogramStyle style = new JASHist1DHistogramStyle();
style.setShowErrorBars(false);
style.setShowDataPoints(true);
style.setShowLinesBetweenPoints(true);
style.setShowHistogramBars(false);
return style;
}
private static MemoryThread t = new MemoryThread();
private static class MemoryThread extends Observable implements Runnable
{
MemoryThread()
{
bins = new double[SECONDS];
for (int i=0; i=SECONDS) index = 0;
}
setChanged();
notifyObservers(hdr);
thread.sleep(1000);
}
}
catch (InterruptedException x) { }
}
synchronized double[] getSnapshot()
{
double[] result = new double[SECONDS];
int j=0;
for (int i=index; i