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

Variable Index

 o charcoal
 
 o gold
 
 o hotAndCold
 
 o meadow
 
 o paintPots
 
 o rainbow
 
 o terracotta
 
 o twilight
 

Constructor Index

 o ColorGradient()
Construct a new empty ColorGradient.
 o ColorGradient(AlphaColor, AlphaColor)
Construct a new ColorGradient with the specified AlphaColors, with both the weights set to 1.
 o ColorGradient(AlphaColor, AlphaColor, int, int)
Construct a new ColorGradient with the specified AlphaColors and weights.
 o ColorGradient(AlphaColor[], AlphaColor[])
Construct a new ColorGradient with the specified AlphaColors, with all the weights set to 1.
 o ColorGradient(AlphaColor[], AlphaColor[], int[], int[])
Construct a new ColorGradient with the specified AlphaColors and weights.
 o ColorGradient(Color, Color)
Construct a new ColorGradient with the specified Colors, with both the weights set to 1.
 o ColorGradient(Color, Color, int, int)
Construct a new ColorGradient with the specified Colors and weights.
 o ColorGradient(Color[], Color[])
Construct a new ColorGradient with the specified Colors, all the weights are set to 1.
 o ColorGradient(Color[], Color[], int[], int[])
Construct a new ColorGradient with the specified Colors and weights.
 o ColorGradient(ColorGradient)
Construct a new ColorGradient from an existing ColorGradient.
 o ColorGradient(ColorGradient[])
Construct a new ColorGradient by concatenating an array of ColorGradients.

Method Index

 o add(AlphaColor, AlphaColor)
Add a color transition to the end of the color gradient.
 o add(AlphaColor, AlphaColor, int, int)
Add a color transition to the end of the color gradient.
 o add(AlphaColor[], AlphaColor[])
Add color transitions to the end of the color gradient.
 o add(AlphaColor[], AlphaColor[], int[], int[])
Add color transitions to the end of the color gradient.
 o add(Color, Color)
Add a color transition to the end of the color gradient.
 o add(Color, Color, int, int)
Add a color transition to the end of the color gradient.
 o add(Color[], Color[])
Add color transitions to the end of the color gradient.
 o add(Color[], Color[], int[], int[])
Add color transitions to the end of the color gradient.
 o add(ColorGradient)
Add a color gradient to the end of this color gradient.
 o add(ColorGradient[])
Add an array of color gradients to the end of this color gradient.
 o copyright()
Copyright method to ensure that short copyright string appears in class file.
 o getColorArray(int)
Return an array of alpha colors, of the given length, representing the color gradient.
 o isEmpty()
Return true if the total weight is 1 or more
 o reverse()
Return a new color gradient with the order of the colors reversed.
 o totalWeight()
Calculte the total weighting for the color gradient.

Variables

 o charcoal

 public static final ColorGradient charcoal

 o twilight

 public static final ColorGradient twilight

 o terracotta

 public static final ColorGradient terracotta

 o gold

 public static final ColorGradient gold

 o hotAndCold

 public static final ColorGradient hotAndCold

 o meadow

 public static final ColorGradient meadow

 o rainbow

 public static final ColorGradient rainbow

 o paintPots

 public static final ColorGradient paintPots

Constructors

 o ColorGradient

 public ColorGradient()
Construct a new empty ColorGradient. Color transitions must be added to it before it can be used.

 o 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.

 o 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.

 o ColorGradient

 public ColorGradient(AlphaColor startColor,
                      AlphaColor endColor)
Construct a new ColorGradient with the specified AlphaColors, with both the weights set to 1.

 o ColorGradient

 public ColorGradient(Color startColor,
                      Color endColor)
Construct a new ColorGradient with the specified Colors, with both the weights set to 1.

 o 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.

 o 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.

 o 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.

 o 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.

 o ColorGradient

 public ColorGradient(ColorGradient colorGradients[])
Construct a new ColorGradient by concatenating an array of ColorGradients.

 o ColorGradient

 public ColorGradient(ColorGradient colorGradient)
Construct a new ColorGradient from an existing ColorGradient.

Methods

 o copyright

 public static String copyright()
Copyright method to ensure that short copyright string appears in class file.

 o add

 public void add(AlphaColor startColor,
                 AlphaColor endColor,
                 int startWeight,
                 int endWeight)
Add a color transition to the end of the color gradient.

 o 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.

 o 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.

 o add

 public void add(Color startColor,
                 Color endColor,
                 int startWeight,
                 int endWeight)
Add a color transition to the end of the color gradient.

 o add

 public void add(AlphaColor startColors[],
                 AlphaColor endColors[],
                 int startWeights[],
                 int endWeights[])
Add color transitions to the end of the color gradient.

 o 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.

 o 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.

 o add

 public void add(Color startColors[],
                 Color endColors[],
                 int startWeights[],
                 int endWeights[])
Add color transitions to the end of the color gradient.

 o add

 public void add(ColorGradient colorGradients[])
Add an array of color gradients to the end of this color gradient.

 o add

 public void add(ColorGradient colorGradient)
Add a color gradient to the end of this color gradient.

 o getColorArray

 public synchronized AlphaColor[] getColorArray(int max)
Return an array of alpha colors, of the given length, representing the color gradient.

 o reverse

 public synchronized ColorGradient reverse()
Return a new color gradient with the order of the colors reversed.

 o totalWeight

 public int totalWeight()
Calculte the total weighting for the color gradient. This is the sum of all the before and after weightings.

 o 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.