de.laures.cewolf.taglib
Class AbstractChartDefinition

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

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

Serializable implementaton of a ChartDefinition.

Author:
glaures
See Also:
ChartHolder, Serialized Form

Field Summary
protected static org.apache.commons.logging.Log log
           
protected  java.lang.String title
           
protected  java.lang.String type
           
protected  java.lang.String xAxisLabel
           
protected  java.lang.String yAxisLabel
           
 
Fields inherited from interface de.laures.cewolf.taglib.TaglibConstants
ANCHOR_EAST, ANCHOR_NORTH, ANCHOR_SOUTH, ANCHOR_WEST, TOOLTIPS_ENABLED_KEY
 
Constructor Summary
AbstractChartDefinition()
           
 
Method Summary
 void addPostProcessor(ChartPostProcessor pp)
           
 void addPostProcessorParams(java.util.Map params)
           
 java.lang.Object 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 setLegendAnchor(int legendAnchor)
          Sets the legendAnchor.
 void setPaint(java.awt.Paint paint)
          Sets the paint.
 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 setXAxisLabel(java.lang.String xAxisLabel)
          Sets the xAxisLabel.
 void setYAxisLabel(java.lang.String yAxisLabel)
          Sets the yAxisLabel.
 
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

log

protected static org.apache.commons.logging.Log log

title

protected java.lang.String title

xAxisLabel

protected java.lang.String xAxisLabel

yAxisLabel

protected java.lang.String yAxisLabel

type

protected java.lang.String type
Constructor Detail

AbstractChartDefinition

public AbstractChartDefinition()
Method Detail

produceChart

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

getLegend

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

removeLegend

public void removeLegend()

getChart

public java.lang.Object 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

setPaint

public void setPaint(java.awt.Paint paint)
Sets the paint.

Parameters:
paint - The 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

addPostProcessor

public void addPostProcessor(ChartPostProcessor pp)

addPostProcessorParams

public void addPostProcessorParams(java.util.Map 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


Copyright © 2009. All Rights Reserved.