Build 1.0_r1(from source)

android.graphics.drawable.shapes
Class RectShape

java.lang.Object
  extended by android.graphics.drawable.shapes.Shape
      extended by android.graphics.drawable.shapes.RectShape
Direct Known Subclasses:
ArcShape, OvalShape, RoundRectShape

public class RectShape
extends Shape

Defines a rectangle shape. The rectangle can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the RectShape to a ShapeDrawable.


Constructor Summary
RectShape()
          RectShape constructor.
 
Method Summary
 void draw(Canvas canvas, Paint paint)
          Draw this shape into the provided Canvas, with the provided Paint.
protected  void onResize(float width, float height)
          Callback method called when Shape.resize(float,float) is executed.
protected  RectF rect()
          Returns the RectF that defines this rectangle's bounds.
 
Methods inherited from class android.graphics.drawable.shapes.Shape
getHeight, getWidth, hasAlpha, resize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectShape

public RectShape()
RectShape constructor.

Method Detail

draw

public void draw(Canvas canvas,
                 Paint paint)
Description copied from class: Shape
Draw this shape into the provided Canvas, with the provided Paint. Before calling this, you must call Shape.resize(float,float).

Specified by:
draw in class Shape
Parameters:
canvas - the Canvas within which this shape should be drawn
paint - the Paint object that defines this shape's characteristics

onResize

protected void onResize(float width,
                        float height)
Description copied from class: Shape
Callback method called when Shape.resize(float,float) is executed.

Overrides:
onResize in class Shape
Parameters:
width - the new width of the Shape
height - the new height of the Shape

rect

protected final RectF rect()
Returns the RectF that defines this rectangle's bounds.


Build 1.0_r1(from source)

Please submit a feedback, bug or feature