Reference:Android.graphics.Region
From Triled Wiki
android.graphics
public class android.graphics.Region
| java.lang.Object | ||
| android.graphics.Region | Parcelable | |
[edit] Nested Classes
| Region.Op |
[edit] Summary
[edit] Constants
| Value | ||||
|---|---|---|---|---|
| Creator | CREATOR |
[edit] Public Constructors
| Region () | |||||
| Create an empty region | |||||
| Region (Region region) | |||||
| Return a copy of the specified region | |||||
| Region (Rect r) | |||||
| Return a region set to the specified rectangle | |||||
| Region (int left, int top, int right, int bottom) | |||||
| Return a region set to the specified rectangle | |||||
[edit] Public Methods
| boolean | contains (int x, int y) | ||||
| Return true if the region contains the specified point | |||||
| Path | getBoundaryPath () | ||||
| Return the boundary of the region as a new Path. | |||||
| boolean | getBoundaryPath (Path path) | ||||
| Set the path to the boundary of the region. | |||||
| Rect | getBounds () | ||||
| Return a new Rect set to the bounds of the region. | |||||
| boolean | getBounds (Rect r) | ||||
| Set the Rect to the bounds of the region. | |||||
| boolean | isComplex () | ||||
| Return true if the region contains more than one rectangle | |||||
| boolean | isEmpty () | ||||
| Return true if this region is empty | |||||
| boolean | isRect () | ||||
| Return true if the region contains a single rectangle | |||||
| boolean | op (Region region1, Region region2, Op op) | ||||
| Set this region to the result of performing the Op on the specified regions. | |||||
| boolean | op (Region region, Op op) | ||||
| Perform the specified Op on this region and the specified region. | |||||
| boolean | op (Rect rect, Region region, Op op) | ||||
| Set this region to the result of performing the Op on the specified rect and region. | |||||
| boolean | op (Rect r, Op op) | ||||
| Perform the specified Op on this region and the specified rect. | |||||
| boolean | op (int left, int top, int right, int bottom, Op op) | ||||
| Perform the specified Op on this region and the specified rect. | |||||
| boolean | quickContains (Rect r) | ||||
| Return true if the region is a single rectangle (not complex) and it contains the specified rectangle. | |||||
| boolean | quickContains (int left, int top, int right, int bottom) | ||||
| Return true if the region is a single rectangle (not complex) and it contains the specified rectangle. | |||||
| boolean | quickReject (Rect r) | ||||
| Return true if the region is empty, or if the specified rectangle does not intersect the region. | |||||
| boolean | quickReject (int left, int top, int right, int bottom) | ||||
| Return true if the region is empty, or if the specified rectangle does not intersect the region. | |||||
| boolean | quickReject (Region rgn) | ||||
| Return true if the region is empty, or if the specified region does not intersect the region. | |||||
| boolean | set (Rect r) | ||||
| Set the region to the specified rectangle | |||||
| boolean | set (Region region) | ||||
| Set the region to the specified region. | |||||
| boolean | set (int left, int top, int right, int bottom) | ||||
| Set the region to the specified rectangle | |||||
| void | setEmpty () | ||||
| Set the region to the empty region | |||||
| boolean | setPath (Path path) | ||||
| Set the region to the area described by the path. | |||||
| boolean | setPath (Path path, Region clip) | ||||
| Set the region to the area described by the path, optionally clipped (if clip is not null). | |||||
| void | translate (int dx, int dy, Region dst) | ||||
| Set the dst region to the result of translating this region by [[]dx, dy]. | |||||
| void | translate (int dx, int dy) | ||||
| Translate the region by [[]dx, dy]. | |||||
| final | boolean | union (Rect r) | |||
| void | writeToParcel (Parcel p) | ||||
| Write the region and its pixels to the parcel. | |||||
[edit] Protected Methods
| void | finalize () | ||||
| Called by the virtual machine when there are no longer any (non-weak) references to the receiver. | |||||
[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait[edit] Methods inherited from interface android.os.Parcelable
[edit] Details
[edit] Constants
[edit] public static final Creator CREATOR
[edit] Public Constructors
[edit] public Region()
Create an empty region
[edit] public Region(Region region)
Return a copy of the specified region
[edit] public Region(Rect r)
Return a region set to the specified rectangle
[edit] public Region(int left, int top, int right, int bottom)
Return a region set to the specified rectangle
[edit] Public Methods
[edit] public boolean contains(int x, int y)
Return true if the region contains the specified point
[edit] public Path getBoundaryPath()
Return the boundary of the region as a new Path. If the region is empty, the path will also be empty.
[edit] public boolean getBoundaryPath(Path path)
Set the path to the boundary of the region. If the region is empty, the path will also be empty.
[edit] public Rect getBounds()
Return a new Rect set to the bounds of the region. If the region is empty, the Rect will be set to [0, 0, 0, 0]
[edit] public boolean getBounds(Rect r)
Set the Rect to the bounds of the region. If the region is empty, the Rect will be set to [0, 0, 0, 0]
[edit] public boolean isComplex()
Return true if the region contains more than one rectangle
[edit] public boolean isEmpty()
Return true if this region is empty
[edit] public boolean isRect()
Return true if the region contains a single rectangle
[edit] public boolean op(Region region1, Region region2, Op op)
Set this region to the result of performing the Op on the specified regions. Return true if the result is not empty.
[edit] public boolean op(Region region, Op op)
Perform the specified Op on this region and the specified region. Return true if the result of the op is not empty.
[edit] public boolean op(Rect rect, Region region, Op op)
Set this region to the result of performing the Op on the specified rect and region. Return true if the result is not empty.
[edit] public boolean op(Rect r, Op op)
Perform the specified Op on this region and the specified rect. Return true if the result of the op is not empty.
[edit] public boolean op(int left, int top, int right, int bottom, Op op)
Perform the specified Op on this region and the specified rect. Return true if the result of the op is not empty.
[edit] public boolean quickContains(Rect r)
Return true if the region is a single rectangle (not complex) and it contains the specified rectangle. Returning false is not a guarantee that the rectangle is not contained by this region, but return true is a guarantee that the rectangle is contained by this region.
[edit] public boolean quickContains(int left, int top, int right, int bottom)
Return true if the region is a single rectangle (not complex) and it contains the specified rectangle. Returning false is not a guarantee that the rectangle is not contained by this region, but return true is a guarantee that the rectangle is contained by this region.
[edit] public boolean quickReject(Rect r)
Return true if the region is empty, or if the specified rectangle does not intersect the region. Returning false is not a guarantee that they intersect, but returning true is a guarantee that they do not.
[edit] public boolean quickReject(int left, int top, int right, int bottom)
Return true if the region is empty, or if the specified rectangle does not intersect the region. Returning false is not a guarantee that they intersect, but returning true is a guarantee that they do not.
[edit] public boolean quickReject(Region rgn)
Return true if the region is empty, or if the specified region does not intersect the region. Returning false is not a guarantee that they intersect, but returning true is a guarantee that they do not.
[edit] public boolean set(Rect r)
Set the region to the specified rectangle
[edit] public boolean set(Region region)
Set the region to the specified region.
[edit] public boolean set(int left, int top, int right, int bottom)
Set the region to the specified rectangle
[edit] public void setEmpty()
Set the region to the empty region
[edit] public boolean setPath(Path path)
Set the region to the area described by the path. Return true if the resulting region is non-empty. This produces a region that is identical to the pixels that would be drawn by the path (with no antialiasing).
[edit] public boolean setPath(Path path, Region clip)
Set the region to the area described by the path, optionally clipped (if clip is not null). Return true if the resulting region is non-empty. This produces a region that is identical to the pixels that would be drawn by the path (with no antialiasing).
[edit] public void translate(int dx, int dy, Region dst)
Set the dst region to the result of translating this region by [dx, dy]. If this region is empty, then dst will be set to empty.
[edit] public void translate(int dx, int dy)
Translate the region by [dx, dy]. If the region is empty, do nothing.
[edit] public final boolean union(Rect r)
[edit] public void writeToParcel(Parcel p)
Write the region and its pixels to the parcel. The region can be rebuilt from the parcel by calling CREATOR.createFromParcel().
Parameters
| p | Parcel object to write the region data into |
|---|
[edit] Protected Methods
[edit] protected void finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object is empty.
Throws
| Throwable |
|---|
[edit] References
- Original documentation page for Android SDK build m5-rc15e - 14 apr 2008 17:27
