edu.ucla.stat.SOCR.motionchart
Class MotionChart

java.lang.Object
  extended by edu.ucla.stat.SOCR.motionchart.MotionChart

public class MotionChart
extends java.lang.Object

Package: edu.ucla.stat.SOCR.motionchart User: Khashim Date: Sep 15, 2008 Time: 2:58:23 PM

Author:
Jameel

Constructor Summary
MotionChart(MotionDataSet dataset)
          Creates a new chart based on the supplied dataset.
MotionChart(java.lang.String title, java.awt.Font titleFont, MotionDataSet dataset, boolean createLegend)
          Creates a new chart with the given title and dataset.
MotionChart(java.lang.String title, MotionDataSet dataset)
          Creates a new chart with the given title and dataset.
 
Method Summary
 void addChangeListener(ChartChangeListener listener)
          Registers an object for notification of changes to the chart.
 void chartChanged(ChartChangeEvent event)
          Receives notification of a chart change event.
 java.lang.Object clone()
          Clones the object, and takes care of listeners.
 void datasetChanged(DatasetChangeEvent event)
          Receives notification of an dataset change event.
 boolean equals(java.lang.Object obj)
          Tests this chart for equality with another object.
 void fireChartChanged()
          Sends a default ChartChangeEvent to all registered listeners.
 JFreeChart getChart()
           
 ChartPanel getChartPanel()
           
 MotionDataSet getDataset()
           
 XYPlot getPlot()
           
 MotionBubbleRenderer getRenderer()
           
 TextTitle getTitle()
          Returns the main chart title.
 boolean isNotify()
          Returns a flag that controls whether or not change events are sent to registered listeners.
protected  void notifyListeners(ChartChangeEvent event)
          Sends a ChartChangeEvent to all registered listeners.
 void removeChangeListener(ChartChangeListener listener)
          Deregisters an object for notification of changes to the chart.
 void setNotify(boolean notify)
          Sets a flag that controls whether or not listeners receive ChartChangeEvent notifications.
 void setTitle(TextTitle title)
          Sets the main title for the chart and sends a org.jfree.chart.event.ChartChangeEvent to all registered listeners.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MotionChart

public MotionChart(MotionDataSet dataset)
Creates a new chart based on the supplied dataset. The chart will have a default title of "Motion Chart". A default font is used for the title, and the chart will not have a legend.

Parameters:
dataset - the dataset (null not permitted).

MotionChart

public MotionChart(java.lang.String title,
                   MotionDataSet dataset)
Creates a new chart with the given title and dataset. A default font is used for the title, and the chart will not have a legend added automatically.

Parameters:
title - the chart title (null permitted).
dataset - the dataset (null not permitted).

MotionChart

public MotionChart(java.lang.String title,
                   java.awt.Font titleFont,
                   MotionDataSet dataset,
                   boolean createLegend)
Creates a new chart with the given title and dataset. The createLegend argument specifies whether or not a legend should be added to the chart.

Parameters:
title - the chart title (null permitted).
titleFont - the font for displaying the chart title (null permitted).
dataset - the dataset (null not permitted).
createLegend - a flag indicating whether or not a legend should be created for the chart.
Method Detail

getChart

public JFreeChart getChart()

getChartPanel

public ChartPanel getChartPanel()

getRenderer

public MotionBubbleRenderer getRenderer()

getDataset

public MotionDataSet getDataset()

getPlot

public XYPlot getPlot()

getTitle

public TextTitle getTitle()
Returns the main chart title.

Returns:
The chart title (possibly null).
See Also:
setTitle(TextTitle)

setTitle

public void setTitle(TextTitle title)
Sets the main title for the chart and sends a org.jfree.chart.event.ChartChangeEvent to all registered listeners. If you do not want a title for the chart, set it to null.

Parameters:
title - the title (null permitted).
See Also:
getTitle()

datasetChanged

public void datasetChanged(DatasetChangeEvent event)
Receives notification of an dataset change event.

Parameters:
event - information about the event.

chartChanged

public void chartChanged(ChartChangeEvent event)
Receives notification of a chart change event.

Parameters:
event - the event.

isNotify

public boolean isNotify()
Returns a flag that controls whether or not change events are sent to registered listeners.

Returns:
A boolean.
See Also:
setNotify(boolean)

setNotify

public void setNotify(boolean notify)
Sets a flag that controls whether or not listeners receive ChartChangeEvent notifications.

Parameters:
notify - a boolean.
See Also:
isNotify()

addChangeListener

public void addChangeListener(ChartChangeListener listener)
Registers an object for notification of changes to the chart.

Parameters:
listener - the listener (null not permitted).
See Also:
removeChangeListener(ChartChangeListener)

removeChangeListener

public void removeChangeListener(ChartChangeListener listener)
Deregisters an object for notification of changes to the chart.

Parameters:
listener - the listener (null not permitted)
See Also:
addChangeListener(ChartChangeListener)

fireChartChanged

public void fireChartChanged()
Sends a default ChartChangeEvent to all registered listeners.

This method is for convenience only.


notifyListeners

protected void notifyListeners(ChartChangeEvent event)
Sends a ChartChangeEvent to all registered listeners.

Parameters:
event - information about the event that triggered the notification.

equals

public boolean equals(java.lang.Object obj)
Tests this chart for equality with another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the object, and takes care of listeners. Note: caller shall register its own listeners on cloned graph.

Overrides:
clone in class java.lang.Object
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if the chart is not cloneable.