com.ijchart.xychart.client
Class IJChart

java.lang.Object
  extended by com.ijchart.xychart.client.IJChart
All Implemented Interfaces:
IPlotChangeListener, ITitleChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class IJChart
extends java.lang.Object
implements ITitleChangeListener, IPlotChangeListener, java.io.Serializable, java.lang.Cloneable

Title: IJChart

Description: a chart library for the Java(tm) platform.

This class used to draw charts.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static float DEFAULT_BACKGROUND_ALPHA
           The default foreground alpha transparency.
static java.awt.Image DEFAULT_BACKGROUND_IMAGE
           The default background image.
static Align DEFAULT_BACKGROUND_IMAGE_ALIGNMENT
           The default background image alignment.
static float DEFAULT_BACKGROUND_IMAGE_ALPHA
           The default background image alpha.
static java.awt.Paint DEFAULT_BACKGROUND_PAINT
           The default background color.
static boolean DEFAULT_BORDER_VISIBLE
           A default flag that controls whether or not the chart border is drawn.
static GradientPaintTransformType DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE
           The defeault GradientPaint transform type.
static boolean DEFAULT_NOTIFY
           A default flag that can be used to enable/disable notification of chart change events.
static java.awt.Font DEFAULT_TITLE_FONT
           The default font for titles.
 
Constructor Summary
IJChart(AbstractPlot plot)
           Creates a new chart based on the supplied plot.
IJChart(java.lang.String title, AbstractPlot plot)
           Creates a new chart with the given title and plot.
IJChart(java.lang.String title, java.awt.Font titleFont, AbstractPlot plot, boolean createLegend)
           Creates a new chart with the given title and plot.
 
Method Summary
 void addChangeListener(IChartChangeListener listener)
           Registers an object for notification of changes to the chart.
 void addProgressListener(IChartProgressListener listener)
           Registers an object for notification of progress events relating to the chart.
 void addSubtitle(int index, ITitle subtitle)
           Adds a subtitle at a particular position in the subtitle list, and sends a ChartChangeEvent to all registered listeners.
 void addSubtitle(ITitle subtitle)
           Adds a chart subtitle, and notifies registered listeners that the chart has been modified.
 void clearSubtitles()
           Clears all subtitles from the chart and sends a ChartChangeEvent to all registered listeners.
 java.lang.Object clone()
           Clones the object, and takes care of listeners.
 java.awt.image.BufferedImage createBufferedImage(int imageWidth, int imageHeight)
           Creates and returns a buffered image into which the chart has been drawn.
 java.awt.image.BufferedImage createBufferedImage(int imageWidth, int imageHeight, double drawWidth, double drawHeight)
           Creates and returns a buffered image into which the chart has been drawn.
 java.awt.image.BufferedImage createBufferedImage(int imageWidth, int imageHeight, double drawWidth, double drawHeight, int imageType)
           Creates and returns a buffered image into which the chart has been drawn.
 java.awt.image.BufferedImage createBufferedImage(int imageWidth, int imageHeight, int imageType)
           Creates and returns a buffered image into which the chart has been drawn.
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea)
           Draws the chart on a Java 2D graphics device (such as the screen or a printer).
protected  void drawBackground(java.awt.geom.Rectangle2D chartArea)
           Fills the specified area with the background paint.
protected  void drawBackgroundImage(java.awt.geom.Rectangle2D chartArea)
           Draws the background image (if there is one) aligned within the specified area.
protected  void drawBorder(java.awt.geom.Rectangle2D chartArea)
           Draws the chart border.
 boolean drawCrosshair(java.awt.geom.Point2D mouseClickPoint)
           Draws the crosshair on a Java 2D graphics device (such as the screen or a printer).
protected  void drawLengend(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea)
           Draws the legend on a Java 2D graphics device (such as the screen or a printer).
protected  void drawTitles(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D chartArea)
           Draws the titles on a Java 2D graphics device (such as the screen or a printer).
 boolean equals(java.lang.Object obj)
          Tests this chart for equality with another object.
 void fireChartChanged()
           Sends a default ChartChangeEvent to all registered listeners.
 float getBackgroundAlpha()
           Returns the alpha transparency of the plot area background.
 java.awt.Image getBackgroundImage()
           Returns the background image for the chart.
 Align getBackgroundImageAlignment()
           Returns the background image alignment.
 float getBackgroundImageAlpha()
           Returns the alpha-transparency for the chart's background image.
 java.awt.Paint getBackgroundPaint()
           Returns the paint used to draw the background of the chart.
 java.awt.Paint getBorderPaint()
           Returns the paint used to draw the chart border (if visible).
 java.awt.Stroke getBorderStroke()
           Returns the stroke used to draw the chart border (if visible).
 IChangeChartShape getChangeChartShape()
           Returns the shape change object.
 ChartShapeCollection getChartShapes()
           Returns the collection of chart shapes.
 GradientPaintTransformType getGradientPaintTransformType()
           Get the ChartShape GradientPaintTransformType type.
 LegendTitle getLegendTitle()
           Returns the chart legend title.
 RectangleInsets getPadding()
           Returns the padding between the chart border and the chart drawing area.
 AbstractPlot getPlot()
           Returns the plot for the chart.
 ITitle getSubtitle(int index)
           Returns a chart subtitle.
 int getSubtitleCount()
           Returns the number of titles for the chart.
 java.util.Collection getSubtitles()
           Returns the list of subtitles for the chart,and this collection is unmodifiable.
 ITitle getTitle()
           Returns the main chart title.
 int hashCode()
           Returns a hash code for this object.
 boolean isBorderVisible()
           Returns a flag that controls whether or not a border is drawn around the outside of the chart.
 boolean isNotify()
           Returns a flag that controls whether or not change events are sent to registered listeners.
 boolean isShowLegend()
           Returns whether or not the legend is visible.
protected  void notifyListeners(ChartChangeEvent event)
           Sends a ChartChangeEvent to all registered listeners.
 void notifyListeners(ChartProgressEvent event)
           Sends a ChartProgressEvent to all registered listeners.
 void plotChanged(PlotChangeEvent event)
           Receives notification of a plot change event.
 void removeAllProgressListener()
           Deregisters all object for notification of progress changes.
 void removeAllSubTitle()
           Removes all subtitle and sends a ChartChangeEvent to all registered listeners.
 void removeChangeListener(IChartChangeListener listener)
           Deregisters an object for notification of changes to the chart.
 void removeProgressListener(IChartProgressListener listener)
           Deregisters an object for notification of changes to the chart.
 void removeSubTitle(ITitle title)
           Removes the specified subtitle and sends a ChartChangeEvent to all registered listeners.
 void saveChartAsJPEG(java.io.File imageFile, int width, int height)
           Save chart to JPEG image.
 void saveChartAsJPEG(java.io.OutputStream stream, int width, int height)
           Save chart to JPEG image.
 void saveChartAsJPEG(java.lang.String filePath, int width, int height)
           Save chart to JPEG image.
 void saveChartAsPNG(java.io.File imageFile, int width, int height)
           Save chart to PNG image.
 void saveChartAsPNG(java.io.OutputStream stream, int width, int height)
           Save chart to PNG image.
 void saveChartAsPNG(java.lang.String filePath, int width, int height)
           Save chart to PNG image.
 void setBackgroundAlpha(float alpha)
           Sets the alpha transparency of the plot area background, and notifies registered listeners that the plot has been modified.
 void setBackgroundImage(java.awt.Image image)
           Sets the background image for the chart and sends a ChartChangeEvent to all registered listeners.
 void setBackgroundImageAlignment(Align alignment)
           Sets the background alignment.
 void setBackgroundImageAlpha(float alpha)
           Sets the alpha-transparency for the chart's background image.
 void setBackgroundPaint(java.awt.Paint paint)
           Sets the paint used to fill the chart background and sends a ChartChangeEvent to all registered listeners.
 void setBorderPaint(java.awt.Paint paint)
           Sets the paint used to draw the chart border (if visible),and sends a ChartChangeEvent to all registered listeners.
 void setBorderStroke(java.awt.Stroke stroke)
           Sets the stroke used to draw the chart border (if visible),and sends a ChartChangeEvent to all registered listeners.
 void setBorderVisible(boolean visible)
           Sets a flag that controls whether or not a border is drawn around the outside of the chart,and sends a ChartChangeEvent to all registered listeners.
 void setChangeChartShape(IChangeChartShape change)
           Sets the shape change object,and notifies registered listeners that the plot has been modified.
 void setGradientPaintTransformType(GradientPaintTransformType transformType)
           Sets the ChartShape GradientPaintTransformType type,use only when fill Paint is GradientPaint,and sends a ChartShapeChangeEvent to all registered listeners.
 void setLegendTitle(LegendTitle legend)
           Sets the chart legend title, and notifies registered listeners that the chart has been modified.
 void setNotify(boolean notify)
           Sets a flag that controls whether or not listeners receive ChartChangeEvent notifications.
 void setPadding(RectangleInsets padding)
           Sets the padding between the chart border and the chart drawing area, and sends a ChartChangeEvent to all registered listeners.
 void setShowLegend(boolean flag)
           Sets whether or not the legend is visible,and sends a ChartChangeEvent to all registered listeners.
 void setTitle(ITitle title)
           Sets the main title for the chart and sends a ChartChangeEvent to all registered listeners.
 void setTitle(java.lang.String text)
           Sets the chart title and sends a ChartChangeEvent to all registered listeners.
 void titleChanged(TitleChangeEvent event)
           Receives notification of a chart title change event.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TITLE_FONT

public static final java.awt.Font DEFAULT_TITLE_FONT
The default font for titles.


DEFAULT_BACKGROUND_PAINT

public static final java.awt.Paint DEFAULT_BACKGROUND_PAINT
The default background color.


DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE

public static final GradientPaintTransformType DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE
The defeault GradientPaint transform type.


DEFAULT_BACKGROUND_IMAGE

public static final java.awt.Image DEFAULT_BACKGROUND_IMAGE
The default background image.


DEFAULT_BACKGROUND_IMAGE_ALIGNMENT

public static final Align DEFAULT_BACKGROUND_IMAGE_ALIGNMENT
The default background image alignment.


DEFAULT_BACKGROUND_IMAGE_ALPHA

public static final float DEFAULT_BACKGROUND_IMAGE_ALPHA
The default background image alpha.

See Also:
Constant Field Values

DEFAULT_NOTIFY

public static final boolean DEFAULT_NOTIFY
A default flag that can be used to enable/disable notification of chart change events.

See Also:
Constant Field Values

DEFAULT_BORDER_VISIBLE

public static final boolean DEFAULT_BORDER_VISIBLE
A default flag that controls whether or not the chart border is drawn.

See Also:
Constant Field Values

DEFAULT_BACKGROUND_ALPHA

public static final float DEFAULT_BACKGROUND_ALPHA
The default foreground alpha transparency.

See Also:
Constant Field Values
Constructor Detail

IJChart

public IJChart(AbstractPlot plot)
Creates a new chart based on the supplied plot. The chart will have a legend added automatically, but no title (although you can easily add one later).

Parameters:
plot - AbstractPlot The plot (null not permitted).

IJChart

public IJChart(java.lang.String title,
               AbstractPlot plot)
Creates a new chart with the given title and plot. A default font (@link DEFAULT_TITLE_FONT) is used for the title, and the chart will have a legend added automatically.

Parameters:
title - String The chart title (null permitted).
plot - AbstractPlot The plot (null not permitted).

IJChart

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

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

isBorderVisible

public boolean isBorderVisible()
Returns a flag that controls whether or not a border is drawn around the outside of the chart.

Returns:
boolean A boolean.

setBorderVisible

public void setBorderVisible(boolean visible)
Sets a flag that controls whether or not a border is drawn around the outside of the chart,and sends a ChartChangeEvent to all registered listeners.

Parameters:
visible - boolean A boolean.

getBorderStroke

public java.awt.Stroke getBorderStroke()
Returns the stroke used to draw the chart border (if visible).

Returns:
Stroke The border stroke (never null).

setBorderStroke

public void setBorderStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the chart border (if visible),and sends a ChartChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke (null not permitted).

getBorderPaint

public java.awt.Paint getBorderPaint()
Returns the paint used to draw the chart border (if visible).

Returns:
Paint The border paint (never null).

setBorderPaint

public void setBorderPaint(java.awt.Paint paint)
Sets the paint used to draw the chart border (if visible),and sends a ChartChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (null not permitted).

getPadding

public RectangleInsets getPadding()
Returns the padding between the chart border and the chart drawing area.

Returns:
RectangleInsets The padding (never null).

setPadding

public void setPadding(RectangleInsets padding)
Sets the padding between the chart border and the chart drawing area, and sends a ChartChangeEvent to all registered listeners.

Parameters:
padding - RectangleInsets The padding (null not permitted).

getTitle

public ITitle getTitle()
Returns the main chart title. Very often a chart will have just one title, so we make this case simple by providing accessor methods for the main title. However, multiple titles are supported - see the addSubtitle(ITitle) method.

Returns:
ITitle The chart title (possibly null).

setTitle

public void setTitle(ITitle 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. If you want more than one title on a chart, use the addSubtitle(ITitle) method.

Parameters:
title - ITitle The title (null permitted).

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

addSubtitle

public void addSubtitle(ITitle subtitle)
Adds a chart subtitle, and notifies registered listeners that the chart has been modified.

Parameters:
subtitle - ITitle The subtitle (null not permitted).

getSubtitle

public ITitle getSubtitle(int index)
Returns a chart subtitle.

Parameters:
index - int The index of the chart subtitle (zero based).
Returns:
ITitle A chart subtitle.

addSubtitle

public void addSubtitle(int index,
                        ITitle subtitle)
Adds a subtitle at a particular position in the subtitle list, and sends a ChartChangeEvent to all registered listeners.

Parameters:
index - int The index (in the range 0 to getSubtitleCount()).
subtitle - ITitle The subtitle to add (null not permitted).

clearSubtitles

public void clearSubtitles()
Clears all subtitles from the chart and sends a ChartChangeEvent to all registered listeners.


removeSubTitle

public void removeSubTitle(ITitle title)
Removes the specified subtitle and sends a ChartChangeEvent to all registered listeners.

Parameters:
title - ITitle The subtitle.

removeAllSubTitle

public void removeAllSubTitle()
Removes all subtitle and sends a ChartChangeEvent to all registered listeners.


getSubtitles

public java.util.Collection getSubtitles()
Returns the list of subtitles for the chart,and this collection is unmodifiable.

Returns:
Collection The subtitle list (possibly empty, but never null).

getSubtitleCount

public int getSubtitleCount()
Returns the number of titles for the chart.

Returns:
int The number of titles for the chart.

getLegendTitle

public LegendTitle getLegendTitle()
Returns the chart legend title.

Returns:
LegendTitle The chart legend title.

setLegendTitle

public void setLegendTitle(LegendTitle legend)
Sets the chart legend title, and notifies registered listeners that the chart has been modified.

Parameters:
legend - LegendTitle The legend title (null not permitted).

isShowLegend

public boolean isShowLegend()
Returns whether or not the legend is visible.

Returns:
boolean A boolean.

setShowLegend

public void setShowLegend(boolean flag)
Sets whether or not the legend is visible,and sends a ChartChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getPlot

public AbstractPlot getPlot()
Returns the plot for the chart. The plot is a class responsible for coordinating the visual representation of the data, including the axes (if any).

Returns:
AbstractPlot The plot.

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Returns the paint used to draw the background of the chart.

Returns:
Paint The paint (possibly null).

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint paint)
Sets the paint used to fill the chart background and sends a ChartChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (possibly null).

getGradientPaintTransformType

public GradientPaintTransformType getGradientPaintTransformType()
Get the ChartShape GradientPaintTransformType type.

Returns:
GradientPaintTransformType

setGradientPaintTransformType

public void setGradientPaintTransformType(GradientPaintTransformType transformType)
Sets the ChartShape GradientPaintTransformType type,use only when fill Paint is GradientPaint,and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
transformType - GradientPaintTransformType The gradient paint transform type (null permitted).

getBackgroundAlpha

public float getBackgroundAlpha()
Returns the alpha transparency of the plot area background.

Returns:
The alpha transparency.

setBackgroundAlpha

public void setBackgroundAlpha(float alpha)
Sets the alpha transparency of the plot area background, and notifies registered listeners that the plot has been modified.

Parameters:
alpha - The new alpha value (in the range 0.0f to 1.0f).

getBackgroundImage

public java.awt.Image getBackgroundImage()
Returns the background image for the chart.

Returns:
Image The image (possibly null).

setBackgroundImage

public void setBackgroundImage(java.awt.Image image)
Sets the background image for the chart and sends a ChartChangeEvent to all registered listeners.

Parameters:
image - Image The image (null permitted).

getBackgroundImageAlignment

public Align getBackgroundImageAlignment()
Returns the background image alignment. Alignment constants are defined in the Align class.

Returns:
Align The alignment.

setBackgroundImageAlignment

public void setBackgroundImageAlignment(Align alignment)
Sets the background alignment. Alignment options are defined by the Align class.

Parameters:
alignment - Align The alignment.

getBackgroundImageAlpha

public float getBackgroundImageAlpha()
Returns the alpha-transparency for the chart's background image.

Returns:
float The alpha-transparency for background image.

setBackgroundImageAlpha

public void setBackgroundImageAlpha(float alpha)
Sets the alpha-transparency for the chart's background image. Registered listeners are notified that the chart has been changed.

Parameters:
alpha - float The alpha-transparency for background image,must between 0.0 and 1.0 .

isNotify

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

Returns:
boolean A boolean.

setNotify

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

Parameters:
notify - boolean A boolean.

getChartShapes

public ChartShapeCollection getChartShapes()
Returns the collection of chart shapes.

Returns:
ChartShapeCollection The collection of chart shapes (never null).

getChangeChartShape

public IChangeChartShape getChangeChartShape()
Returns the shape change object.

Returns:
IChangeChartShape The shape change object (maybe null).

setChangeChartShape

public void setChangeChartShape(IChangeChartShape change)
Sets the shape change object,and notifies registered listeners that the plot has been modified.

Parameters:
change - IChangeChartShape The shape change object.

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D chartArea)
Draws the chart on a Java 2D graphics device (such as the screen or a printer).

Parameters:
g2 - Graphics2D The graphics device (null not permitted).
chartArea - Rectangle2D The area within which the data should be drawn (null not permitted).

drawCrosshair

public boolean drawCrosshair(java.awt.geom.Point2D mouseClickPoint)
Draws the crosshair on a Java 2D graphics device (such as the screen or a printer).

Parameters:
mouseClickPoint - Point2D The mouse click point (null permitted).
Returns:
boolean Returns whether or not crosshair is changed.

drawBackground

protected void drawBackground(java.awt.geom.Rectangle2D chartArea)
Fills the specified area with the background paint. If the background paint is an instance of GradientPaint, the gradient will run in the direction suggested by the plot's orientation.

Parameters:
chartArea - The background draw area (null not permitted).

drawBackgroundImage

protected void drawBackgroundImage(java.awt.geom.Rectangle2D chartArea)
Draws the background image (if there is one) aligned within the specified area.

Parameters:
chartArea - The background draw area (null not permitted).

drawBorder

protected void drawBorder(java.awt.geom.Rectangle2D chartArea)
Draws the chart border.

Parameters:
chartArea - The background draw area (null not permitted).

drawTitles

protected void drawTitles(java.awt.Graphics2D g2,
                          java.awt.geom.Rectangle2D chartArea)
Draws the titles on a Java 2D graphics device (such as the screen or a printer).

Parameters:
g2 - Graphics2D The graphics device (null not permitted).
chartArea - Rectangle2D The area within which the data should be drawn (null not permitted).

drawLengend

protected void drawLengend(java.awt.Graphics2D g2,
                           java.awt.geom.Rectangle2D chartArea)
Draws the legend on a Java 2D graphics device (such as the screen or a printer).

Parameters:
g2 - Graphics2D The graphics device (null not permitted).
chartArea - Rectangle2D The area within which the data should be drawn (null not permitted).

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int imageWidth,
                                                        int imageHeight)
Creates and returns a buffered image into which the chart has been drawn.

Parameters:
imageWidth - int The image width.
imageHeight - int The image height.
Returns:
Image A image (never null).

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int imageWidth,
                                                        int imageHeight,
                                                        int imageType)
Creates and returns a buffered image into which the chart has been drawn.

Parameters:
imageWidth - int The image width.
imageHeight - int The image height.
imageType - int The image type.
Returns:
Image A image (never null).

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int imageWidth,
                                                        int imageHeight,
                                                        double drawWidth,
                                                        double drawHeight)
Creates and returns a buffered image into which the chart has been drawn.

Parameters:
imageWidth - int The image width.
imageHeight - int The image height.
drawWidth - int The width for drawing the chart (will be scaled to fit image).
drawHeight - int The height for drawing the chart (will be scaled to fit image).
Returns:
Image A image (never null).

createBufferedImage

public java.awt.image.BufferedImage createBufferedImage(int imageWidth,
                                                        int imageHeight,
                                                        double drawWidth,
                                                        double drawHeight,
                                                        int imageType)
Creates and returns a buffered image into which the chart has been drawn.

Parameters:
imageWidth - int The image width.
imageHeight - int The image height.
drawWidth - int The width for drawing the chart (will be scaled to fit image).
drawHeight - int The height for drawing the chart (will be scaled to fit image).
imageType - int The image type.
Returns:
Image A image (never null).

addChangeListener

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

Parameters:
listener - IChartChangeListener The listener (null not permitted).

removeChangeListener

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

Parameters:
listener - IChartChangeListener The listener (null not permitted).

fireChartChanged

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


notifyListeners

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

Parameters:
event - ChartChangeEvent Information about the event that triggered the notification.

addProgressListener

public void addProgressListener(IChartProgressListener listener)
Registers an object for notification of progress events relating to the chart.

Parameters:
listener - IChartProgressListener The object being registered (null not permitted).

removeProgressListener

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

Parameters:
listener - IChartProgressListener The object being deregistered (null not permitted).

removeAllProgressListener

public void removeAllProgressListener()
Deregisters all object for notification of progress changes.


notifyListeners

public void notifyListeners(ChartProgressEvent event)
Sends a ChartProgressEvent to all registered listeners.

Parameters:
event - ChartProgressEvent Information about the event that triggered the notification.

titleChanged

public void titleChanged(TitleChangeEvent event)
Receives notification of a chart title change event.

Specified by:
titleChanged in interface ITitleChangeListener
Parameters:
event - TitleChangeEvent The title change event.

plotChanged

public void plotChanged(PlotChangeEvent event)
Receives notification of a plot change event.

Specified by:
plotChanged in interface IPlotChangeListener
Parameters:
event - PlotChangeEvent The plot change event.

saveChartAsJPEG

public void saveChartAsJPEG(java.lang.String filePath,
                            int width,
                            int height)
                     throws java.io.IOException
Save chart to JPEG image.

Parameters:
filePath - String The image file path (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

saveChartAsJPEG

public void saveChartAsJPEG(java.io.OutputStream stream,
                            int width,
                            int height)
                     throws java.io.IOException
Save chart to JPEG image.

Parameters:
stream - OutputStream An OutputStream to be written to (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

saveChartAsJPEG

public void saveChartAsJPEG(java.io.File imageFile,
                            int width,
                            int height)
                     throws java.io.IOException
Save chart to JPEG image.

Parameters:
imageFile - File The image file (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

saveChartAsPNG

public void saveChartAsPNG(java.lang.String filePath,
                           int width,
                           int height)
                    throws java.io.IOException
Save chart to PNG image.

Parameters:
filePath - String The image file path (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

saveChartAsPNG

public void saveChartAsPNG(java.io.OutputStream stream,
                           int width,
                           int height)
                    throws java.io.IOException
Save chart to PNG image.

Parameters:
stream - OutputStream An OutputStream to be written to (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

saveChartAsPNG

public void saveChartAsPNG(java.io.File imageFile,
                           int width,
                           int height)
                    throws java.io.IOException
Save chart to PNG image.

Parameters:
imageFile - File The image file (null not permitted).
width - int The image width.
height - int The image height.
Throws:
java.io.IOException

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.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the object, and takes care of listeners.

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