|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecteu.hansolo.gradients.ConicalGradientPaint
public final class ConicalGradientPaint extends Object
A paint class that creates conical gradients around a given center point It could be used in the same way as LinearGradientPaint and RadialGradientPaint and follows the same syntax. You could use floats from 0.0 to 1.0 for the fractions which is standard but it's also possible to use angles from 0.0 to 360 degrees which is most of the times much easier to handle. Gradients always start at the top with a clockwise direction and you could rotate the gradient around the center by given offset. The offset could also be defined from -0.5 to +0.5 or -180 to +180 degrees. If you would like to use degrees instead of values from 0 to 1 you have to use the full constructor and set the USE_DEGREES variable to true
| Nested Class Summary | |
|---|---|
private class |
ConicalGradientPaint.ConicalGradientPaintContext
|
| Field Summary | |
|---|---|
private double[] |
ALPHA_STEP_LOOKUP
|
private double[] |
BLUE_STEP_LOOKUP
|
private Point2D |
CENTER
|
private Color[] |
COLORS
|
private double[] |
FRACTION_ANGLES
|
private double[] |
GREEN_STEP_LOOKUP
|
private static float |
INT_TO_FLOAT_CONST
|
private double[] |
RED_STEP_LOOKUP
|
| Constructor Summary | |
ConicalGradientPaint(Point2D CENTER, float[] GIVEN_FRACTIONS, Color[] GIVEN_COLORS)
Standard constructor which takes the FRACTIONS in values from 0.0f to 1.0f |
|
ConicalGradientPaint(boolean USE_DEGREES, Point2D CENTER, float GIVEN_OFFSET, float[] GIVEN_FRACTIONS, Color[] GIVEN_COLORS)
Enhanced constructor which takes the FRACTIONS in degress from 0.0f to 360.0f and also an GIVEN_OFFSET in degrees around the rotation CENTER |
|
| Method Summary | |
|---|---|
PaintContext
|
createContext(ColorModel COLOR_MODEL, Rectangle DEVICE_BOUNDS, Rectangle2D USER_BOUNDS, AffineTransform TRANSFORM, RenderingHints HINTS)
|
Color
|
getColorFromFraction(Color START_COLOR, Color DESTINATION_COLOR, int RANGE, int VALUE)
With the START_COLOR at the beginning and the DESTINATION_COLOR at the end of the given RANGE the method will calculate and return the color that equals the given VALUE. |
int
|
getTransparency()
|
private HashMap
|
recalculate(List FRACTION_LIST, List COLOR_LIST, float OFFSET)
Recalculates the fractions in the FRACTION_LIST and their associated colors in the COLOR_LIST with a given OFFSET. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private final double[] ALPHA_STEP_LOOKUP
private final double[] BLUE_STEP_LOOKUP
private final Point2D CENTER
private final Color[] COLORS
private final double[] FRACTION_ANGLES
private final double[] GREEN_STEP_LOOKUP
private static final float INT_TO_FLOAT_CONST
private final double[] RED_STEP_LOOKUP
| Constructor Detail |
|---|
public ConicalGradientPaint(Point2D CENTER, float[] GIVEN_FRACTIONS, Color[] GIVEN_COLORS)
public ConicalGradientPaint(boolean USE_DEGREES, Point2D CENTER, float GIVEN_OFFSET, float[] GIVEN_FRACTIONS, Color[] GIVEN_COLORS)
| Method Detail |
|---|
@Override public PaintContext createContext(ColorModel COLOR_MODEL, Rectangle DEVICE_BOUNDS, Rectangle2D USER_BOUNDS, AffineTransform TRANSFORM, RenderingHints HINTS)
public Color getColorFromFraction(Color START_COLOR, Color DESTINATION_COLOR, int RANGE, int VALUE)
@Override public int getTransparency()
private HashMap recalculate(List FRACTION_LIST, List COLOR_LIST, float OFFSET)
Groovy Documentation