|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.clichart.chart.AbstractChartBuilder
public abstract class AbstractChartBuilder
Base class for objects that can build and return a chart based on a data series provided by the DataSink interface. Note that these objects can also be used to add a second axis to an existing chart, so when adding a second axis, should create two of the same subclass (one for each axis), call getChart() on the first, and addSecondAxis() on the second WARNING: Not threadsafe
| Field Summary | |
|---|---|
protected Options |
m_options
|
protected java.lang.String[] |
m_seriesTitles
|
| Constructor Summary | |
|---|---|
protected |
AbstractChartBuilder(Options options,
java.lang.String[] seriesTitles)
|
| Method Summary | |
|---|---|
void |
addSecondAxis(org.jfree.chart.JFreeChart chart,
Options options)
Add the data set as the second axis to this chart |
protected abstract void |
addYValue(int columnNumber,
java.lang.Object xValue,
java.lang.Object yValue)
Called for subclass to add this yValue to the appropriate series |
void |
dataParsed(java.lang.Object xValue,
java.lang.Object[] yValues,
int lineNumber)
Provides the data from a line of tabular data that has been parsed from some source. |
org.jfree.chart.JFreeChart |
getChart(Options options)
Must be called *after* all parsing is finished |
protected abstract org.jfree.chart.JFreeChart |
getChartImpl(Options options)
Called for subclass to create the required chart object, containing all the data provided |
protected abstract org.jfree.data.xy.XYDataset |
getDataset()
Return the dataset containing all the data provided - used to add the second axis |
protected abstract org.jfree.chart.labels.XYToolTipGenerator |
getToolTipGenerator()
Return an appropriate tooltip generator for a new renderer |
void |
headerParsed(java.lang.String[] headers)
Provides a column header for tabular data that has been parsed from some source |
protected abstract void |
initialiseSeriesColumn(java.lang.String title)
Called for subclass to create and register the appropriate data series for the column with this title |
void |
parsingFinished()
Advice that parsing of the source has been completed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Options m_options
protected final java.lang.String[] m_seriesTitles
| Constructor Detail |
|---|
protected AbstractChartBuilder(Options options,
java.lang.String[] seriesTitles)
| Method Detail |
|---|
public void headerParsed(java.lang.String[] headers)
throws InvalidDataException
DataSink
headerParsed in interface DataSinkheaders - String headers for each column of interest (elements may be an empty string, but not null).
Note that there should be as many headers as there are yValues in dataParsed()
InvalidDataException
public void dataParsed(java.lang.Object xValue,
java.lang.Object[] yValues,
int lineNumber)
throws InvalidDataException
DataSink
dataParsed in interface DataSinkxValue - The X axis value for the data (often a date/time).yValues - An array of size (headers.length - 1)lineNumber - The 1-based line number for this line in the data source
InvalidDataExceptionpublic void parsingFinished()
DataSink
parsingFinished in interface DataSinkpublic org.jfree.chart.JFreeChart getChart(Options options)
public void addSecondAxis(org.jfree.chart.JFreeChart chart,
Options options)
protected abstract void initialiseSeriesColumn(java.lang.String title)
title -
protected abstract void addYValue(int columnNumber,
java.lang.Object xValue,
java.lang.Object yValue)
columnNumber - The 0-based index into the dataColumnIndexes arrayxValue - The x axis value for this rowyValue - The y axis value for this row and column numberprotected abstract org.jfree.chart.JFreeChart getChartImpl(Options options)
protected abstract org.jfree.data.xy.XYDataset getDataset()
protected abstract org.jfree.chart.labels.XYToolTipGenerator getToolTipGenerator()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||