LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.common
Class LyCommonFreeChartConverter

java.lang.Object
  extended by leon.view.LyChartConverter
      extended by leon.view.common.LyCommonFreeChartConverter
Direct Known Subclasses:
LyJQChartConverter

public class LyCommonFreeChartConverter
extends LyChartConverter

This class implements the Chart object (as described in the dtd) for the viewer.

See Also:
LyChart

Nested Class Summary
static class LyCommonFreeChartConverter.LyLegendItem
          Specific legend item implementation used to change legend items colors.
 
Field Summary
static java.lang.String __VERSION
           
static float ALPHA_RATIO
          Default alpha ratio for transparency.
static int DEFAULT_CHART_HEIGHT
          Default chart height.
static int DEFAULT_CHART_WIDTH
          Default chart width.
static int LINK_HEIGHT
          Height of the link used to display values in plot and 3D bar charts.
static int MAX_LABEL_LINES
          Max number of lines for splitting the labels in the chart action.
static int SCATTER_PLOT_DECIMALS_NUMBER
          Number of decimals for position tooltips in scatter plot mode.
static char SCATTER_PLOT_INTERNAL_LABEL_SEPARATOR
          Internal separator used for labels of multiple points in scatter plot mode
static java.lang.String SCATTER_PLOT_LABEL_SEPARATOR
          Separator used for labels of multiple points in scatter plot mode.
static java.lang.String SCATTER_PLOT_TOOLTIP_SEPARATOR
          Separator used for tooltips of points in scatter plot mode.
static java.lang.String SCATTER_PLOT_VISIBLE_LABEL_SEPARATOR
          Visible separator used for labels of multiple points in scatter plot mode
 
Fields inherited from class leon.view.LyChartConverter
DEFAULT_HEIGHT, DEFAULT_WIDTH
 
Constructor Summary
LyCommonFreeChartConverter()
          Constructor.
LyCommonFreeChartConverter(LyChart chart)
          Constructor.
 
Method Summary
 org.jfree.data.category.CategoryDataset createCategoryDataset()
          Creates and returns a category dataset for the charts.
 org.jfree.data.xy.DefaultTableXYDataset createTableXYDataset()
          Creates and returns a XYDataset for the demo charts.
 org.jfree.data.xy.XYSeriesCollection createXYDataset(boolean groupValues)
          Creates and returns a XYDataset for the demo charts.
 java.lang.String generateUrl(java.lang.String sourceId)
          Generate an URL for a given source id (used in web mode only).
 org.jfree.chart.JFreeChart getFreeChart()
          Retreives the Internal Free chart component.
 java.lang.String getMultiLineBegin()
          Retrieve the beginning of the label when it has more than one line.
 java.lang.String getMultiLineEnd()
          Retrieve the end of the label when it has more than one line.
 java.lang.String getMultiLineSep()
          Retrieve the line separator of the label when it has more than one line.
 java.awt.Paint[] getPaints()
          Returns the specific palette for colors used in chart component.
 void initialize()
          Initialization method.
 void reset()
          Reset the display from the underlying XML data Main method to construct the chart.
 void saveImg(java.lang.String tmpDir, java.lang.String imageFile, java.lang.StringBuffer buffer, boolean deleteOnExit)
          Save the image of the chart.
 void setBackgroundColor(java.awt.Color color)
          Change the background color of the chart component.
 void setDimension(int width, int height)
          Sets the width and height of the generated image.
 void setLegendRightPosition(boolean rightPosition)
          Sets the legendRightPosition parameter.
 void setPaints(java.awt.Paint[] paints)
          Set a specific palette for colors used in chart component.
 void setSpecificLegendValue(java.util.Hashtable<java.lang.String,java.lang.String> values)
          Set the specific legend values.
 
Methods inherited from class leon.view.LyChartConverter
buildXLabels, buildXLabels, generateSensitiveAreas, generateSensitiveAreas, setChart, setContent, setIntervals
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

DEFAULT_CHART_WIDTH

public static int DEFAULT_CHART_WIDTH
Default chart width.


DEFAULT_CHART_HEIGHT

public static int DEFAULT_CHART_HEIGHT
Default chart height.


ALPHA_RATIO

public static float ALPHA_RATIO
Default alpha ratio for transparency.


LINK_HEIGHT

public static int LINK_HEIGHT
Height of the link used to display values in plot and 3D bar charts.


MAX_LABEL_LINES

public static int MAX_LABEL_LINES
Max number of lines for splitting the labels in the chart action.


SCATTER_PLOT_VISIBLE_LABEL_SEPARATOR

public static java.lang.String SCATTER_PLOT_VISIBLE_LABEL_SEPARATOR
Visible separator used for labels of multiple points in scatter plot mode


SCATTER_PLOT_INTERNAL_LABEL_SEPARATOR

public static char SCATTER_PLOT_INTERNAL_LABEL_SEPARATOR
Internal separator used for labels of multiple points in scatter plot mode


SCATTER_PLOT_LABEL_SEPARATOR

public static java.lang.String SCATTER_PLOT_LABEL_SEPARATOR
Separator used for labels of multiple points in scatter plot mode.


SCATTER_PLOT_TOOLTIP_SEPARATOR

public static java.lang.String SCATTER_PLOT_TOOLTIP_SEPARATOR
Separator used for tooltips of points in scatter plot mode.


SCATTER_PLOT_DECIMALS_NUMBER

public static int SCATTER_PLOT_DECIMALS_NUMBER
Number of decimals for position tooltips in scatter plot mode.

Constructor Detail

LyCommonFreeChartConverter

public LyCommonFreeChartConverter()
Constructor.


LyCommonFreeChartConverter

public LyCommonFreeChartConverter(LyChart chart)
Constructor.

Parameters:
chart - the chart created by LyChartController
See Also:
LyChartController
Method Detail

setDimension

public void setDimension(int width,
                         int height)
Sets the width and height of the generated image.

Parameters:
width - the new width of the generated image
height - the new height of the generated image

initialize

public void initialize()
Initialization method.

Overrides:
initialize in class LyChartConverter

reset

public void reset()
Reset the display from the underlying XML data Main method to construct the chart.

Specified by:
reset in class LyChartConverter

createCategoryDataset

public org.jfree.data.category.CategoryDataset createCategoryDataset()
Creates and returns a category dataset for the charts.


createXYDataset

public org.jfree.data.xy.XYSeriesCollection createXYDataset(boolean groupValues)
Creates and returns a XYDataset for the demo charts.


createTableXYDataset

public org.jfree.data.xy.DefaultTableXYDataset createTableXYDataset()
Creates and returns a XYDataset for the demo charts.


setPaints

public void setPaints(java.awt.Paint[] paints)
Set a specific palette for colors used in chart component.

Parameters:
paints - the array of new colors that must be used in the chart component

getPaints

public java.awt.Paint[] getPaints()
Returns the specific palette for colors used in chart component.


setBackgroundColor

public void setBackgroundColor(java.awt.Color color)
Change the background color of the chart component.

Parameters:
color - the new background color

setSpecificLegendValue

public void setSpecificLegendValue(java.util.Hashtable<java.lang.String,java.lang.String> values)
Set the specific legend values.

Overrides:
setSpecificLegendValue in class LyChartConverter
Parameters:
values -

setLegendRightPosition

public void setLegendRightPosition(boolean rightPosition)
Sets the legendRightPosition parameter.

Overrides:
setLegendRightPosition in class LyChartConverter
Parameters:
rightPosition - the new legendRightPosition value

getMultiLineBegin

public java.lang.String getMultiLineBegin()
Retrieve the beginning of the label when it has more than one line.

Specified by:
getMultiLineBegin in class LyChartConverter
Returns:
for example : null for String, and ... for HTML

getMultiLineEnd

public java.lang.String getMultiLineEnd()
Retrieve the end of the label when it has more than one line.

Specified by:
getMultiLineEnd in class LyChartConverter
Returns:
for example : null for String, and ... for HTML

getMultiLineSep

public java.lang.String getMultiLineSep()
Retrieve the line separator of the label when it has more than one line.

Specified by:
getMultiLineSep in class LyChartConverter
Returns:
for example : \n for String, and /p>


saveImg

public void saveImg(java.lang.String tmpDir,
                    java.lang.String imageFile,
                    java.lang.StringBuffer buffer,
                    boolean deleteOnExit)
Save the image of the chart.

Specified by:
saveImg in class LyChartConverter
Parameters:
tmpDir - temporary directory
imageFile - the PNG File
buffer - the buffer where imagemap must be generated
deleteOnExit - indicates whether the file must be deleted on exiting the application

generateUrl

public java.lang.String generateUrl(java.lang.String sourceId)
Generate an URL for a given source id (used in web mode only).

Parameters:
sourceId - the id of the source
Returns:
the URL used to call the web server

getFreeChart

public org.jfree.chart.JFreeChart getFreeChart()
Retreives the Internal Free chart component.

Returns:
the chart component

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com