edu.ucla.stat.SOCR.motionchart
Class MotionChart

java.lang.Object
  extended by edu.ucla.stat.SOCR.motionchart.MotionChart
All Implemented Interfaces:
java.util.EventListener, org.jfree.chart.event.ChartChangeListener, org.jfree.data.general.DatasetChangeListener

public class MotionChart
extends java.lang.Object
implements org.jfree.data.general.DatasetChangeListener, org.jfree.chart.event.ChartChangeListener

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(org.jfree.chart.event.ChartChangeListener listener)
          Registers an object for notification of changes to the chart.
 void chartChanged(org.jfree.chart.event.ChartChangeEvent event)
          Receives notification of a chart change event.
 java.lang.Object clone()
          Clones the object, and takes care of listeners.
 void datasetChanged(org.jfree.data.general.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.
 org.jfree.chart.JFreeChart getChart()
           
 org.jfree.chart.ChartPanel getChartPanel()
           
 MotionDataSet getDataset()
           
 org.jfree.chart.plot.XYPlot getPlot()
           
 MotionBubbleRenderer getRenderer()
           
 org.jfree.chart.title.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(org.jfree.chart.event.ChartChangeEvent event)
          Sends a ChartChangeEvent to all registered listeners.
 void removeChangeListener(org.jfree.chart.event.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(java.lang.String text)
          Sets the chart title and sends a ChartChangeEvent to all registered listeners.
 void setTitle(org.jfree.chart.title.TextTitle title)
          Sets the main title for the chart and sends a 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 org.jfree.chart.JFreeChart getChart()

getChartPanel

public org.jfree.chart.ChartPanel getChartPanel()

getRenderer

public MotionBubbleRenderer getRenderer()

getDataset

public MotionDataSet getDataset()

getPlot

public org.jfree.chart.plot.XYPlot getPlot()

getTitle

public org.jfree.chart.title.TextTitle getTitle()
Returns the main chart title.

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

setTitle

public void setTitle(org.jfree.chart.title.TextTitle title)
Sets the main title for the chart and sends a 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()

setTitle

public void setTitle(java.lang.String text)
Sets the chart title and sends a ChartChangeEvent to all registered listeners. This is a convenience method that ends up calling the setTitle(TextTitle) method. If there is an existing title, its text is updated, otherwise a new title using the default font is added to the chart. If text is null the chart title is set to null.

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

datasetChanged

public void datasetChanged(org.jfree.data.general.DatasetChangeEvent event)
Receives notification of an dataset change event.

Specified by:
datasetChanged in interface org.jfree.data.general.DatasetChangeListener
Parameters:
event - information about the event.

chartChanged

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

Specified by:
chartChanged in interface org.jfree.chart.event.ChartChangeListener
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(org.jfree.chart.event.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(org.jfree.chart.event.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(org.jfree.chart.event.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.