Package org.pepstock.charba.client.data
Class DatasetCanvasObjectFactory
- java.lang.Object
-
- org.pepstock.charba.client.colors.CanvasObjectFactory
-
- org.pepstock.charba.client.data.DatasetCanvasObjectFactory
-
public final class DatasetCanvasObjectFactory extends CanvasObjectFactory
Utility class which creates a canvas gradient and pattern java script objects using a Charba gradient or pattern.
A Charba gradient or pattern describes how a canvas gradient or pattern must be created.- Author:
- Andrea "Stock" Stocchero
- See Also:
Gradient
,Pattern
,CanvasGradientItem
,CanvasPatternItem
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DatasetCanvasObjectFactory
get()
Singleton method to get instance.protected Area
getArea(IsChart chart, Gradient gradient)
Returns an area object used to define the area of LINEAR gradient.protected Center
getCenter(IsChart chart, Gradient gradient, int datasetIndex)
Returns the coordinates of a center of arc for RADIAL gradient.protected Radius
getRadius(IsChart chart, Gradient gradient, int datasetIndex)
Returns the inner and outer radius of arc for RADIAL gradient.-
Methods inherited from class org.pepstock.charba.client.colors.CanvasObjectFactory
clear, createGradient, createPattern, getScope, resetGradients
-
-
-
-
Method Detail
-
get
public static DatasetCanvasObjectFactory get()
Singleton method to get instance.- Returns:
- signleton instance
-
getArea
protected Area getArea(IsChart chart, Gradient gradient)
Description copied from class:CanvasObjectFactory
Returns an area object used to define the area of LINEAR gradient.- Specified by:
getArea
in classCanvasObjectFactory
- Parameters:
chart
- chart instancegradient
- gradient instance- Returns:
- an area object used to define the area of LINEAR gradient
-
getCenter
protected Center getCenter(IsChart chart, Gradient gradient, int datasetIndex)
Description copied from class:CanvasObjectFactory
Returns the coordinates of a center of arc for RADIAL gradient.- Specified by:
getCenter
in classCanvasObjectFactory
- Parameters:
chart
- chart instancegradient
- gradient instancedatasetIndex
- data set index- Returns:
- the coordinates of a center of arc
-
getRadius
protected Radius getRadius(IsChart chart, Gradient gradient, int datasetIndex)
Description copied from class:CanvasObjectFactory
Returns the inner and outer radius of arc for RADIAL gradient.- Specified by:
getRadius
in classCanvasObjectFactory
- Parameters:
chart
- chart instancegradient
- gradient instancedatasetIndex
- data set index- Returns:
- the inner and outer radius of arc
-
-