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

java.lang.Object
  extended by it.eng.spagobi.engines.kpi.bo.ChartImpl
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BulletGraph, LineChart, Meter, SimpleDial, Speedometer, Thermometer

public class ChartImpl
extends java.lang.Object
implements java.io.Serializable

Author:
Chiara Chiarelli
See Also:
Serialized Form

Field Summary
protected  java.awt.Color color
           
protected  org.jfree.data.general.DefaultValueDataset dataset
           
protected  java.lang.Integer height
           
protected  java.util.Vector intervals
           
protected  java.lang.Boolean legend
           
protected  double lower
           
protected  java.lang.String name
           
protected  it.eng.spago.security.IEngUserProfile profile
           
protected  java.lang.Boolean show_axis
           
protected  StyleLabel styleSubTitle
           
protected  StyleLabel styleTitle
           
protected  java.lang.String subName
           
protected  java.lang.Double target
           
protected  double upper
           
protected  java.lang.Integer width
           
 
Constructor Summary
ChartImpl()
           
 
Method Summary
 DatasetMap calculateValue(java.lang.String result)
          This function calculates the values for the LineChart by transforming the xml string result in a DatasetMap
 void configureChart(java.util.HashMap config)
          This function configures the chart with the parameters passed in the config HashMap
 org.jfree.chart.JFreeChart createChart()
          This function creates the chart object.
static ChartImpl createChart(java.lang.String subtype)
          This function creates the object of the right subtype
 java.awt.Color getColor()
          Gets the color.
 int getHeight()
           
 java.lang.String getName()
           
 it.eng.spago.security.IEngUserProfile getProfile()
          Gets the profile.
 org.jfree.data.general.DefaultValueDataset getValueDataSet()
          This function returns the Double value represented in the chart
 int getWidth()
           
 boolean isLegend()
           
 void setColor(java.awt.Color color)
          Sets the color.
 void setHeight(int _height)
           
 void setLegend(boolean legend)
           
 void setName(java.lang.String _name)
           
 void setProfile(it.eng.spago.security.IEngUserProfile profile)
          Sets the profile.
 void setShowAxis(boolean show_axis)
           
 org.jfree.chart.title.TextTitle setStyleTitle(java.lang.String title, StyleLabel titleLabel)
           
 void setSubName(java.lang.String _name)
           
 void setTarget(java.lang.Double target)
          Sets the Double value to represent the target into the Chart
 void setThresholdValues(java.util.List thresholdValues)
          This function fills up the vector "intervals" with the intervals of the chart, getting them from a list of Thresholds
 void setValueDataSet(java.lang.Double valueToRepresent)
          Sets the Double value to represent into the Chart
 void setWidth(int _width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

subName

protected java.lang.String subName

styleTitle

protected StyleLabel styleTitle

styleSubTitle

protected StyleLabel styleSubTitle

width

protected java.lang.Integer width

height

protected java.lang.Integer height

profile

protected it.eng.spago.security.IEngUserProfile profile

color

protected java.awt.Color color

legend

protected java.lang.Boolean legend

show_axis

protected java.lang.Boolean show_axis

dataset

protected org.jfree.data.general.DefaultValueDataset dataset

intervals

protected java.util.Vector intervals

lower

protected double lower

upper

protected double upper

target

protected java.lang.Double target
Constructor Detail

ChartImpl

public ChartImpl()
Method Detail

createChart

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

Returns:
the JFreeChart

calculateValue

public DatasetMap calculateValue(java.lang.String result)
                          throws java.lang.Exception
This function calculates the values for the LineChart by transforming the xml string result in a DatasetMap

Parameters:
Xml - String result in form ROWS.ROW
Returns:
DatasetMap
Throws:
java.lang.Exception

createChart

public static ChartImpl createChart(java.lang.String subtype)
This function creates the object of the right subtype

Parameters:
subtype: - the subtype of the Dial Chart
Returns:
the correct ChartImpl instanciated

configureChart

public void configureChart(java.util.HashMap config)
This function configures the chart with the parameters passed in the config HashMap

Parameters:
subtype: - the subtype of the Dial Chart

setValueDataSet

public void setValueDataSet(java.lang.Double valueToRepresent)
Sets the Double value to represent into the Chart

Parameters:
Double - value to set

setTarget

public void setTarget(java.lang.Double target)
Sets the Double value to represent the target into the Chart

Parameters:
Double - value of the target to set

getValueDataSet

public org.jfree.data.general.DefaultValueDataset getValueDataSet()
This function returns the Double value represented in the chart

Returns:
the Double value represented in the chart

setThresholdValues

public void setThresholdValues(java.util.List thresholdValues)
This function fills up the vector "intervals" with the intervals of the chart, getting them from a list of Thresholds

Parameters:
List - of thresholds to set

getHeight

public int getHeight()

getName

public java.lang.String getName()

getWidth

public int getWidth()

setHeight

public void setHeight(int _height)

setName

public void setName(java.lang.String _name)

setSubName

public void setSubName(java.lang.String _name)

setWidth

public void setWidth(int _width)

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

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

isLegend

public boolean isLegend()

setLegend

public void setLegend(boolean legend)

setShowAxis

public void setShowAxis(boolean show_axis)

setStyleTitle

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