java.lang.Object | |
↳ | android.graphics.PathMeasure |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | POSITION_MATRIX_FLAG | ||||||||||
int | TANGENT_MATRIX_FLAG |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create an empty PathMeasure object.
| |||||||||||
Create a PathMeasure object associated with the specified path object
(already created and specified).
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the total length of the current contour, or 0 if no path is
associated with this measure object.
| |||||||||||
Pins distance to 0 <= distance <= getLength(), and then computes the
corresponding matrix.
| |||||||||||
Pins distance to 0 <= distance <= getLength(), and then computes the
corresponding position and tangent.
| |||||||||||
Given a start and stop distance, return in dst the intervening
segment(s).
| |||||||||||
Return true if the current contour is closed()
| |||||||||||
Move to the next contour in the path.
| |||||||||||
Assign a new path, or null to have none.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Is called before the object's memory is being reclaimed by the VM.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Create an empty PathMeasure object. To uses this to measure the length of a path, and/or to find the position and tangent along it, call setPath. Note that once a path is associated with the measure object, it is undefined if the path is subsequently modified and the the measure object is used. If the path is modified, you must call setPath with the path.
Create a PathMeasure object associated with the specified path object (already created and specified). The meansure object can now return the path's length, and the position and tangent of any position along the path. Note that once a path is associated with the measure object, it is undefined if the path is subsequently modified and the the measure object is used. If the path is modified, you must call setPath with the path.
path | The path that will be measured by this object |
---|---|
forceClosed | If true, then the path will be considered as "closed" even if its contour was not explicitly closed. |
Return the total length of the current contour, or 0 if no path is associated with this measure object.
Pins distance to 0 <= distance <= getLength(), and then computes the corresponding matrix. Returns false if there is no path, or a zero-length path was specified, in which case matrix is unchanged.
distance | The distance along the associated path |
---|---|
matrix | Allocated by the caller, this is set to the transformation associated with the position and tangent at the specified distance |
flags | Specified what aspects should be returned in the matrix. |
Pins distance to 0 <= distance <= getLength(), and then computes the corresponding position and tangent. Returns false if there is no path, or a zero-length path was specified, in which case position and tangent are unchanged.
distance | The distance along the current contour to sample |
---|---|
pos | If not null, eturns the sampled position (x==[0], y==[1]) |
tan | If not null, returns the sampled tangent (x==[0], y==[1]) |
Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD <= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true
Return true if the current contour is closed()
Move to the next contour in the path. Return true if one exists, or false if we're done with the path.
Assign a new path, or null to have none.
Is called before the object's memory is being reclaimed by the VM. This can only happen once the VM has detected, during a run of the garbage collector, that the object is no longer reachable by any thread of the running application.
The method can be used to free system resources or perform other cleanup
before the object is garbage collected. The default implementation of the
method is empty, which is also expected by the VM, but subclasses can
override finalize()
as required. Uncaught exceptions which are
thrown during the execution of this method cause it to terminate
immediately but are otherwise ignored.
Note that the VM does guarantee that finalize()
is called at most
once for any object, but it doesn't guarantee when (if at all) finalize()
will be called. For example, object B's finalize()
can delay the execution of object A's finalize()
method and
therefore it can delay the reclamation of A's memory. To be safe, use a
ReferenceQueue, because it provides more control
over the way the VM deals with references during garbage collection.
Throwable |
---|