SweepGradient_Delegate.javaAPI DocAndroid 5.1 API8284Thu Mar 12 22:22:44 GMT


public class SweepGradient_Delegate extends Gradient_Delegate
Delegate implementing the native methods of Through the layoutlib_create tool, the original native methods of SweepGradient have been replaced by calls to methods of the same name in this delegate class. This class behaves like the original native implementation, but in Java, keeping previously native data into its own objects and mapping them to int that are sent back and forth between it and the original SweepGradient class. Because this extends {@link Shader_Delegate}, there's no need to use a {@link DelegateManager}, as all the Shader classes will be added to the manager owned by {@link Shader_Delegate}.

Fields Summary
private Paint
Constructors Summary
private SweepGradient_Delegate(float cx, float cy, int[] colors, float[] positions)
A subclass of Shader that draws a sweep gradient around a center point.

cx The x-coordinate of the center
cy The y-coordinate of the center
colors The colors to be distributed between around the center. There must be at least 2 colors in the array.
positions May be NULL. The relative position of each corresponding color in the colors array, beginning with 0 and ending with 1.0. If the values are not monotonic, the drawing may produce unexpected results. If positions is NULL, then the colors are automatically spaced evenly.

        super(colors, positions);
        mJavaPaint = new SweepGradientPaint(cx, cy, mColors, mPositions);
Methods Summary
public java.awt.PaintgetJavaPaint()

        return mJavaPaint;
static longnativeCreate1(float x, float y, int[] colors, float[] positions)

        SweepGradient_Delegate newDelegate = new SweepGradient_Delegate(x, y, colors, positions);
        return sManager.addNewDelegate(newDelegate);
static longnativeCreate2(float x, float y, int color0, int color1)

        return nativeCreate1(x, y, new int[] { color0, color1 }, null /*positions*/);