it.eng.spagobi.engines.chart.bo
Class ChartImpl

java.lang.Object
  extended by it.eng.spagobi.engines.chart.bo.ChartImpl
All Implemented Interfaces:
IChart
Direct Known Subclasses:
BarCharts, BoxCharts, ClusterCharts, DialCharts, PieCharts, ScatterCharts, XYCharts

public class ChartImpl
extends java.lang.Object
implements IChart

Author:
Giulio Gavardi giulio.gavardi@eng.it

Field Summary
protected  java.awt.Color color
           
protected  java.lang.String confDataset
           
protected  java.lang.String data
           
protected  StyleLabel defaultLabelsStyle
           
protected  boolean filter
           
protected  int height
           
protected  boolean isLovConfDefined
           
protected  boolean legend
           
protected  java.lang.String legendPosition
           
protected  java.lang.String name
           
protected  java.util.Map parametersObject
           
protected  it.eng.spago.security.IEngUserProfile profile
           
protected  java.util.HashMap seriesLabelsMap
           
protected  boolean slider
           
protected  StyleLabel styleSubTitle
           
protected  StyleLabel styleTitle
           
protected  java.lang.String subName
           
protected  java.lang.String subtype
           
protected  int titleDimension
           
protected  java.lang.String type
           
protected  int width
           
 
Constructor Summary
ChartImpl()
           
 
Method Summary
 DatasetMap calculateValue()
          Calculate value.
 void configureChart(it.eng.spago.base.SourceBean content)
          configureChart reads the content of the template and sets the chart parameters.
 org.jfree.chart.JFreeChart createChart(DatasetMap dataset)
          This function creates the chart object.
static ChartImpl createChart(java.lang.String type, java.lang.String subtype)
          This function creates the object of the right subtype as specified by type and subtype parameters found in template.
 void drawLegend(org.jfree.chart.JFreeChart chart)
           
 org.jfree.data.general.Dataset filterDataset(org.jfree.data.general.Dataset dataset, java.util.HashMap categories, int catSelected, int numberCatsVisualization)
          Filter dataset.
 java.lang.String getChangeViewLabel(java.lang.String theme, int i)
          Gets the change view label.
 boolean getChangeViewParameter(java.lang.String changePar)
          Gets the change view parameter.
 java.lang.String getChangeViewParameterLabel(java.lang.String changePar, int i)
          Gets the change view parameter label.
 java.awt.Color getColor()
          Gets the color.
 java.lang.String getConfDataset()
          Gets the conf dataset.
 java.lang.String getData()
          Gets the data.
 int getHeight()
          Gets the height.
 java.lang.String getLegendPosition()
           
 java.lang.String getName()
          Gets the name.
 java.util.Map getParametersObject()
          Gets the parameters object.
 java.util.List getPossibleChangePars()
          Gets the possible change pars.
 it.eng.spago.security.IEngUserProfile getProfile()
          Gets the profile.
 java.util.HashMap getSeriesLabels()
           
 java.lang.String getSubtype()
          Gets the subtype.
 int getTitleDimension()
           
 java.lang.String getType()
          Gets the type.
 int getWidth()
          Gets the width.
 boolean isChangeableView()
          Checks if is changeable view.
 boolean isFilter()
           
 boolean isLegend()
          Checks if is legend.
 boolean isLinkable()
          Checks if is linkable.
 boolean isLovConfDefined()
          Checks if is lov conf defined.
 boolean isSlider()
           
 void setChangeViewChecked(boolean b)
          Sets the change view checked.
 void setChangeViewsParameter(java.lang.String changePar, boolean how)
          Sets the change views parameter.
 void setColor(java.awt.Color color)
          Sets the color.
 void setConfDataset(java.lang.String confDataset)
          Sets the conf dataset.
 void setData(java.lang.String _data)
          Sets the data.
 void setFilter(boolean filter)
           
 void setHeight(int _height)
          Sets the height.
 void setLegend(boolean legend)
          Sets the legend.
 void setLegendPosition(java.lang.String legendPosition)
           
 void setLocalizedTitle(java.util.Locale locale)
           
 void setLovConfDefined(boolean isLovConfDefined)
          Sets the lov conf defined.
 void setName(java.lang.String _name)
          Sets the name.
 void setParametersObject(java.util.Map parametersObject)
          Sets the parameters object.
 void setProfile(it.eng.spago.security.IEngUserProfile profile)
          Sets the profile.
 void setSeriesLabels(java.util.HashMap seriesLabels)
           
 void setSlider(boolean slider)
           
 org.jfree.chart.title.TextTitle setStyleTitle(java.lang.String title, StyleLabel titleLabel)
           
 void setSubName(java.lang.String _name)
           
 void setSubtype(java.lang.String subtype)
          Sets the subtype.
 void setTitleDimension(int titleDimension)
           
 void setTitleParameter(java.util.List atts)
           
 void setType(java.lang.String type)
          Sets the type.
 void setWidth(int _width)
          Sets the width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

titleDimension

protected int titleDimension

name

protected java.lang.String name

subName

protected java.lang.String subName

width

protected int width

height

protected int height

data

protected java.lang.String data

confDataset

protected java.lang.String confDataset

isLovConfDefined

protected boolean isLovConfDefined

profile

protected it.eng.spago.security.IEngUserProfile profile

type

protected java.lang.String type

subtype

protected java.lang.String subtype

color

protected java.awt.Color color

legend

protected boolean legend

legendPosition

protected java.lang.String legendPosition

parametersObject

protected java.util.Map parametersObject

filter

protected boolean filter

slider

protected boolean slider

styleTitle

protected StyleLabel styleTitle

styleSubTitle

protected StyleLabel styleSubTitle

defaultLabelsStyle

protected StyleLabel defaultLabelsStyle

seriesLabelsMap

protected java.util.HashMap seriesLabelsMap
Constructor Detail

ChartImpl

public ChartImpl()
Method Detail

configureChart

public void configureChart(it.eng.spago.base.SourceBean content)
configureChart reads the content of the template and sets the chart parameters.

Specified by:
configureChart in interface IChart
Parameters:
content - the content

createChart

public org.jfree.chart.JFreeChart createChart(DatasetMap dataset)
This function creates the chart object.

Specified by:
createChart in interface IChart
Parameters:
chartTitle - the chart title
dataset - the dataset
Returns:
the j free chart

createChart

public static ChartImpl createChart(java.lang.String type,
                                    java.lang.String subtype)
This function creates the object of the right subtype as specified by type and subtype parameters found in template.

Parameters:
type - the type
subtype - the subtype
Returns:
the chart impl

getData

public java.lang.String getData()
Description copied from interface: IChart
Gets the data.

Specified by:
getData in interface IChart
Returns:
the data

getHeight

public int getHeight()
Description copied from interface: IChart
Gets the height.

Specified by:
getHeight in interface IChart
Returns:
the height

getName

public java.lang.String getName()
Description copied from interface: IChart
Gets the name.

Specified by:
getName in interface IChart
Returns:
the name

getWidth

public int getWidth()
Description copied from interface: IChart
Gets the width.

Specified by:
getWidth in interface IChart
Returns:
the width

setData

public void setData(java.lang.String _data)
Description copied from interface: IChart
Sets the data.

Specified by:
setData in interface IChart
Parameters:
_data - the new data

setHeight

public void setHeight(int _height)
Description copied from interface: IChart
Sets the height.

Specified by:
setHeight in interface IChart
Parameters:
_height - the new height

setName

public void setName(java.lang.String _name)
Description copied from interface: IChart
Sets the name.

Specified by:
setName in interface IChart
Parameters:
_name - the new name

setSubName

public void setSubName(java.lang.String _name)

setWidth

public void setWidth(int _width)
Description copied from interface: IChart
Sets the width.

Specified by:
setWidth in interface IChart
Parameters:
_width - the new width

calculateValue

public DatasetMap calculateValue()
                          throws java.lang.Exception
Description copied from interface: IChart
Calculate value.

Specified by:
calculateValue in interface IChart
Returns:
A map of datasets (usually only one)
Throws:
java.lang.Exception - the exception

getConfDataset

public java.lang.String getConfDataset()
Gets the conf dataset.

Returns:
the conf dataset

setConfDataset

public void setConfDataset(java.lang.String confDataset)
Sets the conf dataset.

Parameters:
confDataset - the new conf dataset

getProfile

public it.eng.spago.security.IEngUserProfile getProfile()
Gets the profile.

Returns:
the profile

setProfile

public void setProfile(it.eng.spago.security.IEngUserProfile profile)
Sets the profile.

Parameters:
profile - the new profile

isLovConfDefined

public boolean isLovConfDefined()
Checks if is lov conf defined.

Returns:
true, if is lov conf defined

setLovConfDefined

public void setLovConfDefined(boolean isLovConfDefined)
Sets the lov conf defined.

Parameters:
isLovConfDefined - the new lov conf defined

isLinkable

public boolean isLinkable()
Description copied from interface: IChart
Checks if is linkable.

Specified by:
isLinkable in interface IChart
Returns:
true, if is linkable

getType

public java.lang.String getType()
Gets the type.

Returns:
the type

setType

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

Parameters:
type - the new type

getSubtype

public java.lang.String getSubtype()
Gets the subtype.

Returns:
the subtype

setSubtype

public void setSubtype(java.lang.String subtype)
Sets the subtype.

Parameters:
subtype - the new subtype

isChangeableView

public boolean isChangeableView()
Description copied from interface: IChart
Checks if is changeable view.

Specified by:
isChangeableView in interface IChart
Returns:
true, if is changeable view

getChangeViewLabel

public java.lang.String getChangeViewLabel(java.lang.String theme,
                                           int i)
Gets the change view label.

Parameters:
theme - the theme
i - the i
Returns:
the change view label

setChangeViewChecked

public void setChangeViewChecked(boolean b)
Description copied from interface: IChart
Sets the change view checked.

Specified by:
setChangeViewChecked in interface IChart
Parameters:
b - the new change view checked

getPossibleChangePars

public java.util.List getPossibleChangePars()
Description copied from interface: IChart
Gets the possible change pars.

Specified by:
getPossibleChangePars in interface IChart
Returns:
the possible change pars

setChangeViewsParameter

public void setChangeViewsParameter(java.lang.String changePar,
                                    boolean how)
Description copied from interface: IChart
Sets the change views parameter.

Specified by:
setChangeViewsParameter in interface IChart
Parameters:
changePar - the change par
how - the how

getChangeViewParameter

public boolean getChangeViewParameter(java.lang.String changePar)
Description copied from interface: IChart
Gets the change view parameter.

Specified by:
getChangeViewParameter in interface IChart
Parameters:
changePar - the change par
Returns:
the change view parameter

getChangeViewParameterLabel

public java.lang.String getChangeViewParameterLabel(java.lang.String changePar,
                                                    int i)
Description copied from interface: IChart
Gets the change view parameter label.

Specified by:
getChangeViewParameterLabel in interface IChart
Parameters:
changePar - the change par
i - the i
Returns:
the change view parameter label

getColor

public java.awt.Color getColor()
Gets the color.

Returns:
the color

setColor

public void setColor(java.awt.Color color)
Sets the color.

Parameters:
color - the new color

filterDataset

public org.jfree.data.general.Dataset filterDataset(org.jfree.data.general.Dataset dataset,
                                                    java.util.HashMap categories,
                                                    int catSelected,
                                                    int numberCatsVisualization)
Description copied from interface: IChart
Filter dataset.

Specified by:
filterDataset in interface IChart
Parameters:
dataset - the dataset
categories - the categories
catSelected - the cat selected
numberCatsVisualization - the number cats visualization
Returns:
the dataset

isLegend

public boolean isLegend()
Description copied from interface: IChart
Checks if is legend.

Specified by:
isLegend in interface IChart
Returns:
true, if is legend

setLegend

public void setLegend(boolean legend)
Description copied from interface: IChart
Sets the legend.

Specified by:
setLegend in interface IChart
Parameters:
legend - the new legend

getParametersObject

public java.util.Map getParametersObject()
Description copied from interface: IChart
Gets the parameters object.

Specified by:
getParametersObject in interface IChart
Returns:
the parameters object

setParametersObject

public void setParametersObject(java.util.Map parametersObject)
Description copied from interface: IChart
Sets the parameters object.

Specified by:
setParametersObject in interface IChart
Parameters:
parametersObject - the new parameters object

isFilter

public boolean isFilter()

setFilter

public void setFilter(boolean filter)

isSlider

public boolean isSlider()

setSlider

public void setSlider(boolean slider)

setTitleParameter

public void setTitleParameter(java.util.List atts)

setStyleTitle

public org.jfree.chart.title.TextTitle setStyleTitle(java.lang.String title,
                                                     StyleLabel titleLabel)

getTitleDimension

public int getTitleDimension()
Specified by:
getTitleDimension in interface IChart

setTitleDimension

public void setTitleDimension(int titleDimension)
Specified by:
setTitleDimension in interface IChart

getSeriesLabels

public java.util.HashMap getSeriesLabels()

setSeriesLabels

public void setSeriesLabels(java.util.HashMap seriesLabels)

getLegendPosition

public java.lang.String getLegendPosition()

setLegendPosition

public void setLegendPosition(java.lang.String legendPosition)

drawLegend

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

setLocalizedTitle

public void setLocalizedTitle(java.util.Locale locale)
Specified by:
setLocalizedTitle in interface IChart