jas.swingstudio
Class JAS2DRebinAdaptor
java.lang.Object
|
+--java.util.Observable
|
+--jas.swingstudio.JAS2DRebinAdaptor
- All Implemented Interfaces:
- DataSource, HasSlices, HasStatistics, HasStyle, java.util.Observer, Rebinnable2DHistogramData, Statistics
- public class JAS2DRebinAdaptor
- extends java.util.Observable
- implements Rebinnable2DHistogramData, java.util.Observer, HasSlices, HasStyle, HasStatistics, Statistics
Method Summary |
int |
addSlice(double x,
double y,
double width,
double height,
double phi)
Create a new slice with the specified initial parameters |
boolean |
canAddRemoveSlices()
|
int |
getNSlices()
Number of slices currently attached to plot |
Rebinnable1DHistogramData |
getSlice(int n)
Get the data corresponding to the slice. |
SliceParameters |
getSliceParameters(int n)
Get the parameters of a slice. |
double |
getStatistic(java.lang.String name)
|
java.lang.String[] |
getStatisticNames()
|
Statistics |
getStatistics()
|
JASHistStyle |
getStyle()
This method is called by the plot to determine what style to be used for a plot. |
java.lang.String |
getTitle()
Return the caption to be used in the legend for this data. |
java.lang.String[] |
getXAxisLabels()
|
int |
getXAxisType()
|
int |
getXBins()
|
double |
getXMax()
|
double |
getXMin()
|
java.lang.String[] |
getYAxisLabels()
|
int |
getYAxisType()
|
int |
getYBins()
|
double |
getYMax()
|
double |
getYMin()
|
boolean |
isRebinnable()
|
double[][][] |
rebin(int xbins,
double xmin,
double xmax,
int ybins,
double ymin,
double ymax,
boolean wantErrors,
boolean hurry,
boolean overflow)
Fetch binned data from remote data source. |
void |
removeSlice(int n)
Remove a slice from the source |
protected Remote2DHistogramInfo |
setInfo()
|
java.lang.String |
toString()
|
void |
update(java.util.Observable obs,
java.lang.Object arg)
|
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
info
protected Remote2DHistogramInfo info
JAS2DRebinAdaptor
public JAS2DRebinAdaptor(RemoteRebinnable2DHistogramData source,
RMIDestination obs,
RMIEventDelivery ed)
update
public void update(java.util.Observable obs,
java.lang.Object arg)
- Specified by:
update
in interface java.util.Observer
rebin
public double[][][] rebin(int xbins,
double xmin,
double xmax,
int ybins,
double ymin,
double ymax,
boolean wantErrors,
boolean hurry,
boolean overflow)
- Fetch binned data from remote data source. Also caches
result to speed up subsequent requests for the same
binned data.
- Specified by:
rebin
in interface Rebinnable2DHistogramData
getXMin
public double getXMin()
- Specified by:
getXMin
in interface Rebinnable2DHistogramData
getXMax
public double getXMax()
- Specified by:
getXMax
in interface Rebinnable2DHistogramData
getYMin
public double getYMin()
- Specified by:
getYMin
in interface Rebinnable2DHistogramData
getYMax
public double getYMax()
- Specified by:
getYMax
in interface Rebinnable2DHistogramData
getXBins
public int getXBins()
- Specified by:
getXBins
in interface Rebinnable2DHistogramData
getYBins
public int getYBins()
- Specified by:
getYBins
in interface Rebinnable2DHistogramData
getXAxisType
public int getXAxisType()
- Specified by:
getXAxisType
in interface Rebinnable2DHistogramData
getYAxisType
public int getYAxisType()
- Specified by:
getYAxisType
in interface Rebinnable2DHistogramData
getXAxisLabels
public java.lang.String[] getXAxisLabels()
- Specified by:
getXAxisLabels
in interface Rebinnable2DHistogramData
getYAxisLabels
public java.lang.String[] getYAxisLabels()
- Specified by:
getYAxisLabels
in interface Rebinnable2DHistogramData
isRebinnable
public boolean isRebinnable()
- Specified by:
isRebinnable
in interface Rebinnable2DHistogramData
getTitle
public java.lang.String getTitle()
- Description copied from interface:
DataSource
- Return the caption to be used in the legend for this data.
- Specified by:
getTitle
in interface DataSource
setInfo
protected Remote2DHistogramInfo setInfo()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getStatistics
public Statistics getStatistics()
- Specified by:
getStatistics
in interface HasStatistics
getStatisticNames
public java.lang.String[] getStatisticNames()
- Specified by:
getStatisticNames
in interface Statistics
- Following copied from interface:
jas.hist.Statistics
- Returns:
- A list of statistic names
getStatistic
public double getStatistic(java.lang.String name)
- Specified by:
getStatistic
in interface Statistics
- Following copied from interface:
jas.hist.Statistics
- Parameters:
The
- statistic name, as returned by getStatisticNames()- Returns:
- The value for the statistic
getStyle
public JASHistStyle getStyle()
- Description copied from interface:
HasStyle
- This method is called by the plot to determine what style to be used for a plot.
It is the programmers responsibility to return the correct subclass of JASHistStyle
corresponding to the type of data being implemented by the DataSource.
- Specified by:
getStyle
in interface HasStyle
- Following copied from interface:
jas.hist.HasStyle
- Returns:
- The style to be used, or null to use the default style.
- See Also:
JASHist1DHistogramStyle
,
JASHist2DHistogramStyle
,
JASHistScatterPlotStyle
getNSlices
public int getNSlices()
- Description copied from interface:
HasSlices
- Number of slices currently attached to plot
- Specified by:
getNSlices
in interface HasSlices
getSliceParameters
public SliceParameters getSliceParameters(int n)
- Description copied from interface:
HasSlices
- Get the parameters of a slice. The SliceParameters can
subsequently be changed to update the slice.
- Specified by:
getSliceParameters
in interface HasSlices
- Following copied from interface:
jas.hist.HasSlices
- Parameters:
n
- The index of the slice- Returns:
- The Slice parameters of the slice with the specified index
getSlice
public Rebinnable1DHistogramData getSlice(int n)
- Description copied from interface:
HasSlices
- Get the data corresponding to the slice. The data will be observable
and will notify its observers if the slice changes, or the data from
which the slice is derived changes
- Specified by:
getSlice
in interface HasSlices
- Following copied from interface:
jas.hist.HasSlices
- Parameters:
n
- The index of the slice- Returns:
- The data resulting from the slice
canAddRemoveSlices
public boolean canAddRemoveSlices()
- Specified by:
canAddRemoveSlices
in interface HasSlices
addSlice
public int addSlice(double x,
double y,
double width,
double height,
double phi)
- Description copied from interface:
HasSlices
- Create a new slice with the specified initial parameters
- Specified by:
addSlice
in interface HasSlices
- Following copied from interface:
jas.hist.HasSlices
- Returns:
- the index of the slice that was added
removeSlice
public void removeSlice(int n)
- Description copied from interface:
HasSlices
- Remove a slice from the source
- Specified by:
removeSlice
in interface HasSlices
- Following copied from interface:
jas.hist.HasSlices
- Parameters:
n
- The index of the slice