Class MultipleGradientPaint
- All Implemented Interfaces:
Paint
- Direct Known Subclasses:
LinearGradientPaint
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumColors spaces for gradients.static enumCycle methods for gradients. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultipleGradientPaint(float[] fractions, int[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, Transform gradientTransform) Creates a new MultipleGradient paint -
Method Summary
Modifier and TypeMethodDescriptionint[]Gets the colors used in the gradient.Gets the color space for the gradient.Gets the cycle method.float[]Gets the fractional positions for the color gradients.Gets the gradient transform.intGets the transparency for the gradient.voidsetColors(int[] colors) Sets the colors used in the gradient.voidsetColorSpace(MultipleGradientPaint.ColorSpaceType colorSpaceType) Sets the color space for the gradient.voidsetCycleMethod(MultipleGradientPaint.CycleMethod cycleMethod) Sets the cycle method.voidsetFractions(float[] fractions) Sets the fractional positions of the color gradients.voidsetTransform(Transform transform) Sets the transform for the gradient.voidsetTransparency(int transparency) Sets the transparency for the gradient.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Constructor Details
-
MultipleGradientPaint
protected MultipleGradientPaint(float[] fractions, int[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, Transform gradientTransform) Creates a new MultipleGradient paint
Parameters
-
fractions: The fractions representing positions where the corresponding color starts. Values between 0 and 1. -
colors: The colors that are part of the gradient. Should have same number of colors as fractions. -
cycleMethod: The cycle method for the gradient. -
colorSpace: The color space for the gradient. -
gradientTransform: Transform for the gradient. Not used.
-
-
-
Method Details
-
getColorSpace
Gets the color space for the gradient.
Returns
the colorSpaceType
-
setColorSpace
Sets the color space for the gradient.
Parameters
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: the colors to set
-
getCycleMethod
Gets the cycle method.
Returns
the cycleMethod
-
setCycleMethod
Sets the cycle method.
Parameters
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: the fractions to set
-
getTransform
Gets the gradient transform. Not used currently.
Returns
the transform
-
setTransform
Sets the transform for the gradient. NOt used currently.
Parameters
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: the transparency to set
-