LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.web.struts
Class LyStrutsFreeChart

java.lang.Object
  extended by leon.view.graphic.LyGraphicalObject
      extended by leon.view.web.LyWebObject
          extended by leon.view.web.struts.LyStrutsFieldItem
              extended by leon.view.web.struts.LyStrutsPanel
                  extended by leon.view.web.struts.LyStrutsFreeChart
All Implemented Interfaces:
LyGetChartConverterInterface, LyGraphicalChart, LyGraphicalComponent, LyGraphicalFieldItem, LyGraphicalPanel, LyViewComponent, LyFreeInterface, LySetBoundsInterface, LySetLabelInterface, LySetPopupMenuInterface, LyWebComponent

public class LyStrutsFreeChart
extends LyStrutsPanel
implements LyGraphicalChart, LyGetChartConverterInterface, LySetBoundsInterface

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

CHART: Statistic Chart
A chart allows to display a graph representing statistics on data.

See Also:
LyCommonFreeChartConverter

Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class leon.view.web.LyWebObject
WEB_COMPONENT_ID, WEB_CONTROLLER_ID, WEB_SESSION_ID
 
Constructor Summary
LyStrutsFreeChart(LyChart chart)
          Class constructor of a Chart object for the struts target.
 
Method Summary
 void addColumn(LyColumn column, int pos)
          Inserts a sub-component columns at given position.
 void free()
          Free resources allocated to this component.
 LyChartConverter getChartConverter()
          Get the Chart Converter (if any).
 int[] getComponentDimension()
          Get the dimension of the component used to represent the chart.
 java.lang.String getHtmlLink(java.lang.String imagePath)
          Gets the HTML tag that links the image to the ressource.
 void initialize()
          Initialization method.
 void removeColumn(LyColumn column)
          Removes a sub-component columns.
 void saveChartFile(java.lang.String tmpDir, java.lang.String imageFile, java.lang.StringBuffer buffer)
          Save the file to the http directory.
 void setContent()
          Sets the content of this view.
 void setDimension(int width, int height)
          Deprecated. use setSize()
 void setLocation(int x, int y)
          Accessor to the location.
 void setSize(int width, int height)
          Sets the width and height of the generated image.
 void writeHtml(LyWebPageWriter pw)
          Write HTML description corresponding to this component.
 
Methods inherited from class leon.view.web.struts.LyStrutsPanel
getPopupMenuView, setPopupMenu
 
Methods inherited from class leon.view.web.struts.LyStrutsFieldItem
canDisabled, getCaption, getController, getFieldItem, getForm, getFormField, getFormName, getHtmlForm, getId, isEditable, isNetscape, isOptional, needCheck, setLabel
 
Methods inherited from class leon.view.web.LyWebObject
addFileScript, decodeUrl, displayUpPage, encodeUrl, encodeUrlXhtml, expandUrl, getDisabledImageUrl, getFontSize, getFontString, getFontString, getFontString, getHexColor, getHexColor, getHtmlEntitiesString, getHtmlString, getImageSize, getImageSize, getImageUrl, getJavascriptString, getLastFrameName, getLyFont, getMessage, getRootUrl, getRootURL, getScrollHeightForSplitter, getUrl, getWebViewManager, refresh, replaceUrl, replaceUrl, setUpdating, updateRefreshInfo, writeJson
 
Methods inherited from class leon.view.graphic.LyGraphicalObject
expand, getBounds, getChildrenBounds, getEnv, getEnvironment, getIdCode, getIntResource, getMessage, getResource, getString, getString, getString, getViewComponent, getViewManager, isFreed, isFreeing, isImageAnimated, processDemand, processDemand, testResource, translate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.view.graphic.LyGraphicalComponent
getViewComponent
 

Field Detail

__VERSION

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

LyStrutsFreeChart

public LyStrutsFreeChart(LyChart chart)
Class constructor of a Chart object for the struts target.

Parameters:
chart - the generic Chart defined for every type of view targets
See Also:
LyChartController
Method Detail

initialize

public void initialize()
Initialization method.


setContent

public void setContent()
Sets the content of this view.


setDimension

public void setDimension(int width,
                         int height)
Deprecated. use setSize()

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

getChartConverter

public LyChartConverter getChartConverter()
Description copied from interface: LyGetChartConverterInterface
Get the Chart Converter (if any).

Specified by:
getChartConverter in interface LyGetChartConverterInterface
Returns:
the graphical chart Converter.

getComponentDimension

public int[] getComponentDimension()
Get the dimension of the component used to represent the chart.

Specified by:
getComponentDimension in interface LyGetChartConverterInterface
Returns:
an array of two integers (width and height of the component).

writeHtml

public void writeHtml(LyWebPageWriter pw)
Description copied from interface: LyWebComponent
Write HTML description corresponding to this component.

Specified by:
writeHtml in interface LyWebComponent
Parameters:
pw - the page writer

saveChartFile

public void saveChartFile(java.lang.String tmpDir,
                          java.lang.String imageFile,
                          java.lang.StringBuffer buffer)
Save the file to the http directory.

Parameters:
tmpDir - temporary directory for the image/svg
imageFile - name of the file
buffer - the buffer where imagemap must be generated

getHtmlLink

public java.lang.String getHtmlLink(java.lang.String imagePath)
Gets the HTML tag that links the image to the ressource.

Parameters:
imagePath - the image path
Returns:
the HTML tag for the image

free

public void free()
Description copied from class: LyGraphicalObject
Free resources allocated to this component.

Specified by:
free in interface LyGraphicalComponent
Specified by:
free in interface LyFreeInterface
Overrides:
free in class LyWebObject
See Also:
LyFreeInterface.free()

addColumn

public void addColumn(LyColumn column,
                      int pos)
Description copied from interface: LyGraphicalChart
Inserts a sub-component columns at given position.

Specified by:
addColumn in interface LyGraphicalChart
Parameters:
column - The columns to add to columns list.
pos - Position where the sub-component is inserted.

removeColumn

public void removeColumn(LyColumn column)
Description copied from interface: LyGraphicalChart
Removes a sub-component columns.

Specified by:
removeColumn in interface LyGraphicalChart
Parameters:
column - The columns to remove to columns list.

setLocation

public void setLocation(int x,
                        int y)
Description copied from interface: LySetBoundsInterface
Accessor to the location.

Specified by:
setLocation in interface LySetBoundsInterface
See Also:
LySetBoundsInterface.setLocation(int, int)

setSize

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

Specified by:
setSize in interface LySetBoundsInterface
Parameters:
width - the new width of the generated image
height - the new height of the generated image
See Also:
LySetBoundsInterface.setSize(int, int)

(c) January 2013 - W4 S.A.

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