LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.app.behavior
Class LyChartBehavior

java.lang.Object
  extended by leon.app.behavior.LyBehavior
      extended by leon.app.behavior.LyActionBehavior
          extended by leon.app.behavior.LyChartBehavior
All Implemented Interfaces:
LyActionBehaviorInterface, LyBehaviorInterface, LyChartBehaviorInterface, LyFormBehaviorInterface, LyGetSessionInterface
Direct Known Subclasses:
LyMetricsChartBehavior

public class LyChartBehavior
extends LyActionBehavior
implements LyChartBehaviorInterface

This class implements the default behavior for actions that are controlled by a chart controller.

See Also:
LyChartController, LyGraphicalChartController, LyChartBehaviorInterface

Field Summary
static java.lang.String __VERSION
          File version
 
Constructor Summary
LyChartBehavior()
           
 
Method Summary
 void completeChart(LyGraphicalChartController controller, LyChart chart)
          Complete chart component before showing it.
 boolean displayLegendEmptyValues(LyGraphicalChartController controller)
          Indicates whether empty values must be displayed on the legend.
 boolean generateSensitiveAreas(LyGraphicalChartController controller)
          Indicates whether sensitive areas must be generated or not.
 java.lang.String getBarLegendLabel(LyGraphicalChartController controller, LyFieldInfo fieldInfo, LyObject object, java.lang.Object value)
          Gets the label that must be shown in the legend of a bar chart.
 LyObjectList getChartContext(LyController controller, LySession session, LyClassInfo classInfo, LyObjectList objects, LyWorkSpace parentContext)
          Gets the chart context objects list.
 LyInfoList<LyFieldInfo> getGroupFields(LyChartController controller)
          Gets fields that may be used as group variables in the chart.
 java.lang.String getImage(LyFormController formController, LyObject object)
          Gets the image associated to the given object for the given form.
 java.lang.String getScatterPlotLabel(LyGraphicalChartController controller, LyObject object)
          Gets the label that must be used for a point on a scatter plot chart.
 java.lang.String getScatterPlotLegendLabel(LyGraphicalChartController controller, LyObject object)
          Return the label that must be used for a point on a scatter plot legend.
 java.lang.Object getStringChartValue(LyGraphicalChartController controller, LyFieldInfo fieldInfo, LyObject object, java.lang.Object value, LyChartInfo.Type typeVar, boolean yAxis)
          Computes a printable string (if the given typeVar is text, number or date) or a Vector of strings (if the given fieldInfo is a multiple choice or relation) from the given value.
 java.lang.Object getValue(LyFormController form, LyFieldInfo fieldInfo)
          Gets value of the given fieldInfo.
 LyInfoList<LyFieldInfo> getXFields(LyChartController controller)
          Gets fields that may be used as X variables in the chart.
 LyInfoList<LyFieldInfo> getYFields(LyChartController controller)
          Gets fields that may be used as Y variables in the chart.
 boolean isDisplayed(LyFormController form, LyFieldInfo fieldInfo)
          Indicates if a fieldInfo is displayed in this form or not.
 boolean isLegendRightPositionned(LyGraphicalChartController controller)
          Indicates if the legend must be positionned on the right of the chart.
 boolean isViewResizable(LyController controller)
          Indicates whether a graphical chart view is resizable or not.
 
Methods inherited from class leon.app.behavior.LyActionBehavior
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from class leon.app.behavior.LyBehavior
free, getSession, handleDemand, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface leon.app.behaviorinterface.LyActionBehaviorInterface
endAction, getClientContext, getContextTitle, getHelpFile, getImage, getImageTooltip, getKeyValue, getMenuItemImage, getTitle, reset, startAction
 
Methods inherited from interface leon.app.behaviorinterface.LyBehaviorInterface
free, handleDemand, init
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
File version

See Also:
Constant Field Values
Constructor Detail

LyChartBehavior

public LyChartBehavior()
Method Detail

isViewResizable

public boolean isViewResizable(LyController controller)
Indicates whether a graphical chart view is resizable or not. Default implementation returns true if the controller is not a LyChartController, false otherwise.

Specified by:
isViewResizable in interface LyChartBehaviorInterface
Parameters:
controller - the current chart controller or graphical chart controller
Returns:
true if the view is resizable, false otherwise

getXFields

public LyInfoList<LyFieldInfo> getXFields(LyChartController controller)
Gets fields that may be used as X variables in the chart. Default implementation calls getFields(controller).

Specified by:
getXFields in interface LyChartBehaviorInterface
Parameters:
controller - The current chart controller.
Returns:
fields that may be used as X variables.
See Also:
getFields(LyChartController)

getYFields

public LyInfoList<LyFieldInfo> getYFields(LyChartController controller)
Gets fields that may be used as Y variables in the chart. Default implementation calls getFields(controller).

Specified by:
getYFields in interface LyChartBehaviorInterface
Parameters:
controller - The current chart controller.
Returns:
fields that may be used as Y variables.
See Also:
getFields(LyChartController)

getGroupFields

public LyInfoList<LyFieldInfo> getGroupFields(LyChartController controller)
Gets fields that may be used as group variables in the chart. Default implementation returns all fields that are not multiple choice or relation fields.

Specified by:
getGroupFields in interface LyChartBehaviorInterface
Parameters:
controller - The current chart controller.
Returns:
the fields that may be used as group variables.

getImage

public java.lang.String getImage(LyFormController formController,
                                 LyObject object)
Gets the image associated to the given object for the given form. Default implementation does nothing and return null.

Specified by:
getImage in interface LyFormBehaviorInterface
Parameters:
formController - the form controller
object - object whose image is looked for
Returns:
Logical name of the image.

getValue

public java.lang.Object getValue(LyFormController form,
                                 LyFieldInfo fieldInfo)
Gets value of the given fieldInfo. The default implementation does nothing and return null.

Specified by:
getValue in interface LyFormBehaviorInterface
Parameters:
form - the current LyFormController instance.
fieldInfo - the fieldInfo that contains the value
Returns:
the value of the given fieldInfo as an Object

getChartContext

public LyObjectList getChartContext(LyController controller,
                                    LySession session,
                                    LyClassInfo classInfo,
                                    LyObjectList objects,
                                    LyWorkSpace parentContext)
Gets the chart context objects list.
If chart objects are selected (the given object list is not null) the return this list
else if the parent context is not null then return the parent context object list
else if the parent context is null then return a new worspace
else return null.

Specified by:
getChartContext in interface LyChartBehaviorInterface
Parameters:
controller - the controller
session - the current session
classInfo - the classInfo that contains values
objects - the selected objects of the current class
parentContext - the context of the parent class
Returns:
the context for the chart

isDisplayed

public boolean isDisplayed(LyFormController form,
                           LyFieldInfo fieldInfo)
Indicates if a fieldInfo is displayed in this form or not. Default implementation does nothing and return true.

Specified by:
isDisplayed in interface LyFormBehaviorInterface
Parameters:
form - the current LyFormController instance.
fieldInfo - the fieldInfo which is tested for addition in the view.
Returns:
true if the field should be added, false if it should be skipped.

getStringChartValue

public java.lang.Object getStringChartValue(LyGraphicalChartController controller,
                                            LyFieldInfo fieldInfo,
                                            LyObject object,
                                            java.lang.Object value,
                                            LyChartInfo.Type typeVar,
                                            boolean yAxis)
Computes a printable string (if the given typeVar is text, number or date) or a Vector of strings (if the given fieldInfo is a multiple choice or relation) from the given value.

Specified by:
getStringChartValue in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
fieldInfo - the concerned field info
object - the concerned object (may be null)
value - the value to transform into a string. It comes from the given fieldInfo
typeVar - the field type defined in LyChartInfo such as LyChartInfo.Type.DATE, LyChartInfo.Type.NUMBER and LyChartInfo.Type.TEXT
yAxis - indicates whether the value is computed for y or x axis
Returns:
a String corresponding to the value, or a Vector of Strings if it is a multiple choice or relation.
See Also:
LyChartInfo

getBarLegendLabel

public java.lang.String getBarLegendLabel(LyGraphicalChartController controller,
                                          LyFieldInfo fieldInfo,
                                          LyObject object,
                                          java.lang.Object value)
Gets the label that must be shown in the legend of a bar chart. The default implementation does nothing and return null.

Specified by:
getBarLegendLabel in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
fieldInfo - the concerned field info
object - the concerned object (may be null)
value - the value to transform into a string for the legend label. Comes from the given fieldInfo.
Returns:
null if the default label must be used, a string value otherwise

getScatterPlotLabel

public java.lang.String getScatterPlotLabel(LyGraphicalChartController controller,
                                            LyObject object)
Gets the label that must be used for a point on a scatter plot chart.

Specified by:
getScatterPlotLabel in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
object - the object concerned
Returns:
the label that must be used for a given point

getScatterPlotLegendLabel

public java.lang.String getScatterPlotLegendLabel(LyGraphicalChartController controller,
                                                  LyObject object)
Return the label that must be used for a point on a scatter plot legend.

Specified by:
getScatterPlotLegendLabel in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
object - the object concerned
Returns:
null if label used on the chart must be used, a string value otherwise

isLegendRightPositionned

public boolean isLegendRightPositionned(LyGraphicalChartController controller)
Indicates if the legend must be positionned on the right of the chart.

Specified by:
isLegendRightPositionned in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
Returns:
true if the legend must be positionned on the right of the chart, false otherwise

displayLegendEmptyValues

public boolean displayLegendEmptyValues(LyGraphicalChartController controller)
Indicates whether empty values must be displayed on the legend.

Specified by:
displayLegendEmptyValues in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
Returns:
true if empty values must be displayed on the legend, false otherwise

generateSensitiveAreas

public boolean generateSensitiveAreas(LyGraphicalChartController controller)
Indicates whether sensitive areas must be generated or not.

Specified by:
generateSensitiveAreas in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
Returns:
true if sensitive areas must be generated on the chart, false otherwise

completeChart

public void completeChart(LyGraphicalChartController controller,
                          LyChart chart)
Complete chart component before showing it.
The default implementation does nothing.

Specified by:
completeChart in interface LyChartBehaviorInterface
Parameters:
controller - the current controller instance
chart - the chart component

(c) January 2013 - W4 S.A.

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