- java.lang.Object
-
- java.awt.MultipleGradientPaint
-
- All Implemented Interfaces:
Paint,Transparency
- Direct Known Subclasses:
LinearGradientPaint,RadialGradientPaint
public abstract class MultipleGradientPaint extends Object implements Paint
This is the superclass for Paints which use a multiple color gradient to fill in their raster. It provides storage for variables and enumerated values common toLinearGradientPaintandRadialGradientPaint.- Since:
- 1.6
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultipleGradientPaint.ColorSpaceTypeThe color space in which to perform the gradient interpolation.static classMultipleGradientPaint.CycleMethodThe method to use when painting outside the gradient bounds.
-
Field Summary
-
Fields declared in interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Color[]getColors()Returns a copy of the array of colors used by this gradient.MultipleGradientPaint.ColorSpaceTypegetColorSpace()Returns the enumerated type which specifies color space for interpolation.MultipleGradientPaint.CycleMethodgetCycleMethod()Returns the enumerated type which specifies cycling behavior.float[]getFractions()Returns a copy of the array of floats used by this gradient to calculate color distribution.AffineTransformgetTransform()Returns a copy of the transform applied to the gradient.intgetTransparency()Returns the transparency mode for thisPaintobject.-
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods declared in interface java.awt.Paint
createContext
-
-
-
-
Method Detail
-
getFractions
public final float[] getFractions()
Returns a copy of the array of floats used by this gradient to calculate color distribution. The returned array always has 0 as its first value and 1 as its last value, with increasing values in between.- Returns:
- a copy of the array of floats used by this gradient to calculate color distribution
-
getColors
public final Color[] getColors()
Returns a copy of the array of colors used by this gradient. The first color maps to the first value in the fractions array, and the last color maps to the last value in the fractions array.- Returns:
- a copy of the array of colors used by this gradient
-
getCycleMethod
public final MultipleGradientPaint.CycleMethod getCycleMethod()
Returns the enumerated type which specifies cycling behavior.- Returns:
- the enumerated type which specifies cycling behavior
-
getColorSpace
public final MultipleGradientPaint.ColorSpaceType getColorSpace()
Returns the enumerated type which specifies color space for interpolation.- Returns:
- the enumerated type which specifies color space for interpolation
-
getTransform
public final AffineTransform getTransform()
Returns a copy of the transform applied to the gradient.Note that if no transform is applied to the gradient when it is created, the identity transform is used.
- Returns:
- a copy of the transform applied to the gradient
-
getTransparency
public final int getTransparency()
Returns the transparency mode for thisPaintobject.- Specified by:
getTransparencyin interfaceTransparency- Returns:
OPAQUEif all colors used by thisPaintobject are opaque,TRANSLUCENTif at least one of the colors used by thisPaintobject is not opaque.- See Also:
Transparency
-
-