OvalShape
public class OvalShape
extends RectShape
Defines an oval shape. The oval can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the OvalShape to a ShapeDrawable
.
Summary
Public methods |
void |
draw(Canvas canvas, Paint paint) Draw this shape into the provided Canvas, with the provided Paint. |
void |
getOutline(Outline outline) Compute the Outline of the shape and return it in the supplied Outline parameter. |
Inherited methods |
From class android.graphics.drawable.shapes.RectShape
RectShape |
clone() Creates and returns a copy of this object. |
void |
draw(Canvas canvas, Paint paint) Draw this shape into the provided Canvas, with the provided Paint. |
void |
getOutline(Outline outline) Compute the Outline of the shape and return it in the supplied Outline parameter. |
void |
onResize(float width, float height) Callback method called when resize(float, float) is executed. |
final RectF |
rect() Returns the RectF that defines this rectangle's bounds. |
|
From class android.graphics.drawable.shapes.Shape
Shape |
clone() Creates and returns a copy of this object. |
abstract void |
draw(Canvas canvas, Paint paint) Draw this shape into the provided Canvas, with the provided Paint. |
final float |
getHeight() Returns the height of the Shape. |
void |
getOutline(Outline outline) Compute the Outline of the shape and return it in the supplied Outline parameter. |
final float |
getWidth() Returns the width of the Shape. |
boolean |
hasAlpha() Checks whether the Shape is opaque. |
void |
onResize(float width, float height) Callback method called when resize(float, float) is executed. |
final void |
resize(float width, float height) Resizes the dimensions of this shape. |
|
From class java.lang.Object
Object |
clone() Creates and returns a copy of this object. |
boolean |
equals(Object obj) Indicates whether some other object is "equal to" this one. |
void |
finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. |
final Class<?> |
getClass() Returns the runtime class of this Object . |
int |
hashCode() Returns a hash code value for the object. |
final void |
notify() Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() Wakes up all threads that are waiting on this object's monitor. |
String |
toString() Returns a string representation of the object. |
final void |
wait(long millis, int nanos) Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. |
final void |
wait(long millis) Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. |
final void |
wait() Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. |
|
Public constructors
Public methods
draw
void draw (Canvas canvas,
Paint paint)
Draw this shape into the provided Canvas, with the provided Paint. Before calling this, you must call resize(float, float)
.
Parameters |
canvas |
Canvas : the Canvas within which this shape should be drawn |
paint |
Paint : the Paint object that defines this shape's characteristics |
getOutline
void getOutline (Outline outline)
Compute the Outline of the shape and return it in the supplied Outline parameter. The default implementation does nothing and outline
is not changed.
Parameters |
outline |
Outline : The Outline to be populated with the result. Should not be null. |