FileDocCategorySizeDatePackage
NinePatchDrawable.javaAPI DocAndroid 1.5 API3091Wed May 06 22:42:02 BST 2009com.android.layoutlib.bridge

NinePatchDrawable

public class NinePatchDrawable extends android.graphics.drawable.Drawable

Fields Summary
private com.android.ninepatch.NinePatch
m9Patch
Constructors Summary
NinePatchDrawable(com.android.ninepatch.NinePatch ninePatch)

        m9Patch = ninePatch;
    
Methods Summary
public voiddraw(android.graphics.Canvas canvas)

        if (canvas instanceof BridgeCanvas) {
            BridgeCanvas bridgeCanvas = (BridgeCanvas)canvas;
            
            Rect r = getBounds();
            m9Patch.draw(bridgeCanvas.getGraphics2d(), r.left, r.top, r.width(), r.height());
            
            return;
        }

        throw new UnsupportedOperationException();
    
public intgetIntrinsicHeight()
Return the intrinsic height of the underlying drawable object. Returns -1 if it has no intrinsic height, such as with a solid color.

        return m9Patch.getHeight();
    
public intgetIntrinsicWidth()
Return the intrinsic width of the underlying drawable object. Returns -1 if it has no intrinsic width, such as with a solid color.

        return m9Patch.getWidth();
    
public intgetMinimumHeight()

        return m9Patch.getHeight();
    
public intgetMinimumWidth()

        return m9Patch.getWidth();
    
public intgetOpacity()

        // FIXME
        return 0xFF;
    
public booleangetPadding(android.graphics.Rect padding)
Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds. Positive values move toward the center of the Drawable (set Rect.inset). Returns true if this drawable actually has a padding, else false. When false is returned, the padding is always set to 0.

        int[] padd = new int[4];
        m9Patch.getPadding(padd);
        padding.left = padd[0];
        padding.top = padd[1];
        padding.right = padd[2];
        padding.bottom = padd[3];
        return true;
    
public voidsetAlpha(int arg0)

        // FIXME !
    
public voidsetColorFilter(android.graphics.ColorFilter arg0)

        // FIXME