public abstract class MultipleGradientPaint

  1. Object
  2. MultipleGradientPaint

ImplementsPaint

Known subtypesLinearGradientPaint

A base class for Paints that use multiple gradients.

Nested types

enum MultipleGradientPaint.CycleMethodCycle methods for gradients.
enum MultipleGradientPaint.ColorSpaceTypeColors spaces for gradients.

Constructors

protected MultipleGradientPaint(float[] fractions, int[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, Transform gradientTransform)Creates a new MultipleGradient paint

Methods

public MultipleGradientPaint.ColorSpaceType getColorSpace()Gets the color space for the gradient.
public void setColorSpace(MultipleGradientPaint.ColorSpaceType colorSpaceType)Sets the color space for the gradient.
public int[] getColors()Gets the colors used in the gradient.
public void setColors(int[] colors)Sets the colors used in the gradient.
public MultipleGradientPaint.CycleMethod getCycleMethod()Gets the cycle method.
public void setCycleMethod(MultipleGradientPaint.CycleMethod cycleMethod)Sets the cycle method.
public float[] getFractions()Gets the fractional positions for the color gradients.
public void setFractions(float[] fractions)Sets the fractional positions of the color gradients.
public Transform getTransform()Gets the gradient transform.
public void setTransform(Transform transform)Sets the transform for the gradient.
public int getTransparency()Gets the transparency for the gradient.
public void setTransparency(int transparency)Sets the transparency for the gradient.

Inherited methods

Constructor details

MultipleGradientPaint

protected MultipleGradientPaint(float[] fractions, int[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, Transform gradientTransform)
Creates a new MultipleGradient paint

Parameters

fractions float[]
The fractions representing positions where the corresponding color starts. Values between 0 and 1.
colors int[]
The colors that are part of the gradient. Should have same number of colors as fractions.
cycleMethod MultipleGradientPaint.CycleMethod
The cycle method for the gradient.
colorSpace MultipleGradientPaint.ColorSpaceType
The color space for the gradient.
gradientTransform Transform
Transform for the gradient. Not used.

Method details

getColorSpace

public MultipleGradientPaint.ColorSpaceType getColorSpace()
Gets the color space for the gradient.

Returns

the colorSpaceType

setColorSpace

public void setColorSpace(MultipleGradientPaint.ColorSpaceType colorSpaceType)
Sets the color space for the gradient.

Parameters

colorSpaceType MultipleGradientPaint.ColorSpaceType
the colorSpaceType to set

getColors

public int[] getColors()
Gets the colors used in the gradient.

Returns

the colors

setColors

public void setColors(int[] colors)
Sets the colors used in the gradient.

Parameters

colors int[]
the colors to set

getCycleMethod

public MultipleGradientPaint.CycleMethod getCycleMethod()
Gets the cycle method.

Returns

the cycleMethod

setCycleMethod

public void setCycleMethod(MultipleGradientPaint.CycleMethod cycleMethod)
Sets the cycle method.

Parameters

cycleMethod MultipleGradientPaint.CycleMethod
the cycleMethod to set

getFractions

public float[] getFractions()
Gets the fractional positions for the color gradients.

Returns

the fractions

setFractions

public void setFractions(float[] fractions)
Sets the fractional positions of the color gradients.

Parameters

fractions float[]
the fractions to set

getTransform

public Transform getTransform()
Gets the gradient transform. Not used currently.

Returns

the transform

setTransform

public void setTransform(Transform transform)
Sets the transform for the gradient. NOt used currently.

Parameters

transform Transform
the transform to set

getTransparency

public int getTransparency()
Gets the transparency for the gradient.

Returns

the transparency

setTransparency

public void setTransparency(int transparency)
Sets the transparency for the gradient.

Parameters

transparency int
the transparency to set