|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.graphics.components.ColorPosition
public class ColorPosition
The ColorPosition class supports an association between a color and a position to facilitate defining a color spectrum.
Although the usage of this class may evolve and could vary later, the origin intent of this class is to support the specification of a color spectrum in theDataElementStyles. Each ColorPosition object defines a color
inflection point along the color spectrum defined along a normalized range of 0 to 1 (inclusive).
This class is immutable.
| Field Summary | |
|---|---|
static java.lang.String |
RB_KEY
|
| Constructor Summary | |
|---|---|
ColorPosition(java.awt.Color newActiveColor,
java.awt.Color newColor,
double newPosition)
Deprecated. scheduled for deletion |
|
ColorPosition(java.awt.Color newColor,
double newPosition)
Constructs a ColorPosition object from the specified color double value pair
for use in defining a color inflection point in a color spectrum. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Determines whether another object is equal to this ColorPosition. |
java.awt.Color |
getColor()
Returns the color portion of this inflection point. |
double |
getPosition()
Returns the position of this color inflection point. |
static ColorPosition[] |
newContinuousColorRange(java.awt.Color[] colors,
double[] positions)
Convenience method for constructing a color position array suitable for defining color ranges. |
static ColorPosition[] |
newContinuousColorRange(double from,
double to,
double by,
java.awt.Color[] colorArray)
|
java.lang.String |
toString()
|
| Field Detail |
|---|
public static final java.lang.String RB_KEY
| Constructor Detail |
|---|
public ColorPosition(java.awt.Color newColor,
double newPosition)
ColorPosition object from the specified color double value pair
for use in defining a color inflection point in a color spectrum.
See the colorSpectrum property in the DataElementStyles class.
The color value must be non null. The position must be a real number (Double.NaN or infinities are not allowed)
newColor - the color of this inflection point in the color spectrumnewPosition - the position of this inflection point along the color spectrum range
java.lang.IllegalArgumentException - is thrown if color is null.
java.lang.IllegalArgumentException - is thrown if position is a Double.NaN or Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY
java.lang.IllegalArgumentException - is thrown if position is outside the 0.0 to 1.0 range.
public ColorPosition(java.awt.Color newActiveColor,
java.awt.Color newColor,
double newPosition)
ColorPosition object from the specified color double value pair
for use in defining a color inflection point in a color spectrum.
See the colorSpectrum property in the DataElementStyles class.
The color value must be non null. The position must be a real number (Double.NaN or infinities are not allowed)
newColor - the color of this inflection point in the color spectrumnewPosition - the position of this inflection point along the color spectrum range
java.lang.IllegalArgumentException - is thrown if color is null.
java.lang.IllegalArgumentException - is thrown if position is a Double.NaN or Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY
java.lang.IllegalArgumentException - is thrown if position is outside the 0.0 to 1.0 range.| Method Detail |
|---|
public static ColorPosition[] newContinuousColorRange(java.awt.Color[] colors,
double[] positions)
java.lang.IllegalArgumentException - is thrown if colors is null.
java.lang.IllegalArgumentException - is thrown if length of the colors array is 0.
java.lang.IllegalArgumentException - is thrown if a null entry is encountered in the colors array.
java.lang.IllegalArgumentException - is thrown if positions is null.
java.lang.IllegalArgumentException - is thrown if length of the positions array is less than 2.
java.lang.IllegalArgumentException - is thrown if a Double.NaN or infinity entry is encountered in the positions array.
java.lang.IllegalArgumentException - is thrown if the positions array is not in ascending order.
java.lang.IllegalArgumentException - is thrown if the positions array contains duplicate values.
public static ColorPosition[] newContinuousColorRange(double from,
double to,
double by,
java.awt.Color[] colorArray)
public java.awt.Color getColor()
public double getPosition()
public boolean equals(java.lang.Object obj)
ColorPosition.
The result is true if and only if the argument is not
null and is a ColorPosition object that has the same
property values as this object.
equals in class java.lang.Objectobj - the object to test for equality with this
ColorPosition
true if the objects are the same;
false otherwise.public java.lang.String toString()
toString in class java.lang.Object
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||