de.laures.cewolf.taglib
Class AbstractChartDefinition

java.lang.Object
  extended by de.laures.cewolf.taglib.AbstractChartDefinition
All Implemented Interfaces:
ChartHolder, ChartImageRenderListener, java.io.Serializable
Direct Known Subclasses:
CombinedChartDefinition, OverlaidChartDefinition, SimpleChartDefinition

public abstract class AbstractChartDefinition
extends java.lang.Object
implements ChartHolder, java.io.Serializable, ChartImageRenderListener

Serializable implementaton of a ChartDefinition.

Author:
glaures
See Also:
ChartHolder, Serialized Form

Field Summary
protected  boolean borderVisible
           
protected  boolean plotBorderVisible
           
protected  boolean showLegend
           
protected  java.lang.String title
           
protected  java.lang.String type
           
protected  boolean xAxisInteger
           
protected  java.lang.String xAxisLabel
           
protected  boolean xTickLabelsVisible
           
protected  boolean xTickMarksVisible
           
protected  boolean yAxisInteger
           
protected  java.lang.String yAxisLabel
           
protected  boolean yTickLabelsVisible
           
protected  boolean yTickMarksVisible
           
 
Constructor Summary
AbstractChartDefinition()
           
 
Method Summary
 void addPostProcessor(ChartPostProcessor cpp, java.util.Map<java.lang.String,java.lang.String> params)
           
 org.jfree.chart.JFreeChart getChart()
          This method triggers the dataset and chart production.
 org.jfree.chart.title.LegendTitle getLegend()
           
 void onImageRendered(RenderedImage renderedImage)
          Callback right after a new image gets rendered.
protected abstract  org.jfree.chart.JFreeChart produceChart()
           
 void removeLegend()
           
 void setAntialias(boolean antialias)
          Sets the antialias.
 void setBackground(java.lang.String background)
          Sets the background.
 void setBackgroundImageAlpha(float backgroundImageAlpha)
          Sets the backgroundImageAlpha.
 void setBackgroundPaint(java.awt.Paint paint)
          Sets the background paint.
 void setBorderPaint(java.awt.Paint paint)
          Sets the chart border paint.
 void setBorderVisible(boolean borderVisible)
          Whether the chart is drawn with a border.
 void setLegendAnchor(int legendAnchor)
          Sets the legendAnchor.
 void setPlotBackgroundPaint(java.awt.Paint paint)
          Sets the plot's background paint.
 void setPlotBorderPaint(java.awt.Paint paint)
          Sets the plot border paint.
 void setPlotBorderVisible(boolean plotBorderVisible)
          Whether the plot is drawn with a border.
 void setShowLegend(boolean showLegend)
          Sets the showLegend.
 void setTitle(java.lang.String title)
          Sets the title.
 void setType(java.lang.String type)
          Sets the type.
 void setWebRootDir(java.lang.String webRootDir)
           
 void setXaxisinteger(boolean xAxisInteger)
          Whether the domain (X) axis should show integer values only.
 void setXAxisLabel(java.lang.String xAxisLabel)
          Sets the xAxisLabel.
 void setXticklabelsvisible(boolean xTickLabelsVisible)
          Whether the domain (X) axis should show any tick labels.
 void setXtickmarksvisible(boolean xTickMarksVisible)
          Whether the domain (X) axis should show any tick marks.
 void setYaxisinteger(boolean yAxisInteger)
          Whether the range (Y) axis should show integer values only.
 void setYAxisLabel(java.lang.String yAxisLabel)
          Sets the yAxisLabel.
 void setYticklabelsvisible(boolean yTickLabelsVisible)
          Whether the range (Y) axis should show any tick labels.
 void setYtickmarksvisible(boolean yTickMarksVisible)
          Whether the range (Y) axis should show any tick marks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.laures.cewolf.ChartHolder
getDataset
 

Field Detail

title

protected java.lang.String title

xAxisLabel

protected java.lang.String xAxisLabel

yAxisLabel

protected java.lang.String yAxisLabel

type

protected java.lang.String type

xAxisInteger

protected boolean xAxisInteger

yAxisInteger

protected boolean yAxisInteger

xTickMarksVisible

protected boolean xTickMarksVisible

yTickMarksVisible

protected boolean yTickMarksVisible

xTickLabelsVisible

protected boolean xTickLabelsVisible

yTickLabelsVisible

protected boolean yTickLabelsVisible

borderVisible

protected boolean borderVisible

plotBorderVisible

protected boolean plotBorderVisible

showLegend

protected boolean showLegend
Constructor Detail

AbstractChartDefinition

public AbstractChartDefinition()
Method Detail

produceChart

protected abstract org.jfree.chart.JFreeChart produceChart()
                                                    throws DatasetProduceException,
                                                           ChartValidationException
Throws:
DatasetProduceException
ChartValidationException

setWebRootDir

public void setWebRootDir(java.lang.String webRootDir)

getLegend

public org.jfree.chart.title.LegendTitle getLegend()

removeLegend

public void removeLegend()

getChart

public org.jfree.chart.JFreeChart getChart()
                                    throws DatasetProduceException,
                                           ChartValidationException,
                                           PostProcessingException
This method triggers the dataset and chart production. It is only from outside if there is no cached image available in the the image cache.

Specified by:
getChart in interface ChartHolder
Returns:
the chart object for this definition
Throws:
DatasetProduceException - if there could be no data produced for the cahrt
PostProcessingException - if a post processor failed to process the chart
ChartValidationException

setAntialias

public void setAntialias(boolean antialias)
Sets the antialias.

Parameters:
antialias - The antialias to set

setBackground

public void setBackground(java.lang.String background)
Sets the background.

Parameters:
background - The background to set

setBackgroundImageAlpha

public void setBackgroundImageAlpha(float backgroundImageAlpha)
Sets the backgroundImageAlpha.

Parameters:
backgroundImageAlpha - The backgroundImageAlpha to set

setLegendAnchor

public void setLegendAnchor(int legendAnchor)
Sets the legendAnchor.

Parameters:
legendAnchor - The legendAnchor to set

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint paint)
Sets the background paint.

Parameters:
paint - The background paint to set

setPlotBackgroundPaint

public void setPlotBackgroundPaint(java.awt.Paint paint)
Sets the plot's background paint.

Parameters:
paint - The plot's background paint to set

setShowLegend

public void setShowLegend(boolean showLegend)
Sets the showLegend.

Parameters:
showLegend - The showLegend to set

setTitle

public void setTitle(java.lang.String title)
Sets the title.

Parameters:
title - The title to set

setType

public void setType(java.lang.String type)
Sets the type.

Parameters:
type - The type to set

setXAxisLabel

public void setXAxisLabel(java.lang.String xAxisLabel)
Sets the xAxisLabel.

Parameters:
xAxisLabel - The xAxisLabel to set

setYAxisLabel

public void setYAxisLabel(java.lang.String yAxisLabel)
Sets the yAxisLabel.

Parameters:
yAxisLabel - The yAxisLabel to set

setXaxisinteger

public void setXaxisinteger(boolean xAxisInteger)
Whether the domain (X) axis should show integer values only.


setYaxisinteger

public void setYaxisinteger(boolean yAxisInteger)
Whether the range (Y) axis should show integer values only.


setXtickmarksvisible

public void setXtickmarksvisible(boolean xTickMarksVisible)
Whether the domain (X) axis should show any tick marks.


setYtickmarksvisible

public void setYtickmarksvisible(boolean yTickMarksVisible)
Whether the range (Y) axis should show any tick marks.


setXticklabelsvisible

public void setXticklabelsvisible(boolean xTickLabelsVisible)
Whether the domain (X) axis should show any tick labels.


setYticklabelsvisible

public void setYticklabelsvisible(boolean yTickLabelsVisible)
Whether the range (Y) axis should show any tick labels.


setBorderVisible

public void setBorderVisible(boolean borderVisible)
Whether the chart is drawn with a border.


setPlotBorderVisible

public void setPlotBorderVisible(boolean plotBorderVisible)
Whether the plot is drawn with a border.


setBorderPaint

public void setBorderPaint(java.awt.Paint paint)
Sets the chart border paint.


setPlotBorderPaint

public void setPlotBorderPaint(java.awt.Paint paint)
Sets the plot border paint.


addPostProcessor

public void addPostProcessor(ChartPostProcessor cpp,
                             java.util.Map<java.lang.String,java.lang.String> params)

onImageRendered

public void onImageRendered(RenderedImage renderedImage)
Callback right after a new image gets rendered. Implemented so if postprocessors implement the ImageRenderListener interface then they will be called back also

Specified by:
onImageRendered in interface ChartImageRenderListener
Parameters:
renderedImage - The fresh image just got rendered


cewolf tag library - web charts with JFreeChart