Class Gradient
- java.lang.Object
-
- org.pepstock.charba.client.commons.NativeObjectContainer
-
- org.pepstock.charba.client.colors.CanvasObject
-
- org.pepstock.charba.client.colors.Gradient
-
public final class Gradient extends CanvasObject
A gradient is an image consisting of a progressive transition between two or more colors.
Could beLinearorRadial.
Can be created using the size ofCANVASorCHARTarea.
The orientation to have a progressive transition, is defined by an enumeration in order to creates the gradient using the right coordinates and dimension, based on existing items (canvas and chart).- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)List<GradientColor>getColors()Returns the unmodifiable list of stopping colors.IsColorgetInterpolatedColorByOffset(double offset)Returns a color using the gradient as source of colors.GradientOrientationgetOrientation()Returns the gradient orientation.GradientScopegetScope()Returns the gradient scope.GradientTypegetType()Returns the gradient type.inthashCode()-
Methods inherited from class org.pepstock.charba.client.colors.CanvasObject
getId
-
Methods inherited from class org.pepstock.charba.client.commons.NativeObjectContainer
checkAndGetColor, checkDefaultValuesArgument, empty, getArrayValue, getElement, getIncrementalId, getNativeChart, getNativeEvent, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueForMultipleKeyTypes, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, isType, keys, loadNativeObject, remove, remove, setArrayValue, setArrayValue, setArrayValue, setElement, setEmptyValue, setNewIncrementalId, setNewIncrementalId, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
-
-
-
-
Method Detail
-
getType
public GradientType getType()
Returns the gradient type.- Returns:
- the gradient type
-
getOrientation
public GradientOrientation getOrientation()
Returns the gradient orientation.- Returns:
- the gradient orientation
-
getScope
public GradientScope getScope()
Returns the gradient scope.- Returns:
- the gradient scope
-
getColors
public List<GradientColor> getColors()
Returns the unmodifiable list of stopping colors.- Returns:
- the unmodifiable list of stopping colors.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classCanvasObject
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classCanvasObject
-
getInterpolatedColorByOffset
public IsColor getInterpolatedColorByOffset(double offset)
Returns a color using the gradient as source of colors.- Parameters:
offset- offset to search in the gradient colors- Returns:
- a color based on offset.
-
-