org.odftoolkit.simple.chart
Class AbstractChartContainer

java.lang.Object
  extended by org.odftoolkit.simple.chart.AbstractChartContainer
All Implemented Interfaces:
ChartContainer

public abstract class AbstractChartContainer
extends Object
implements ChartContainer

AbstractChartContainer is an abstract implementation of the ChartContainer interface, with a default implementation for every method defined in ChartContainer.

Since:
0.6

Constructor Summary
protected AbstractChartContainer(Document doc)
          The constructor to create a chart container
 
Method Summary
 Chart createChart(String title, DataSet dataset, Rectangle rect)
          Creates a new Chart for this container.
 Chart createChart(String title, SpreadsheetDocument document, CellRangeAddressList cellRangeAddr, boolean firstRowAsLabel, boolean firstColumnAsLabel, boolean rowAsDataSeries, Rectangle rect)
          Creates a new Chart for this container.
 Chart createChart(String title, String[] labels, String[] legends, double[][] data, Rectangle rect)
          Creates a new Chart for this container.
 void deleteChartById(String chartId)
          Deletes chart by chart id.
 void deleteChartByTitle(String title)
          Deletes chart(s) by chart title.
 Chart getChartById(String chartId)
          Gets chart with specified id.
 List<Chart> getChartByTitle(String title)
          Gets chart list with specified title.
 int getChartCount()
          Returns the chart count of this container
protected abstract  DrawFrameElement getChartFrame()
          Returns the element which can contain a chart image object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChartContainer

protected AbstractChartContainer(Document doc)
The constructor to create a chart container

Parameters:
doc - - the onwer document
Method Detail

getChartFrame

protected abstract DrawFrameElement getChartFrame()
                                           throws Exception
Returns the element which can contain a chart image object.

Returns:
the draw:frame element
Throws:
Exception

createChart

public Chart createChart(String title,
                         DataSet dataset,
                         Rectangle rect)
Description copied from interface: ChartContainer
Creates a new Chart for this container.

Specified by:
createChart in interface ChartContainer
Parameters:
title - chart title.
dataset - chart data set.
rect - chart rectangle.
Returns:
the created chart.

createChart

public Chart createChart(String title,
                         SpreadsheetDocument document,
                         CellRangeAddressList cellRangeAddr,
                         boolean firstRowAsLabel,
                         boolean firstColumnAsLabel,
                         boolean rowAsDataSeries,
                         Rectangle rect)
Description copied from interface: ChartContainer
Creates a new Chart for this container.

Specified by:
createChart in interface ChartContainer
Parameters:
title - chart title.
document - the data source spreadsheet document.
cellRangeAddr - the cell range address list which is used as chart data set.
firstRowAsLabel - whether uses first row as label.
firstColumnAsLabel - whether uses first column as label.
rowAsDataSeries - whether uses data as series.
rect - chart rectangle.
Returns:
the created chart.

createChart

public Chart createChart(String title,
                         String[] labels,
                         String[] legends,
                         double[][] data,
                         Rectangle rect)
Description copied from interface: ChartContainer
Creates a new Chart for this container.

Specified by:
createChart in interface ChartContainer
Parameters:
title - chart rectangle.
labels - label strings
legends - legend strings
data - chart data set.
rect - chart rectangle.
Returns:
the created chart.

deleteChartById

public void deleteChartById(String chartId)
Description copied from interface: ChartContainer
Deletes chart by chart id.

Specified by:
deleteChartById in interface ChartContainer
Parameters:
chartId - the id of specified chart.

deleteChartByTitle

public void deleteChartByTitle(String title)
Description copied from interface: ChartContainer
Deletes chart(s) by chart title.

Specified by:
deleteChartByTitle in interface ChartContainer
Parameters:
title - the title of specified chart(s).

getChartById

public Chart getChartById(String chartId)
Description copied from interface: ChartContainer
Gets chart with specified id.

Specified by:
getChartById in interface ChartContainer
Parameters:
chartId - the id of this chart.
Returns:
the chart with specified id.

getChartByTitle

public List<Chart> getChartByTitle(String title)
Description copied from interface: ChartContainer
Gets chart list with specified title.

Specified by:
getChartByTitle in interface ChartContainer
Parameters:
title - the title of specified chart(s).
Returns:
the chart(s) with specified title.

getChartCount

public int getChartCount()
Description copied from interface: ChartContainer
Returns the chart count of this container

Specified by:
getChartCount in interface ChartContainer
Returns:
the chart count of this container


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.