FileDocCategorySizeDatePackage
Shader_Delegate.javaAPI DocAndroid 5.1 API3317Thu Mar 12 22:22:44 GMT 2015android.graphics

Shader_Delegate

public abstract class Shader_Delegate extends Object
Delegate implementing the native methods of android.graphics.Shader Through the layoutlib_create tool, the original native methods of Shader 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 Shader class. This also serve as a base class for all Shader delegate classes.
see
DelegateManager

Fields Summary
protected static final com.android.layoutlib.bridge.impl.DelegateManager
sManager
private Matrix_Delegate
mLocalMatrix
Constructors Summary
Methods Summary
public static android.graphics.Shader_DelegategetDelegate(long nativeShader)


    // ---- Public Helper methods ----

         
        return sManager.getDelegate(nativeShader);
    
public abstract java.awt.PaintgetJavaPaint()

protected java.awt.geom.AffineTransformgetLocalMatrix()

        if (mLocalMatrix != null) {
            return mLocalMatrix.getAffineTransform();
        }

        return new java.awt.geom.AffineTransform();
    
public abstract java.lang.StringgetSupportMessage()

public static android.graphics.Shader.TileModegetTileMode(int tileMode)
Returns the {@link TileMode} matching the given int.

param
tileMode the tile mode int value
return
the TileMode enum.

        for (TileMode tm : TileMode.values()) {
            if (tm.nativeInt == tileMode) {
                return tm;
            }
        }

        assert false;
        return TileMode.CLAMP;
    
public abstract booleanisSupported()

static voidnativeDestructor(long native_shader)

        sManager.removeJavaReferenceFor(native_shader);
    
static voidnativeSetLocalMatrix(long native_shader, long matrix_instance)

        // get the delegate from the native int.
        Shader_Delegate shaderDelegate = sManager.getDelegate(native_shader);
        if (shaderDelegate == null) {
            return;
        }

        shaderDelegate.mLocalMatrix = Matrix_Delegate.getDelegate(matrix_instance);