jas.hist.util
Class TwoDSliceAdapter

java.lang.Object
  |
  +--java.util.Observable
        |
        +--jas.hist.util.ObserverAdapter
              |
              +--jas.hist.util.TwoDAdapter
                    |
                    +--jas.hist.util.ScatterAdapter
                          |
                          +--jas.hist.util.TwoDSliceAdapter
All Implemented Interfaces:
DataSource, HasScatterPlotData, HasSlices, HasStatistics, HasStyle, java.util.Observer, Rebinnable2DHistogramData, SliceAdapter
Direct Known Subclasses:
ScatterSliceAdapter

public class TwoDSliceAdapter
extends ScatterAdapter
implements HasSlices, SliceAdapter

A Two2SliceAdapter can be used to convert any Rebinnable2DHistogramData object to a Rebinnable2DHistogramData which also implements HasSlices


Field Summary
protected  java.util.Vector slices
           
 
Fields inherited from class jas.hist.util.ScatterAdapter
scatter
 
Fields inherited from class jas.hist.util.TwoDAdapter
source
 
Fields inherited from interface jas.hist.DataSource
DATE, DELTATIME, DOUBLE, INTEGER, STRING
 
Constructor Summary
TwoDSliceAdapter(Rebinnable2DHistogramData source)
           
 
Method Summary
 int addSlice(double x, double y, double width, double height, double phi)
          Create a new slice with the specified initial parameters
 void addSliceListener(SliceListener l)
           
 boolean canAddRemoveSlices()
           
protected  void fireSliceAdded(int index)
           
protected  void fireSliceRemoved(int index)
           
 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.
 void removeSlice(int n)
          Remove a slice from the source
 void removeSliceListener(SliceListener l)
           
 
Methods inherited from class jas.hist.util.ScatterAdapter
hasScatterPlotData, startEnumeration, startEnumeration
 
Methods inherited from class jas.hist.util.TwoDAdapter
getStatistics, getStyle, getTitle, getXAxisLabels, getXAxisType, getXBins, getXMax, getXMin, getYAxisLabels, getYAxisType, getYBins, getYMax, getYMin, isRebinnable, rebin, toString
 
Methods inherited from class jas.hist.util.ObserverAdapter
addObserver, clearObservable, deleteObserver, deleteObservers, setObservable, update
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jas.hist.Rebinnable2DHistogramData
getXAxisLabels, getXAxisType, getXBins, getXMax, getXMin, getYAxisLabels, getYAxisType, getYBins, getYMax, getYMin, isRebinnable, rebin
 
Methods inherited from interface jas.hist.DataSource
getTitle
 

Field Detail

slices

protected java.util.Vector slices
Constructor Detail

TwoDSliceAdapter

public TwoDSliceAdapter(Rebinnable2DHistogramData source)
Method Detail

addSliceListener

public void addSliceListener(SliceListener l)
Specified by:
addSliceListener in interface SliceAdapter

removeSliceListener

public void removeSliceListener(SliceListener l)
Specified by:
removeSliceListener in interface SliceAdapter

fireSliceAdded

protected void fireSliceAdded(int index)

fireSliceRemoved

protected void fireSliceRemoved(int index)

getNSlices

public int getNSlices()
Description copied from interface: HasSlices
Number of slices currently attached to plot
Specified by:
getNSlices in interface HasSlices
Overrides:
getNSlices in class TwoDAdapter

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
Overrides:
getSliceParameters in class TwoDAdapter
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
Overrides:
getSlice in class TwoDAdapter
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
Overrides:
canAddRemoveSlices in class TwoDAdapter

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
Overrides:
addSlice in class TwoDAdapter
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
Overrides:
removeSlice in class TwoDAdapter
Following copied from interface: jas.hist.HasSlices
Parameters:
n - The index of the slice