public class IlvLinearGradientPaint extends IlvMultipleGradientPaint
Shape
objects.
You can, for example, set it on an IlvGeneralPath
to fill
it.
The user must provide an array of floats in an increasing order specifying how to distribute the colors along the gradient. These values should range from 0.0 to 1.0 and act like keyframes along the gradient (they mark where the gradient should be exactly a particular color).
In the event that the user does not set the first keyframe value equal to 0 and the last keyframe value equal to 1, keyframes will be created at these positions, and the first and last colors will be replicated there.
The user may also select what action the IlvLinearGradientPaint
should take when filling color outside the start and end points. If no spread
method is specified, SPREAD_PAD will be chosen by default, so the endpoint
colors will be used to fill the remaining area.
Sample drawing produced by a linear gradient:
ilvLinearGradientPaint {
class : "ilog.views.util.java2d.IlvLinearGradientPaint(start,end,stops,colors,spreadMethod,colorSpace,transform,adapting)";
adapting : "false";
colors[0] : "green";
colors[1] : "red";
colorSpace : "SRGB";
end : "@#rectangle2D";
spreadMethod : "PAD";
start : "@#rectangle2D";
stops[0] : "2.0";
stops[1] : "2.0";
transparency : "OPAQUE";
}
Modifier and Type | Property and Description |
---|---|
boolean |
adapting
Sets true if the gradient is adapting itself on
the shape it is drawn. |
java.lang.String |
class
Builds an IlvLinearGradientPaint . |
java.awt.Color[] |
colors
Sets a copy of the array of colors used by this gradient. |
short |
colorSpace
Sets the interpolation color space of this gradient. |
java.awt.geom.Point2D |
end
Sets the end point for the gradient. |
short |
spreadMethod
Sets the spread method of the gradient. |
java.awt.geom.Point2D |
start
Sets the start point for the gradient. |
float[] |
stops
Sets a copy of the array of floats used by this gradient to calculate color distribution. |
int |
transparency
Sets the transparency mode for this gradient. |
public java.lang.String class
IlvLinearGradientPaint
.
class : "ilog.views.util.java2d.IlvLinearGradientPaint(start,end,stops,colors,spreadMethod,colorSpace,transform,adapting)";
public boolean adapting
true
if the gradient is adapting itself on
the shape it is drawn.
adapting : "false";
public java.awt.Color[] colors
colors[0] : "green";
colors[1] : "red";
public short colorSpace
colorSpace : "SRGB";
Allowed values: | ||
SRGB |
Indicates that the color interpolation should occur in sRGB space. (default) | |
LINEAR_RGB |
Indicates that the color interpolation should occur in linearized RGB space. |
public java.awt.geom.Point2D end
end : "@#rectangle2D";
Rectangle2D
for an example of implementing an end.public short spreadMethod
spreadMethod : "PAD";
Allowed values: | ||
PAD |
Indicates that if the gradient starts or ends inside the target region, the remainder region is filled with the terminal color of the gradient. | |
REFLECT |
Indicates that if the gradient starts or ends inside the target region, the gradient is reflected continuously until the remainder region is filled. | |
REPEAT |
Indicates that if the gradient starts or ends inside the target region, the gradient is repeated continuously until the remainder region is filled. |
public java.awt.geom.Point2D start
start : "@#rectangle2D";
Rectangle2D
for an example of implementing a start.public float[] stops
stops[0] : "2.0";
stops[1] : "2.0";
public int transparency
transparency : "OPAQUE";
Allowed values: | ||
OPAQUE |
Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0. | |
BITMASK |
Represents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0. | |
TRANSLUCENT |
Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0. |
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.