corelib.services.web.components.diagrams
Class Diagram

java.lang.Object
  extended by corelib.services.web.components.WebComponent
      extended by corelib.services.web.components.VisualComponent
          extended by corelib.services.web.components.diagrams.Diagram

public class Diagram
extends VisualComponent

This class is used to inject a diagram in your web page. The Component Diagram is based on the MVC architecture pattern (Model, view, controller). The component is able to display multiple data models on view. There are several types of views: HistogramView, CurveView and PieView. Here is an example of using this component:

     <diagram:Diagram caption="Sales per month">
         
         <diagram:HistogramView drawLegend="true" drawValues="false" />
         
         <diagram:Model name="Sales for 2009" color="rgb(255,0,0)">
             <diagram:Datum key="January" value="120000" />
             <!-- ... -->
         </diagram:Model>
         
         <diagram:Model name="Sales for 2010" color="#00FF00">
             <diagram:Datum key="January" value="140000" />
             <!-- ... -->
         </diagram:Model>
         
     </diagram:Diagram>
 

Here is an example of the image that could produce this component:

Notice that in case of multiple models injected into the component, only the first model defines the structure of the data. In consequence, all models injected in a diagram component must have the same keys that the first model.

Since:
0.4.0
Author:
Dominique Liard
See Also:
Model, DiagramView, HistogramView, CurveView, PieView

Field Summary
 
Fields inherited from class corelib.services.web.components.VisualComponent
cssClass, cssStyle, toolTipText, visible
 
Fields inherited from class corelib.services.web.components.WebComponent
dataBindings, webPage, xmlNode
 
Constructor Summary
Diagram()
           
 
Method Summary
 void component_load(WebPageEvent event)
          Fired when the web page is fully initialized.
 void component_renderBegin(WebPageEvent webPageEvent)
           
 void component_renderChildren(WebPageEvent webPageEvent)
           
 void component_renderEnd(WebPageEvent webPageEvent)
           
 int getCanvasHeight()
           Returns the height of the canvas used by this diagram component.
 int getCanvasWidth()
           Returns the width of the canvas used by this diagram component.
 java.lang.String getCaption()
          Returns the displayed caption for this diagram.
 void setCanvasHeight(int canvasHeight)
           Changes the height of the canvas used by this diagram component.
 void setCanvasWidth(int canvasWidth)
           Changes the width of the canvas used by this diagram component.
 void setCaption(java.lang.String caption)
          Set the displayed caption for this diagram.
 
Methods inherited from class corelib.services.web.components.VisualComponent
component_postRender, component_preRender, component_renderJavascriptLocalisation, encodeAttributeValue, getCssClass, getCssStyle, getOnClickListener, getSharedAttributesHtmlEncoding, getToolTipText, isVisible, renderElement, setCssClass, setCssStyle, setOnClickListener, setToolTipText, setVisible
 
Methods inherited from class corelib.services.web.components.WebComponent
addBindingExpression, addChildComponent, component_init, component_preRepeaterDuplications, getChildComponents, getDataBinding, getElementsByTagName, getId, getWebPage, getXmlNode, setId, setWebPage, setXmlNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Diagram

public Diagram()
Method Detail

getCaption

public java.lang.String getCaption()
Returns the displayed caption for this diagram.

Returns:
The displayed caption.

setCaption

public void setCaption(java.lang.String caption)
Set the displayed caption for this diagram.

Parameters:
caption - The new caption to display.

getCanvasWidth

public int getCanvasWidth()

Returns the width of the canvas used by this diagram component.

Notice that the diagram component can be bigger than the canvas ( per example, the diagram legend is not displayed by the canvas).

Returns:
The width of the canvas used by this diagram component.

setCanvasWidth

public void setCanvasWidth(int canvasWidth)

Changes the width of the canvas used by this diagram component.

Notice that the diagram component can be bigger than the canvas ( per example, the diagram legend is not displayed by the canvas).

Parameters:
canvasWidth - The new width for the canvas.

getCanvasHeight

public int getCanvasHeight()

Returns the height of the canvas used by this diagram component.

Notice that the diagram component can be bigger than the canvas ( per example, the diagram legend is not displayed by the canvas).

Returns:
The height of the canvas used by this diagram component.

setCanvasHeight

public void setCanvasHeight(int canvasHeight)

Changes the height of the canvas used by this diagram component.

Notice that the diagram component can be bigger than the canvas ( per example, the diagram legend is not displayed by the canvas).

Parameters:
canvasHeight - The new height for the canvas.

component_load

public void component_load(WebPageEvent event)
Description copied from class: WebComponent
Fired when the web page is fully initialized.

Overrides:
component_load in class WebComponent
Parameters:
event - Qualify the current web page event.

component_renderBegin

public void component_renderBegin(WebPageEvent webPageEvent)
Overrides:
component_renderBegin in class VisualComponent

component_renderChildren

public void component_renderChildren(WebPageEvent webPageEvent)
Overrides:
component_renderChildren in class VisualComponent

component_renderEnd

public void component_renderEnd(WebPageEvent webPageEvent)
Overrides:
component_renderEnd in class VisualComponent


CAUTION: Ellipse is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of Ellipse Framework.

Copyright 2012 Infini Software - All Rights Reserved.