public class SpenFillColorEffect extends SpenFillEffectBase
| Modifier and Type | Class and Description |
|---|---|
static class |
SpenFillColorEffect.GradientColor
Gradient information.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
COLOR_GRADIENT
Gradient Color
|
static int |
COLOR_SOLID
Solid Color
|
static int |
GRADIENT_LINEAR
Linear Gradient
|
static int |
GRADIENT_RADIAL
Radial Gradient
|
static int |
GRADIENT_RECTANGULAR
Rectangular Gradient
|
TYPE_COLOR, TYPE_IMAGE, TYPE_PATTERN| Constructor and Description |
|---|
SpenFillColorEffect()
Creates a SpenFillColorEffect instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
appendGradientColor(SpenFillColorEffect.GradientColor gradientColor)
Append gradient color to the end of gradient color list.
|
int |
getColorType()
Get type of the fill color.
|
SpenFillColorEffect.GradientColor |
getGradientColor(int id)
Get gradient color of specified id
|
int |
getGradientColorCount()
Get the number of gradient colors.
|
int |
getGradientColorId(int index)
Get
index th gradient color id. |
PointF |
getGradientPosition()
Get center position of the gradient color.
|
int |
getGradientType()
Get type of the gradient color.
|
int |
getLinearGradientAngle()
Get angle of the linear gradient.
|
int |
getSolidColor()
Get color of the solid color.
|
boolean |
isGradientRotatable()
Get the flag which indicates the gradient color can be rotated or not.
|
void |
removeGradientColor(int id)
Remove gradient color
|
void |
setColorType(int type)
Set type of the fill color.
|
void |
setGradientColor(int id,
SpenFillColorEffect.GradientColor gradientColor)
Set gradient color.
|
void |
setGradientPosition(PointF pos)
Set center position of the gradient color(radial and rectangular).
|
void |
setGradientRotatable(boolean enable)
Set the flag which indicates the gradient color can be rotated or not.
|
void |
setGradientType(int gradientType)
Set type of the gradient color.
|
void |
setLinearGradientAngle(int degree)
Set angle of the linear gradient.
|
void |
setSolidColor(int color)
Set color of the solid color.
|
createFillEffect, getTypepublic static final int COLOR_SOLID
public static final int COLOR_GRADIENT
public static final int GRADIENT_LINEAR
public static final int GRADIENT_RADIAL
public static final int GRADIENT_RECTANGULAR
public SpenFillColorEffect()
appendGradientColor(GradientColor)public int getColorType()
setColorType(int)public void setColorType(int type)
type - Type of the fill color.IllegalArgumentException - Thrown if the type is not COLOR_SOLID or COLOR_GRADIENT.getColorType()public int getSolidColor()
setSolidColor(int)public void setSolidColor(int color)
color - Color of the solid color.getSolidColor()public int getGradientType()
setGradientType(int)public void setGradientType(int gradientType)
gradientType - Type of the gradient color.IllegalArgumentException - Thrown if the gradientType is not GRADIENT_LINEAR,
GRADIENT_RADIAL or GRADIENT_RECTANGULAR.getGradientType()public void setGradientColor(int id,
SpenFillColorEffect.GradientColor gradientColor)
id - The id of a gradient color.gradientColor - The gradient color to set.IllegalArgumentException - Thrown if the parameter id does not exist or the parameter gradientColor is null.getGradientColor(int)public SpenFillColorEffect.GradientColor getGradientColor(int id)
id - The ID to get gradient color.IllegalArgumentException - Thrown if id does not exist.setGradientColor(int, GradientColor)public int getGradientColorId(int index)
index th gradient color id.index - Index of gradient colorindex th gradient colorIndexOutOfBoundsException - Thrown if index is out of bounds.appendGradientColor(GradientColor),
getGradientColorCount(),
getGradientColor(int),
removeGradientColor(int)public int getGradientColorCount()
appendGradientColor(GradientColor),
getGradientColor(int),
getGradientColorId(int),
removeGradientColor(int)public int appendGradientColor(SpenFillColorEffect.GradientColor gradientColor)
gradientColor - Gradient color to appendIllegalArgumentException - Thrown if the gradientColor is null.IllegalStateException - Thrown if the count of gradient colors reaches to maximum(10).getGradientColorCount(),
getGradientColor(int),
getGradientColorId(int),
removeGradientColor(int)public void removeGradientColor(int id)
id - The ID of gradient color to removeIllegalArgumentException - Thrown if id does not exist.IllegalStateException - Thrown if colors less than 3 for gradation.appendGradientColor(GradientColor),
getGradientColorCount(),
getGradientColor(int),
getGradientColorId(int)public void setLinearGradientAngle(int degree)
degree - degree of a linear gradientgetLinearGradientAngle()public int getLinearGradientAngle()
setLinearGradientAngle(int)public void setGradientPosition(PointF pos)
pos - Position of the gradient color.getGradientPosition()public PointF getGradientPosition()
setGradientPosition(PointF)public void setGradientRotatable(boolean enable)
enable - Indicates the gradient color can be rotated or not.isGradientRotatable()public boolean isGradientRotatable()
setGradientRotatable(boolean)