|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecteu.hansolo.gradients.GradientWrapper
public class GradientWrapper extends Object
| Field Summary | |
|---|---|
private LinearGradientPaint |
GRADIENT
|
private Color[] |
colors
|
private float[] |
fractions
|
| Constructor Summary | |
GradientWrapper(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors)
|
|
GradientWrapper(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
|
|
GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors)
|
|
GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
|
|
GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform)
|
|
| Method Summary | |
|---|---|
private void
|
copyArrays(float[] FRACTIONS, Color[] colors)
Just create a local copy of the fractions and colors array |
PaintContext
|
createContext(ColorModel COLOR_MODEL, Rectangle DEVICE_BOUNDS, Rectangle2D USER_BOUNDS, AffineTransform X_FORM, RenderingHints HINTS)
|
Color
|
getColorAt(float FRACTION)
Returns the color that is defined by the given fraction in the linear gradient paint |
Point2D
|
getEndPoint()
Returns the point where the wrapped LinearGradientPaint will stop |
LinearGradientPaint
|
getGradient()
Returns the wrapped LinearGradientPaint |
Point2D
|
getStartPoint()
Returns the point where the wrapped LinearGradientPaint will start |
int
|
getTransparency()
|
private Color
|
interpolateColor(Color COLOR1, Color COLOR2, float FRACTION)
Returns the interpolated color that you get if you multiply the delta between color2 and color1 with the given fraction (for each channel) and interpolation. |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private final LinearGradientPaint GRADIENT
private Color[] colors
private float[] fractions
| Constructor Detail |
|---|
public GradientWrapper(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors)
public GradientWrapper(float startX, float startY, float endX, float endY, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
public GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors)
public GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod)
public GradientWrapper(Point2D start, Point2D end, float[] fractions, Color[] colors, MultipleGradientPaint.CycleMethod cycleMethod, MultipleGradientPaint.ColorSpaceType colorSpace, AffineTransform gradientTransform)
| Method Detail |
|---|
private void copyArrays(float[] FRACTIONS, Color[] colors)
@Override public PaintContext createContext(ColorModel COLOR_MODEL, Rectangle DEVICE_BOUNDS, Rectangle2D USER_BOUNDS, AffineTransform X_FORM, RenderingHints HINTS)
public Color getColorAt(float FRACTION)
public Point2D getEndPoint()
public LinearGradientPaint getGradient()
public Point2D getStartPoint()
@Override public int getTransparency()
private Color interpolateColor(Color COLOR1, Color COLOR2, float FRACTION)
COLOR1 - The first color as integer in the hex format 0xALPHA RED GREEN BLUE, e.g. 0xFF00FF00 for a pure greenCOLOR2 - The second color as integer in the hex format 0xALPHA RED GREEN BLUE e.g. 0xFFFF0000 for a pure redFRACTION - The fraction between those two colors that we would like to get e.g. 0.5f will result in the color 0xFF808000
Groovy Documentation