ar.com.fdvs.dj.domain.chart.builder
Class AbstractChartBuilder<T extends AbstractChartBuilder>

java.lang.Object
  extended by ar.com.fdvs.dj.domain.chart.builder.AbstractChartBuilder<T>
Direct Known Subclasses:
DJAreaChartBuilder, DJBar3DChartBuilder, DJBarChartBuilder, DJLineChartBuilder, DJPie3DChartBuilder, DJPieChartBuilder, DJScatterChartBuilder, DJTimeSeriesChartBuilder, DJXYAreaChartBuilder, DJXYBarChartBuilder, DJXYLineChartBuilder

public abstract class AbstractChartBuilder<T extends AbstractChartBuilder>
extends java.lang.Object


Field Summary
protected  DJChart chart
           
 
Constructor Summary
AbstractChartBuilder()
           
 
Method Summary
abstract  T addSerie(AbstractColumn column)
          Adds the specified serie column to the dataset.
abstract  T addSeriesColor(java.awt.Color color)
          Adds the specified series color to the plot.
 DJChart build()
           
protected abstract  byte getChartType()
           
protected abstract  AbstractDataset getDataset()
           
protected abstract  AbstractPlot getPlot()
           
abstract  T setBackColor(java.awt.Color backColor)
          Sets the background color.
protected abstract  T setCategory(PropertyColumn column)
           
abstract  T setCentered(boolean centered)
          Sets the centered.
 T setChartOptions(DJChartOptions chartOptions)
          Sets a bunch of parameters from a DJChartOptions object.
 T setColumnGroup(PropertyColumn column)
          Sets the category for any kind of builder
abstract  T setCustomizerClass(java.lang.String customizerClass)
          Sets a user specified chart customizer class name.
abstract  T setHeight(int height)
          Sets the chart height.
abstract  T setLegendBackgroundColor(java.awt.Color legendBackgroundColor)
          Sets the legend background color.
abstract  T setLegendColor(java.awt.Color legendColor)
          Sets the legend color.
abstract  T setLegendFont(Font legendFont)
          Sets the legend font.
abstract  T setLegendPosition(byte legendPosition)
          Sets the legend position (DJChartOptions.EDGE_TOP, DJChartOptions.EDGE_BOTTOM, DJChartOptions.EDGE_LEFT, DJChartOptions.EDGE_RIGHT).
abstract  T setLineColor(java.awt.Color lineColor)
          Sets the line color.
abstract  T setLineStyle(byte lineStyle)
          Sets the line style (DJChartOptions.LINE_STYLE_SOLID, DJChartOptions.LINE_STYLE_DASHED, DJChartOptions.LINE_STYLE_DOTTED, DJChartOptions.LINE_STYLE_DOUBLE).
abstract  T setLineWidth(float lineWidth)
          Sets the line width.
abstract  T setLink(DJHyperLink link)
          Sets the hyperlink.
abstract  T setOperation(byte operation)
          Sets the chart data operation (DJChart.CALCULATION_COUNT or DJChart.CALCULATION_SUM).
abstract  T setPadding(int padding)
          Sets the padding.
abstract  T setPosition(byte position)
          Sets the position (DJChartOptions.POSITION_FOOTER or DJChartOptions.POSITION_HEADER).
abstract  T setSeriesColors(java.util.List seriesColors)
          Set the specified series colors to the plot.
abstract  T setShowLegend(boolean showLegend)
          Sets the legend visibility.
abstract  T setSubtitle(java.lang.String subtitle)
          Sets the subtitle.
abstract  T setSubtitle(StringExpression subtitleExpression)
          Sets the subtitle expression.
abstract  T setSubtitleColor(java.awt.Color subtitleColor)
          Sets the subtitle color.
abstract  T setSubtitleFont(Font subtitleFont)
          Sets the subtitle font.
abstract  T setTheme(java.lang.String theme)
          Sets the theme.
abstract  T setTitle(java.lang.String title)
          Sets the title.
abstract  T setTitle(StringExpression titleExpression)
          Sets the title expression.
abstract  T setTitleColor(java.awt.Color titleColor)
          Sets the title color.
abstract  T setTitleFont(Font titleFont)
          Sets the title font.
abstract  T setTitlePosition(byte titlePosition)
          Sets the title position (DJChartOptions.EDGE_TOP, DJChartOptions.EDGE_BOTTOM, DJChartOptions.EDGE_LEFT, DJChartOptions.EDGE_RIGHT).
abstract  T setWidth(int width)
          Sets the chart width.
abstract  T setX(int x)
          Sets the x position.
abstract  T setY(int y)
          Sets the y position.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chart

protected DJChart chart
Constructor Detail

AbstractChartBuilder

public AbstractChartBuilder()
Method Detail

getChartType

protected abstract byte getChartType()

build

public DJChart build()
              throws ChartBuilderException
Throws:
ChartBuilderException

setChartOptions

public T setChartOptions(DJChartOptions chartOptions)
Sets a bunch of parameters from a DJChartOptions object. This overwrites every other option included in DJChartOptions set trough the builder's setter methods.

Parameters:
operation - the chart data operation

setColumnGroup

public T setColumnGroup(PropertyColumn column)
Sets the category for any kind of builder

Parameters:
column -
Returns:

setOperation

public abstract T setOperation(byte operation)
Sets the chart data operation (DJChart.CALCULATION_COUNT or DJChart.CALCULATION_SUM).

Parameters:
operation - the chart data operation

setLink

public abstract T setLink(DJHyperLink link)
Sets the hyperlink.

Parameters:
link - the hyperlink

setBackColor

public abstract T setBackColor(java.awt.Color backColor)
Sets the background color.

Parameters:
backColor - the background color

setHeight

public abstract T setHeight(int height)
Sets the chart height.

Parameters:
height - the chart height

setWidth

public abstract T setWidth(int width)
Sets the chart width.

Parameters:
width - the chart width

setCentered

public abstract T setCentered(boolean centered)
Sets the centered.

Parameters:
centered - the centered

setPosition

public abstract T setPosition(byte position)
Sets the position (DJChartOptions.POSITION_FOOTER or DJChartOptions.POSITION_HEADER).

Parameters:
position - the position

setY

public abstract T setY(int y)
Sets the y position.

Parameters:
y - the y position

setX

public abstract T setX(int x)
Sets the x position.

Parameters:
y - the x position

setShowLegend

public abstract T setShowLegend(boolean showLegend)
Sets the legend visibility.

Parameters:
showLegend - the legend visibility

setTitleColor

public abstract T setTitleColor(java.awt.Color titleColor)
Sets the title color.

Parameters:
titleColor - the title color

setSubtitleColor

public abstract T setSubtitleColor(java.awt.Color subtitleColor)
Sets the subtitle color.

Parameters:
subtitleColor - the subtitle color

setLegendColor

public abstract T setLegendColor(java.awt.Color legendColor)
Sets the legend color.

Parameters:
legendColor - the legend color

setLegendBackgroundColor

public abstract T setLegendBackgroundColor(java.awt.Color legendBackgroundColor)
Sets the legend background color.

Parameters:
legendBackgroundColor - the legend background color

setTheme

public abstract T setTheme(java.lang.String theme)
Sets the theme. Chart themes support to allow changing the overall appearance of charts generated with the build-in chart element

Parameters:
theme - the theme

setTitleFont

public abstract T setTitleFont(Font titleFont)
Sets the title font.

Parameters:
titleFont - the title font

setSubtitleFont

public abstract T setSubtitleFont(Font subtitleFont)
Sets the subtitle font.

Parameters:
subtitleFont - the subtitle font

setLegendFont

public abstract T setLegendFont(Font legendFont)
Sets the legend font.

Parameters:
legendFont - the legend font

setLegendPosition

public abstract T setLegendPosition(byte legendPosition)
Sets the legend position (DJChartOptions.EDGE_TOP, DJChartOptions.EDGE_BOTTOM, DJChartOptions.EDGE_LEFT, DJChartOptions.EDGE_RIGHT).

Parameters:
legendPosition - the legend position

setTitlePosition

public abstract T setTitlePosition(byte titlePosition)
Sets the title position (DJChartOptions.EDGE_TOP, DJChartOptions.EDGE_BOTTOM, DJChartOptions.EDGE_LEFT, DJChartOptions.EDGE_RIGHT).

Parameters:
titlePosition - the title position

setTitle

public abstract T setTitle(java.lang.String title)
Sets the title.

Parameters:
title - the title

setTitle

public abstract T setTitle(StringExpression titleExpression)
Sets the title expression.

Parameters:
titleExpression - the title expression

setSubtitle

public abstract T setSubtitle(java.lang.String subtitle)
Sets the subtitle.

Parameters:
subtitle - the subtitle

setSubtitle

public abstract T setSubtitle(StringExpression subtitleExpression)
Sets the subtitle expression.

Parameters:
subtitleExpression - the subtitle expression

setLineStyle

public abstract T setLineStyle(byte lineStyle)
Sets the line style (DJChartOptions.LINE_STYLE_SOLID, DJChartOptions.LINE_STYLE_DASHED, DJChartOptions.LINE_STYLE_DOTTED, DJChartOptions.LINE_STYLE_DOUBLE).

Parameters:
lineStyle - one of the line style constants in DJChartOptions class

setLineWidth

public abstract T setLineWidth(float lineWidth)
Sets the line width.

Parameters:
lineWidth - the line width

setLineColor

public abstract T setLineColor(java.awt.Color lineColor)
Sets the line color.

Parameters:
lineColor - the line color

setPadding

public abstract T setPadding(int padding)
Sets the padding.

Parameters:
padding - the padding

setCustomizerClass

public abstract T setCustomizerClass(java.lang.String customizerClass)
Sets a user specified chart customizer class name.

See Also:
JRChartCustomizer

setCategory

protected abstract T setCategory(PropertyColumn column)

addSerie

public abstract T addSerie(AbstractColumn column)
Adds the specified serie column to the dataset.

Parameters:
column - the serie column

addSeriesColor

public abstract T addSeriesColor(java.awt.Color color)
Adds the specified series color to the plot.

Parameters:
color - the series color

setSeriesColors

public abstract T setSeriesColors(java.util.List seriesColors)
Set the specified series colors to the plot.

Parameters:
seriesColors - the series colors

getDataset

protected abstract AbstractDataset getDataset()

getPlot

protected abstract AbstractPlot getPlot()


Copyright © 2006-2011 FDV Solutions. All Rights Reserved.