org.sf.charttaglibs
Class BaseChartTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.sf.charttaglibs.BaseHandlerTag
              extended byorg.sf.charttaglibs.BaseChartTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
CategoryBasedChart, PieBasedChart

public abstract class BaseChartTag
extends BaseHandlerTag

The base class that manage all chart-tags it's handle the common and default value for a JFreeChart graphics. All tags calsses must extends this class

Author:
mmohamed |at| dcc |dot| uchile |dot| cl
See Also:
Serialized Form

Field Summary
protected  boolean antiAlias
           
protected  float bgAlpha
           
protected  java.lang.String bgColor
           
protected  org.jfree.chart.JFreeChart chart
           
protected  boolean chartborder
           
protected  int chartHight
           
protected  int chartWidth
           
protected  boolean createLegend
           
protected  boolean createTooltip
           
protected  boolean createUrl
           
protected  float fgAlpha
           
private  java.lang.String filename
           
protected  java.lang.String src
           
protected  java.lang.String subtitle
           
protected  java.lang.String subtitlePosition
           
protected  java.lang.String title
           
protected  java.lang.String titlePosition
           
protected  boolean usemap
           
 
Fields inherited from class org.sf.charttaglibs.BaseHandlerTag
align, border, height, hspace, ismap, messages, name, vspace, width
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BaseChartTag()
           
 
Method Summary
 int doEndTag()
           
 int doStartTag()
          This method is invoked by the JSP container to parse the tag.
 boolean getAntiAlias()
           
 float getBgAlpha()
           
 java.lang.String getBgColor()
           
 org.jfree.chart.JFreeChart getChart()
           
 boolean getChartborder()
           
 int getChartHight()
           
 int getChartWidth()
           
private  java.awt.Color getColorByString(java.lang.String color)
          Geet a java.awt.Color using the input color, the color can by in hexadecimal notation #FFFFFF or some a predefine color
Predefined colors black blue cyan darkgray green grey lightgray magenta orange pink red yellow white
 boolean getCreateLegend()
           
 boolean getCreateUrl()
           
 float getFgAlpha()
           
 java.lang.String getFileName()
          Execute the logic of the chart and save it to the server temporaly directory it'l return a null value if the char is null, otherwise it will the name of the generated file with image
protected  java.util.Iterator getIterator(java.lang.String name, java.lang.String property)
          Return an iterator for the option labels or values, based on our configured properties.
 java.lang.String getSrc()
           
 java.lang.String getSubtitle()
           
 java.lang.String getSubtitlePosition()
           
 java.lang.String getTitle()
           
 java.lang.String getTitlePosition()
           
 boolean getUsemap()
           
abstract  void initChart()
           
 boolean isCreateTooltip()
           
 void release()
          Release any acquired resources.
private  void renderImgTag()
          Render the tag IMG of the html standard
 void setAntiAlias(boolean antiAlias)
           
 void setBgAlpha(float bgAlpha)
           
 void setBgColor(java.lang.String bgColor)
           
 void setChart(org.jfree.chart.JFreeChart chart)
           
 void setChartborder(boolean chartborder)
           
 void setChartHight(int chartHight)
           
 void setChartWidth(int chartWidth)
           
 void setCreateLegend(boolean createLegend)
           
 void setCreateTooltip(boolean createToolTip)
           
 void setCreateUrl(boolean createUrl)
           
 void setFgAlpha(float fgAlpha)
           
 void setSrc(java.lang.String src)
           
 void setSubtitle(java.lang.String subTitle)
           
private  void setSubtitlePosition()
          Set the subtitle position
 void setSubtitlePosition(java.lang.String subtitlePosition)
           
 void setTitle(java.lang.String title)
           
private  void setTitlePosition()
          Set the title position
 void setTitlePosition(java.lang.String position)
           
 void setUsemap(boolean usemap)
           
 
Methods inherited from class org.sf.charttaglibs.BaseHandlerTag
getAlign, getAlt, getBorder, getElementClose, getHeight, getHspace, getIsmap, getName, getOnabort, getOnblur, getOnclick, getOnerror, getOnfocus, getOnload, getVspace, getWidth, isXhtml, lookupProperty, prepareAttribute, prepareHtmlElements, prepareJavaScriptsEvent, prepareOtherAttributes, setAlign, setAlt, setBorder, setHeight, setHspace, setIsmap, setName, setOnabort, setOnblur, setOnclick, setOnerror, setOnfocus, setOnload, setVspace, setWidth
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

chart

protected org.jfree.chart.JFreeChart chart

src

protected java.lang.String src

title

protected java.lang.String title

subtitle

protected java.lang.String subtitle

chartborder

protected boolean chartborder

usemap

protected boolean usemap

antiAlias

protected boolean antiAlias

createLegend

protected boolean createLegend

createTooltip

protected boolean createTooltip

createUrl

protected boolean createUrl

bgColor

protected java.lang.String bgColor

titlePosition

protected java.lang.String titlePosition

subtitlePosition

protected java.lang.String subtitlePosition

fgAlpha

protected float fgAlpha

bgAlpha

protected float bgAlpha

chartWidth

protected int chartWidth

chartHight

protected int chartHight

filename

private java.lang.String filename
Constructor Detail

BaseChartTag

public BaseChartTag()
Method Detail

initChart

public abstract void initChart()
                        throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

getFileName

public java.lang.String getFileName()
                             throws javax.servlet.jsp.JspException
Execute the logic of the chart and save it to the server temporaly directory it'l return a null value if the char is null, otherwise it will the name of the generated file with image

Returns:
filename
Throws:
javax.servlet.jsp.JspException - if something go wrong

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
This method is invoked by the JSP container to parse the tag. All common task are here

Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException

renderImgTag

private void renderImgTag()
                   throws javax.servlet.jsp.JspException
Render the tag IMG of the html standard

Throws:
javax.servlet.jsp.JspException

setTitlePosition

private void setTitlePosition()
Set the title position


setSubtitlePosition

private void setSubtitlePosition()
Set the subtitle position


release

public void release()
Release any acquired resources.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class BaseHandlerTag

getIterator

protected java.util.Iterator getIterator(java.lang.String name,
                                         java.lang.String property)
                                  throws javax.servlet.jsp.JspException
Return an iterator for the option labels or values, based on our configured properties.

Parameters:
name - Name of the bean attribute (if any)
property - Name of the bean property (if any)
Throws:
javax.servlet.jsp.JspException - if an error occurs

getColorByString

private java.awt.Color getColorByString(java.lang.String color)
                                 throws javax.servlet.jsp.JspException

Geet a java.awt.Color using the input color, the color can by in hexadecimal notation #FFFFFF or some a predefine color


Predefined colors

Parameters:
color - HTML colors (#FFFFFF format) or a predefined color
Returns:
a java.awt.Color
Throws:
javax.servlet.jsp.JspException - if the color is null or the html format is not #ffffff

getSubtitle

public java.lang.String getSubtitle()

setSubtitle

public void setSubtitle(java.lang.String subTitle)

getTitle

public java.lang.String getTitle()

getChartborder

public boolean getChartborder()

setChartborder

public void setChartborder(boolean chartborder)

getSrc

public java.lang.String getSrc()

setSrc

public void setSrc(java.lang.String src)

setTitle

public void setTitle(java.lang.String title)

getUsemap

public boolean getUsemap()

setUsemap

public void setUsemap(boolean usemap)

getAntiAlias

public boolean getAntiAlias()

setAntiAlias

public void setAntiAlias(boolean antiAlias)

getChart

public org.jfree.chart.JFreeChart getChart()

setChart

public void setChart(org.jfree.chart.JFreeChart chart)

getTitlePosition

public java.lang.String getTitlePosition()

setTitlePosition

public void setTitlePosition(java.lang.String position)

getSubtitlePosition

public java.lang.String getSubtitlePosition()

setSubtitlePosition

public void setSubtitlePosition(java.lang.String subtitlePosition)

getFgAlpha

public float getFgAlpha()

setFgAlpha

public void setFgAlpha(float fgAlpha)

getBgAlpha

public float getBgAlpha()

setBgAlpha

public void setBgAlpha(float bgAlpha)

getBgColor

public java.lang.String getBgColor()

setBgColor

public void setBgColor(java.lang.String bgColor)

getCreateLegend

public boolean getCreateLegend()

setCreateLegend

public void setCreateLegend(boolean createLegend)

isCreateTooltip

public boolean isCreateTooltip()

setCreateTooltip

public void setCreateTooltip(boolean createToolTip)

getCreateUrl

public boolean getCreateUrl()

setCreateUrl

public void setCreateUrl(boolean createUrl)

getChartHight

public int getChartHight()

setChartHight

public void setChartHight(int chartHight)

getChartWidth

public int getChartWidth()

setChartWidth

public void setChartWidth(int chartWidth)