net.sf.clichart.main
Class DefaultChartGenerator

java.lang.Object
  extended by net.sf.clichart.main.DefaultChartGenerator
All Implemented Interfaces:
ChartGenerator

public class DefaultChartGenerator
extends java.lang.Object
implements ChartGenerator

Default implementation of the ChartGenerator

Author:
johnd

Constructor Summary
DefaultChartGenerator()
           
 
Method Summary
protected  AbstractChartBuilder buildChartBuilder(Options options, java.lang.String[] seriesTitles)
          Create and return an appropriate chart builder, based on the options provided
protected  AbstractDataParser buildDataParser(Options options, AbstractChartBuilder chartbuider)
          Create and return an appropriate data parser, based on the options provided.
 void clear()
          Clear all set options.
protected  javax.swing.JFrame createChartFrame(org.jfree.chart.JFreeChart chart, Options options)
          Return a frame displaying the supplied chart
protected  ChartSaver createChartSaver(org.jfree.chart.JFreeChart chart, Options options)
          Return a ChartSaver for saving the chart to a file
 void generateChart(Options options)
          Parse the provided data (from the supplied input file within the options, or from stdin if null), and either display a chart in an interactive window or save it to a file (depending on the present of an output path in the options).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultChartGenerator

public DefaultChartGenerator()
Method Detail

generateChart

public void generateChart(Options options)
                   throws java.io.IOException,
                          InvalidDataException,
                          InvalidOptionsException,
                          ChartSaverException
Description copied from interface: ChartGenerator
Parse the provided data (from the supplied input file within the options, or from stdin if null), and either display a chart in an interactive window or save it to a file (depending on the present of an output path in the options).

Specified by:
generateChart in interface ChartGenerator
Parameters:
options - Options used for parsing data and generating chart
Throws:
java.io.IOException - If not able to read input data or write chart
InvalidDataException - Input data was invalid (or didn't match the options provided)
InvalidOptionsException
ChartSaverException

clear

public void clear()
Description copied from interface: ChartGenerator
Clear all set options.

Specified by:
clear in interface ChartGenerator

createChartSaver

protected ChartSaver createChartSaver(org.jfree.chart.JFreeChart chart,
                                      Options options)
Return a ChartSaver for saving the chart to a file


createChartFrame

protected javax.swing.JFrame createChartFrame(org.jfree.chart.JFreeChart chart,
                                              Options options)
Return a frame displaying the supplied chart


buildChartBuilder

protected AbstractChartBuilder buildChartBuilder(Options options,
                                                 java.lang.String[] seriesTitles)
Create and return an appropriate chart builder, based on the options provided

Parameters:
seriesTitles - Explicit series titles to use (null if none)

buildDataParser

protected AbstractDataParser buildDataParser(Options options,
                                             AbstractChartBuilder chartbuider)
Create and return an appropriate data parser, based on the options provided. Note that the chartBuilder must be plugged into the data parser as its data sink.