anl.aida.plot
Class ScatterGroupDataset

java.lang.Object
  extended by org.jfree.data.general.AbstractDataset
      extended by anl.aida.plot.ScatterGroupDataset
All Implemented Interfaces:
java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, org.jfree.data.general.Dataset, org.jfree.data.general.SeriesDataset, org.jfree.data.xy.XYDataset

public class ScatterGroupDataset
extends org.jfree.data.general.AbstractDataset
implements org.jfree.data.xy.XYDataset

Dataset appropriate for a scatter plot. Each series has two frames. The xValue is the value from one frame and the yValue from another. Each frame provides a single point per group / category axis value in that frame.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Nested Class Summary
private static class ScatterGroupDataset.SeriesData
           
 
Field Summary
private  java.util.List<ScatterGroupDataset.SeriesData> series
           
private  int timestep
           
private  anl.aida.data.DataFrame xFrame
           
private  anl.aida.data.DataFrame yFrame
           
 
Constructor Summary
ScatterGroupDataset(anl.aida.data.DataFrame xFrame, anl.aida.data.DataFrame yFrame)
          Creates a ScatterGroupDataset that will plot the equivalent groups in each frame against each other.
 
Method Summary
 void addSeries(int group)
           
 org.jfree.data.DomainOrder getDomainOrder()
          Returns the order of the domain (or X) values returned by the dataset.
 int getItemCount(int series)
          Returns the number of items in a series.
 int getSeriesCount()
          Returns the number of series in the dataset.
 java.lang.Comparable getSeriesKey(int series)
          Returns the key for a series.
 int getTimeStep()
          Gets the current timestep of this dataset.
private  double getValue(anl.aida.data.DataFrame frame, int group)
           
 java.lang.Number getX(int series, int item)
          Returns the x-value for an item within a series.
 double getXValue(int series, int item)
          Returns the x-value for an item within a series.
 java.lang.Number getY(int series, int item)
          Returns the y-value for an item within a series.
 double getYValue(int series, int item)
          Returns the y-value (as a double primitive) for an item within a series.
 int indexOf(java.lang.Comparable seriesKey)
          Returns the index of the series with the specified key, or -1 if there is no such series in the dataset.
 void setSeriesKey(int series, java.lang.String key)
           
 void setTimeStep(int timestep)
          Sets the current timestep of this dataset.
 
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.data.general.Dataset
addChangeListener, getGroup, removeChangeListener, setGroup
 

Field Detail

xFrame

private anl.aida.data.DataFrame xFrame

yFrame

private anl.aida.data.DataFrame yFrame

series

private java.util.List<ScatterGroupDataset.SeriesData> series

timestep

private int timestep
Constructor Detail

ScatterGroupDataset

public ScatterGroupDataset(anl.aida.data.DataFrame xFrame,
                           anl.aida.data.DataFrame yFrame)
Creates a ScatterGroupDataset that will plot the equivalent groups in each frame against each other.

Parameters:
xFrame -
yFrame -
Method Detail

addSeries

public void addSeries(int group)

getDomainOrder

public org.jfree.data.DomainOrder getDomainOrder()
Returns the order of the domain (or X) values returned by the dataset.

Specified by:
getDomainOrder in interface org.jfree.data.xy.XYDataset
Returns:
The order (never null).

getItemCount

public int getItemCount(int series)
Returns the number of items in a series.

It is recommended that classes that implement this method should throw an IllegalArgumentException if the series argument is outside the specified range.

Specified by:
getItemCount in interface org.jfree.data.xy.XYDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
Returns:
The item count.

getValue

private double getValue(anl.aida.data.DataFrame frame,
                        int group)

getX

public java.lang.Number getX(int series,
                             int item)
Returns the x-value for an item within a series. The x-values may or may not be returned in ascending order, that is up to the class implementing the interface.

Specified by:
getX in interface org.jfree.data.xy.XYDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
item - the item index (in the range 0 to getItemCount(series)).
Returns:
The x-value (never null).

getXValue

public double getXValue(int series,
                        int item)
Returns the x-value for an item within a series.

Specified by:
getXValue in interface org.jfree.data.xy.XYDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
item - the item index (in the range 0 to getItemCount(series)).
Returns:
The x-value.

getY

public java.lang.Number getY(int series,
                             int item)
Returns the y-value for an item within a series.

Specified by:
getY in interface org.jfree.data.xy.XYDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
item - the item index (in the range 0 to getItemCount(series)).
Returns:
The y-value (possibly null).

getYValue

public double getYValue(int series,
                        int item)
Returns the y-value (as a double primitive) for an item within a series.

Specified by:
getYValue in interface org.jfree.data.xy.XYDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
item - the item index (in the range 0 to getItemCount(series)).
Returns:
The y-value.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the dataset.

Specified by:
getSeriesCount in interface org.jfree.data.general.SeriesDataset
Returns:
The series count.

getTimeStep

public int getTimeStep()
Gets the current timestep of this dataset.

Returns:
the current timestep of this dataset.

setTimeStep

public void setTimeStep(int timestep)
Sets the current timestep of this dataset.

Parameters:
timestep - the new timestep

getSeriesKey

public java.lang.Comparable getSeriesKey(int series)
Returns the key for a series.

Specified by:
getSeriesKey in interface org.jfree.data.general.SeriesDataset
Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
Returns:
The key for the series.

setSeriesKey

public void setSeriesKey(int series,
                         java.lang.String key)

indexOf

public int indexOf(java.lang.Comparable seriesKey)
Returns the index of the series with the specified key, or -1 if there is no such series in the dataset.

Specified by:
indexOf in interface org.jfree.data.general.SeriesDataset
Parameters:
seriesKey - the series key (null permitted).
Returns:
The index, or -1.