|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.java2d.IlvMultipleGradientPaint
ilog.views.java2d.IlvLinearGradientPaint
public class IlvLinearGradientPaint
This class defines a multiple linear color gradient paint that will be
used to fill Java 2 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:

Paint,
IlvMultipleGradientPaint| Field Summary |
|---|
| Fields inherited from class ilog.views.java2d.IlvMultipleGradientPaint |
|---|
LINEAR_RGB, SPREAD_PAD, SPREAD_REFLECT, SPREAD_REPEAT, SRGB |
| Fields inherited from interface java.awt.Transparency |
|---|
BITMASK, OPAQUE, TRANSLUCENT |
| Constructor Summary | |
|---|---|
IlvLinearGradientPaint(float x1,
float y1,
float x2,
float y2,
float[] stops,
Color[] colors,
boolean adapt)
Builds an IlvLinearGradientPaint. |
|
IlvLinearGradientPaint(float x1,
float y1,
float x2,
float y2,
float[] stops,
Color[] colors,
short spreadMethod,
boolean adapt)
Builds an IlvLinearGradientPaint. |
|
IlvLinearGradientPaint(IlvInputStream stream)
Builds an IlvLinearGradientPaint from an
IlvInputStream. |
|
IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
boolean adapt)
Builds an IlvLinearGradientPaint. |
|
IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
short spreadMethod,
boolean adapt)
Builds an IlvLinearGradientPaint. |
|
IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
short spreadMethod,
short colorSpace,
AffineTransform transform,
boolean adapt)
Builds an IlvLinearGradientPaint. |
|
| Method Summary | |
|---|---|
PaintContext |
createContext(ColorModel cm,
Rectangle deviceBounds,
Rectangle2D userBounds,
AffineTransform transform,
RenderingHints hints)
Creates and returns a context used to generate the gradient. |
Point2D |
getEnd()
Returns the end point for the gradient. |
Point2D |
getStart()
Returns the start point for the gradient. |
void |
write(IlvOutputStream stream)
Writes the IlvLinearGradientPaint to an
IlvOutputStream. |
| Methods inherited from class ilog.views.java2d.IlvMultipleGradientPaint |
|---|
getColors, getColorSpace, getSpreadMethod, getStops, getTransform, getTransparency, isAdapting |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvLinearGradientPaint(float x1,
float y1,
float x2,
float y2,
float[] stops,
Color[] colors,
boolean adapt)
IlvLinearGradientPaint.
x1 - x coordinate of the gradient axis start point.y1 - y coordinate of the gradient axis start point.x2 - x coordinate of the gradient axis end point.y2 - y coordinate of the gradient axis end point.stops - Array of stops on the gradient axis.colors - Array of colors on the gradient axis.adapt - true if the gradient should be adapted to its
displaying area.
public IlvLinearGradientPaint(float x1,
float y1,
float x2,
float y2,
float[] stops,
Color[] colors,
short spreadMethod,
boolean adapt)
IlvLinearGradientPaint.
x1 - x coordinate of the gradient axis start point.y1 - y coordinate of the gradient axis start point.x2 - x coordinate of the gradient axis end point.y2 - y coordinate of the gradient axis end point.stops - Array of stops on the gradient axis.colors - Array of colors on the gradient axis.spreadMethod - How to fill the remainder region.adapt - true if the gradient should be adapted to its
displaying area.IlvMultipleGradientPaint.SPREAD_PAD,
IlvMultipleGradientPaint.SPREAD_REPEAT,
IlvMultipleGradientPaint.SPREAD_REFLECT
public IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
boolean adapt)
IlvLinearGradientPaint.
start - Coordinates of the gradient axis start point.end - Coordinates of the gradient axis end point.stops - Array of stops on the gradient axis.colors - Array of colors on the gradient axis.adapt - true if the gradient should be adapted to its
displaying area.
public IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
short spreadMethod,
boolean adapt)
IlvLinearGradientPaint.
start - Coordinates of the gradient axis start point.end - Coordinates of the gradient axis end point.stops - Array of stops on the gradient axis.colors - Array of colors on the gradient axis.spreadMethod - How to fill the remainder region.adapt - true if the gradient should be adapted to its
displaying area.IlvMultipleGradientPaint.SPREAD_PAD,
IlvMultipleGradientPaint.SPREAD_REPEAT,
IlvMultipleGradientPaint.SPREAD_REFLECT
public IlvLinearGradientPaint(Point2D start,
Point2D end,
float[] stops,
Color[] colors,
short spreadMethod,
short colorSpace,
AffineTransform transform,
boolean adapt)
IlvLinearGradientPaint.
start - Coordinates of the gradient axis start point.end - Coordinates of the gradient axis end point.stops - Array of stops on the gradient axis.colors - Array of colors on the gradient axis.spreadMethod - How to fill the remainder region.colorSpace - The color space into the color interpolation should
take place.transform - An additional transformer to apply when drawing the
gradient.adapt - true if the gradient should be adapted to its
displaying area.IlvMultipleGradientPaint.SPREAD_PAD,
IlvMultipleGradientPaint.SPREAD_REPEAT,
IlvMultipleGradientPaint.SPREAD_REFLECT,
IlvMultipleGradientPaint.SRGB,
IlvMultipleGradientPaint.LINEAR_RGB
public IlvLinearGradientPaint(IlvInputStream stream)
throws IOException,
IlvReadFileException
IlvLinearGradientPaint from an
IlvInputStream.
IOException
IlvReadFileException| Method Detail |
|---|
public PaintContext createContext(ColorModel cm,
Rectangle deviceBounds,
Rectangle2D userBounds,
AffineTransform transform,
RenderingHints hints)
createContext in interface Paintpublic Point2D getStart()
public Point2D getEnd()
public void write(IlvOutputStream stream)
throws IOException
IlvLinearGradientPaint to an
IlvOutputStream.
write in interface IlvPersistentObjectwrite in class IlvMultipleGradientPaintstream - the output stream
IOException - thrown when an exception occurs during
the write operation for this object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||