Build 1.0_r1(from source)

android.graphics.drawable.shapes
Class PathShape

java.lang.Object
  extended by android.graphics.drawable.shapes.Shape
      extended by android.graphics.drawable.shapes.PathShape

public class PathShape
extends Shape

Creates geometric paths, utilizing the Path class. The path can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the PathShape to a ShapeDrawable.


Constructor Summary
PathShape(Path path, float stdWidth, float stdHeight)
          PathShape 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.
 
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

PathShape

public PathShape(Path path,
                 float stdWidth,
                 float stdHeight)
PathShape constructor.

Parameters:
path - a Path that defines the geometric paths for this shape
stdWidth - the standard width for the shape. Any changes to the width with resize() will result in a width scaled based on the new width divided by this width.
stdHeight - the standard height for the shape. Any changes to the height with resize() will result in a height scaled based on the new height divided by this height.
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

Build 1.0_r1(from source)

Please submit a feedback, bug or feature