All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.beans.gauge.ColorGradient
java.lang.Object
|
+----COM.ibm.beans.gauge.ColorGradient
- public class ColorGradient
- extends Object
This class is used to define a color gradient which may be
used as input to subsequent gradient filled image generation
methods on the Fill class. It is a list of weighted color pairs
for each color transition in the gradient. The weighting is a
non-negative integer that influences the proportion of the total
gradient that is affected by the associated color. If we
construct a color gradient with a start weight of 2 and an end
weight of 1, the mid point of transition between the start and
end colors would occur two thirds of the way along the total
color gradient.
- See Also:
- Fill
charcoal
-
gold
-
hotAndCold
-
meadow
-
paintPots
-
rainbow
-
terracotta
-
twilight
-
ColorGradient()
- Construct a new empty ColorGradient.
ColorGradient(AlphaColor,
AlphaColor)
- Construct a new ColorGradient with the specified
AlphaColors, with both the weights set to 1.
ColorGradient(AlphaColor,
AlphaColor, int, int)
- Construct a new ColorGradient with the specified
AlphaColors and weights.
ColorGradient(AlphaColor[],
AlphaColor[])
- Construct a new ColorGradient with the specified
AlphaColors, with all the weights set to 1.
ColorGradient(AlphaColor[],
AlphaColor[], int[], int[])
- Construct a new ColorGradient with the specified
AlphaColors and weights.
ColorGradient(Color,
Color)
- Construct a new ColorGradient with the specified Colors,
with both the weights set to 1.
ColorGradient(Color,
Color, int, int)
- Construct a new ColorGradient with the specified Colors
and weights.
ColorGradient(Color[],
Color[])
- Construct a new ColorGradient with the specified Colors,
all the weights are set to 1.
ColorGradient(Color[],
Color[], int[], int[])
- Construct a new ColorGradient with the specified Colors
and weights.
ColorGradient(ColorGradient)
- Construct a new ColorGradient from an existing
ColorGradient.
ColorGradient(ColorGradient[])
- Construct a new ColorGradient by concatenating an array
of ColorGradients.
add(AlphaColor,
AlphaColor)
- Add a color transition to the end of the color gradient.
add(AlphaColor,
AlphaColor, int, int)
- Add a color transition to the end of the color gradient.
add(AlphaColor[],
AlphaColor[])
- Add color transitions to the end of the color gradient.
add(AlphaColor[],
AlphaColor[], int[], int[])
- Add color transitions to the end of the color gradient.
add(Color,
Color)
- Add a color transition to the end of the color gradient.
add(Color,
Color, int, int)
- Add a color transition to the end of the color gradient.
add(Color[],
Color[])
- Add color transitions to the end of the color gradient.
add(Color[],
Color[], int[], int[])
- Add color transitions to the end of the color gradient.
add(ColorGradient)
- Add a color gradient to the end of this color gradient.
add(ColorGradient[])
- Add an array of color gradients to the end of this color
gradient.
copyright()
- Copyright method to ensure that short copyright string
appears in class file.
getColorArray(int)
- Return an array of alpha colors, of the given length,
representing the color gradient.
isEmpty()
- Return true if the total weight is 1 or more
reverse()
- Return a new color gradient with the order of the colors
reversed.
totalWeight()
- Calculte the total weighting for the color gradient.
charcoal
public static final ColorGradient charcoal
twilight
public static final ColorGradient twilight
terracotta
public static final ColorGradient terracotta
gold
public static final ColorGradient gold
hotAndCold
public static final ColorGradient hotAndCold
meadow
public static final ColorGradient meadow
rainbow
public static final ColorGradient rainbow
paintPots
public static final ColorGradient paintPots
ColorGradient
public ColorGradient()
- Construct a new empty ColorGradient. Color transitions
must be added to it before it can be used.
ColorGradient
public ColorGradient(AlphaColor startColor,
AlphaColor endColor,
int startWeight,
int endWeight)
- Construct a new ColorGradient with the specified
AlphaColors and weights. If either of the weights are
less than zero they are assumed to be zero.
ColorGradient
public ColorGradient(Color startColor,
Color endColor,
int startWeight,
int endWeight)
- Construct a new ColorGradient with the specified Colors
and weights. If either of the weights are less than zero
they are assumed to be zero.
ColorGradient
public ColorGradient(AlphaColor startColor,
AlphaColor endColor)
- Construct a new ColorGradient with the specified
AlphaColors, with both the weights set to 1.
ColorGradient
public ColorGradient(Color startColor,
Color endColor)
- Construct a new ColorGradient with the specified Colors,
with both the weights set to 1.
ColorGradient
public ColorGradient(AlphaColor startColors[],
AlphaColor endColors[],
int startWeights[],
int endWeights[])
- Construct a new ColorGradient with the specified
AlphaColors and weights. If the arrays of colors are not
the same length then the longer one is cropped to the
length of the shorter one. If either of the weightings
arrays is longer than the color arrays then they are
cropped to the length of the color arrays. If either of
the weightings arrays is too short then they are padded
out with 1's to the appropriate length.
ColorGradient
public ColorGradient(Color startColors[],
Color endColors[],
int startWeights[],
int endWeights[])
- Construct a new ColorGradient with the specified Colors
and weights. If the arrays of colors are not the same
length then the longer one is cropped to the length of
the shorter one. If either of the weightings arrays is
longer than the color arrays then they are cropped to the
length of the color arrays. If either of the weightings
arrays is too short then they are padded out with 1's to
the appropriate length.
ColorGradient
public ColorGradient(AlphaColor startColors[],
AlphaColor endColors[])
- Construct a new ColorGradient with the specified
AlphaColors, with all the weights set to 1. If the arrays
of colors are not the same length then the longer one is
cropped to the length of the shorter one.
ColorGradient
public ColorGradient(Color startColors[],
Color endColors[])
- Construct a new ColorGradient with the specified Colors,
all the weights are set to 1. If the arrays of colors are
not the same length then the longer one is cropped to the
length of the shorter one.
ColorGradient
public ColorGradient(ColorGradient colorGradients[])
- Construct a new ColorGradient by concatenating an array
of ColorGradients.
ColorGradient
public ColorGradient(ColorGradient colorGradient)
- Construct a new ColorGradient from an existing
ColorGradient.
copyright
public static String copyright()
- Copyright method to ensure that short copyright string
appears in class file.
add
public void add(AlphaColor startColor,
AlphaColor endColor,
int startWeight,
int endWeight)
- Add a color transition to the end of the color gradient.
add
public void add(AlphaColor startColor,
AlphaColor endColor)
- Add a color transition to the end of the color gradient.
The weights are assumed to be 1.
add
public void add(Color startColor,
Color endColor)
- Add a color transition to the end of the color gradient.
The weights are assumed to be 1.
add
public void add(Color startColor,
Color endColor,
int startWeight,
int endWeight)
- Add a color transition to the end of the color gradient.
add
public void add(AlphaColor startColors[],
AlphaColor endColors[],
int startWeights[],
int endWeights[])
- Add color transitions to the end of the color gradient.
add
public void add(AlphaColor startColors[],
AlphaColor endColors[])
- Add color transitions to the end of the color gradient.
The weights are assumed to be 1.
add
public void add(Color startColors[],
Color endColors[])
- Add color transitions to the end of the color gradient.
The weights are assumed to be 1.
add
public void add(Color startColors[],
Color endColors[],
int startWeights[],
int endWeights[])
- Add color transitions to the end of the color gradient.
add
public void add(ColorGradient colorGradients[])
- Add an array of color gradients to the end of this color
gradient.
add
public void add(ColorGradient colorGradient)
- Add a color gradient to the end of this color gradient.
getColorArray
public synchronized AlphaColor[] getColorArray(int max)
- Return an array of alpha colors, of the given length,
representing the color gradient.
reverse
public synchronized ColorGradient reverse()
- Return a new color gradient with the order of the colors
reversed.
totalWeight
public int totalWeight()
- Calculte the total weighting for the color gradient. This
is the sum of all the before and after weightings.
isEmpty
public boolean isEmpty()
- Return true if the total weight is 1 or more
All Packages Class Hierarchy This Package Previous Next Index
Copyright ©
Taligent, Inc. 1996 - 1997.
Copyright © IBM Corporation 1996 - 1997.
All Rights Reserved.