edu.ucla.stat.SOCR.motionchart
Class MotionDataSet

java.lang.Object
  extended by AbstractXYZDataset
      extended by edu.ucla.stat.SOCR.motionchart.MotionDataSet
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TableModelListener

public class MotionDataSet
extends AbstractXYZDataset
implements javax.swing.event.TableModelListener

Package: edu.ucla.stat.SOCR.motionchart User: Khashim Date: Dec 1, 2008 Time: 10:43:13 PM

Author:
Jameel

Nested Class Summary
protected  class MotionDataSet.DateConverter
           
protected  class MotionDataSet.DoubleConverter
           
protected static interface MotionDataSet.DoubleValue<T>
           
protected  class MotionDataSet.StringConverter
           
 
Field Summary
protected static ColorMap colorMap
           
protected static java.awt.image.ColorModel colorModel
           
protected  MotionKey[] keys
           
protected  java.util.TreeSet[] mappingKeys
           
protected  java.util.HashMap[] mappings
           
protected  MotionTableModel mtmodel
           
protected static float SIZE_MULTIPLIER
           
 
Constructor Summary
MotionDataSet(MotionTableModel model)
          Creates a new MotionDataSet instance.
 
Method Summary
protected  void calculateSizeDivisor()
           
 java.lang.Object getCategory(int series, int item)
          Returns the category for the specified item in the series.
 java.lang.String getCategoryLabel()
          Returns the category label for the dataset.
 java.awt.Color getColor(int series, int item)
          Returns the color for the specified item in the series.
 java.lang.String getColorLabel()
          Returns the color label for the dataset.
protected  java.lang.Object getItem(int series, int item, java.lang.Integer col)
          Returns the column item for the specified item in the series.
 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.
 java.lang.Number getSize(int series, int item)
          Returns the size for the specified item in the series.
 java.lang.String getSizeLabel()
          Returns the size label for the dataset.
protected  double getSizeOffset()
           
 MotionTableModel getTableModel()
          Returns the table model for the dataset.
 java.lang.Number getX(int series, int item)
          Returns the x-value for an item within a series.
 java.lang.String getXLabel()
          Returns the x-axis label for the dataset.
 double getXValue(int series, int item)
          Returns the x-value (as a double primitive) for an item within a series.
 java.lang.Number getY(int series, int item)
          Returns the y-value for an item within a series.
 java.lang.String getYLabel()
          Returns the y-axis label for the dataset.
 double getYValue(int series, int item)
          Returns the y-value (as a double primitive) for an item within a series.
 java.lang.Number getZ(int series, int item)
          Returns the z-value for the specified series and item.
 java.lang.String getZLabel()
          Returns the z-axis label for the dataset.
 double getZValue(int series, int item)
          Returns the z-value (as a double primitive) for an item within a series.
protected  void setKeys()
           
protected  void setMappingKeys()
           
protected  void setMappingKeys(int index, int column)
           
protected  void setStringMapping(int index, int column)
           
 void tableChanged(javax.swing.event.TableModelEvent e)
          This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mtmodel

protected MotionTableModel mtmodel

keys

protected MotionKey[] keys

mappingKeys

protected java.util.TreeSet[] mappingKeys

mappings

protected java.util.HashMap[] mappings

colorMap

protected static final ColorMap colorMap

colorModel

protected static final java.awt.image.ColorModel colorModel

SIZE_MULTIPLIER

protected static final float SIZE_MULTIPLIER
See Also:
Constant Field Values
Constructor Detail

MotionDataSet

public MotionDataSet(MotionTableModel model)
Creates a new MotionDataSet instance.

Parameters:
model - the table model of type MotionTableModel
Method Detail

setKeys

protected void setKeys()

setMappingKeys

protected void setMappingKeys()

setMappingKeys

protected void setMappingKeys(int index,
                              int column)

setStringMapping

protected void setStringMapping(int index,
                                int column)

getSeriesCount

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

Returns:
The series count.

getSeriesKey

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

If series is not within the specified range, the implementing method should throw an IndexOutOfBoundsException (preferred) or an IllegalArgumentException.

Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
Returns:
The series key.

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.

Parameters:
series - the series index (in the range 0 to getSeriesCount() - 1).
Returns:
The item count.

getXValue

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

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The value.

getYValue

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

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The value.

getZValue

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

Parameters:
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
The z-value.

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.

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 (possibly null).

getY

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

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).

getZ

public java.lang.Number getZ(int series,
                             int item)
Returns the z-value for the specified series and item.

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The z-value (possibly null).

getSize

public java.lang.Number getSize(int series,
                                int item)
Returns the size for the specified item in the series. This method defaults to calling getZ(series, item).

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The size (possibly null).

calculateSizeDivisor

protected void calculateSizeDivisor()

getSizeOffset

protected double getSizeOffset()

getColor

public java.awt.Color getColor(int series,
                               int item)
Returns the color for the specified item in the series.

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The color (possibly null).

getCategory

public java.lang.Object getCategory(int series,
                                    int item)
Returns the category for the specified item in the series.

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The category (possibly null).

getXLabel

public java.lang.String getXLabel()
Returns the x-axis label for the dataset.

Returns:
The x-axis label (possibly null).

getYLabel

public java.lang.String getYLabel()
Returns the y-axis label for the dataset.

Returns:
The y-axis label (possibly null).

getZLabel

public java.lang.String getZLabel()
Returns the z-axis label for the dataset.

Returns:
The z-axis label (possibly null).

getSizeLabel

public java.lang.String getSizeLabel()
Returns the size label for the dataset. This method defaults to calling getZLabel().

Returns:
The size label (possibly null).

getColorLabel

public java.lang.String getColorLabel()
Returns the color label for the dataset.

Returns:
The color label (possibly null).

getCategoryLabel

public java.lang.String getCategoryLabel()
Returns the category label for the dataset.

Returns:
The category label (possibly null).

getTableModel

public MotionTableModel getTableModel()
Returns the table model for the dataset.

Returns:
The table model (never null).

getItem

protected java.lang.Object getItem(int series,
                                   int item,
                                   java.lang.Integer col)
Returns the column item for the specified item in the series.

Parameters:
series - the series index (zero-based).
item - the item index (zero-based).
col - the column index (zero-based).
Returns:
The item (possibly null).

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed.

Specified by:
tableChanged in interface javax.swing.event.TableModelListener