IT. Expert System.

Android Reference

Region


android.graphics

Class Region

    • Constructor Summary

      Constructors
      Constructor and Description
      Region()
      Create an empty region
      Region(int left, int top, int right, int bottom)
      Return a region set to the specified rectangle
      Region(Rect r)
      Return a region set to the specified rectangle
      Region(Region region)
      Return a copy of the specified region
    • Method Summary

      Methods
      Modifier and Type Method and Description
      boolean contains(int x, int y)
      Return true if the region contains the specified point
      int describeContents()
      Describe the kinds of special objects contained in this Parcelable's marshalled representation.
      boolean equals(Object obj)
      Compares this instance with the specified object and indicates if they are equal.
      protected void finalize()
      Invoked when the garbage collector has detected that this instance is no longer reachable.
      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(int left, int top, int right, int bottom, Region.Op op)
      Perform the specified Op on this region and the specified rect.
      boolean op(Rect r, Region.Op op)
      Perform the specified Op on this region and the specified rect.
      boolean op(Rect rect, Region region, Region.Op op)
      Set this region to the result of performing the Op on the specified rect and region.
      boolean op(Region region, Region.Op op)
      Perform the specified Op on this region and the specified region.
      boolean op(Region region1, Region region2, Region.Op op)
      Set this region to the result of performing the Op on the specified regions.
      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 quickContains(Rect r)
      Return true if the region is a single rectangle (not complex) and it contains the specified rectangle.
      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(Rect r)
      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.
      void scale(float scale)
      Scale the region by the given scale amount.
      void scale(float scale, Region dst)
      Set the dst region to the result of scaling this region by the given scale amount.
      boolean set(int left, int top, int right, int bottom)
      Set the region to the specified rectangle
      boolean set(Rect r)
      Set the region to the specified rectangle
      boolean set(Region region)
      Set the region to the specified region.
      void setEmpty()
      Set the region to the empty region
      boolean setPath(Path path, Region clip)
      Set the region to the area described by the path and clip.
      String toString()
      Returns a string containing a concise, human-readable description of this object.
      void translate(int dx, int dy)
      Translate the region by [dx, dy].
      void translate(int dx, int dy, Region dst)
      Set the dst region to the result of translating this region by [dx, dy].
      boolean union(Rect r)
      void writeToParcel(Parcel p, int flags)
      Write the region and its pixels to the parcel.
    • Constructor Detail

      • Region

        public Region()
        Create an empty region
      • Region

        public Region(Region region)
        Return a copy of the specified region
      • Region

        public Region(Rect r)
        Return a region set to the specified rectangle
      • Region

        public Region(int left,
              int top,
              int right,
              int bottom)
        Return a region set to the specified rectangle
    • Method Detail

      • setEmpty

        public void setEmpty()
        Set the region to the empty region
      • set

        public boolean set(Region region)
        Set the region to the specified region.
      • set

        public boolean set(Rect r)
        Set the region to the specified rectangle
      • set

        public boolean set(int left,
                  int top,
                  int right,
                  int bottom)
        Set the region to the specified rectangle
      • setPath

        public boolean setPath(Path path,
                      Region clip)
        Set the region to the area described by the path and clip. 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).
      • isEmpty

        public boolean isEmpty()
        Return true if this region is empty
      • isRect

        public boolean isRect()
        Return true if the region contains a single rectangle
      • isComplex

        public boolean isComplex()
        Return true if the region contains more than one rectangle
      • getBounds

        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]
      • getBounds

        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]
      • getBoundaryPath

        public Path getBoundaryPath()
        Return the boundary of the region as a new Path. If the region is empty, the path will also be empty.
      • getBoundaryPath

        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.
      • contains

        public boolean contains(int x,
                       int y)
        Return true if the region contains the specified point
      • quickContains

        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.
      • quickContains

        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.
      • quickReject

        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.
      • quickReject

        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.
      • quickReject

        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.
      • translate

        public void translate(int dx,
                     int dy)
        Translate the region by [dx, dy]. If the region is empty, do nothing.
      • translate

        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.
      • scale

        public void scale(float scale)
        Scale the region by the given scale amount. This re-constructs new region by scaling the rects that this region consists of. New rectis are computed by scaling coordinates by float, then rounded by roundf() function to integers. This may results in less internal rects if 0 < scale < 1. zero and negative scale result in an empty region. if this region is empty, do nothing.
      • scale

        public void scale(float scale,
                 Region dst)
        Set the dst region to the result of scaling this region by the given scale amount. If this region is empty, then dst will be set to empty.
      • union

        public final boolean union(Rect r)
      • op

        public boolean op(Rect r,
                 Region.Op op)
        Perform the specified Op on this region and the specified rect. Return true if the result of the op is not empty.
      • op

        public boolean op(int left,
                 int top,
                 int right,
                 int bottom,
                 Region.Op op)
        Perform the specified Op on this region and the specified rect. Return true if the result of the op is not empty.
      • op

        public boolean op(Region 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.
      • op

        public boolean op(Rect rect,
                 Region 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.
      • op

        public boolean op(Region region1,
                 Region region2,
                 Region.Op op)
        Set this region to the result of performing the Op on the specified regions. Return true if the result is not empty.
      • toString

        public String toString()
        Description copied from class: Object
        Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
           getClass().getName() + '@' + Integer.toHexString(hashCode())

        See Writing a useful toString method if you intend implementing your own toString method.

        Overrides:
        toString in class Object
        Returns:
        a printable representation of this object.
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.
      • writeToParcel

        public void writeToParcel(Parcel p,
                         int flags)
        Write the region and its pixels to the parcel. The region can be rebuilt from the parcel by calling CREATOR.createFromParcel().
        Specified by:
        writeToParcel in interface Parcelable
        Parameters:
        p - Parcel object to write the region data into
        flags - Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
      • equals

        public boolean equals(Object obj)
        Description copied from class: Object
        Compares this instance with the specified object and indicates if they are equal. In order to be equal, o must represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.

        The default implementation returns true only if this == o. See Writing a correct equals method if you intend implementing your own equals method.

        The general contract for the equals and Object.hashCode() methods is that if equals returns true for any two objects, then hashCode() must return the same value for these objects. This means that subclasses of Object usually override either both methods or neither of them.

        Overrides:
        equals in class Object
        Parameters:
        obj - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • finalize

        protected void finalize()
                         throws Throwable
        Description copied from class: Object
        Invoked when the garbage collector has detected that this instance is no longer reachable. The default implementation does nothing, but this method can be overridden to free resources.

        Note that objects that override finalize are significantly more expensive than objects that don't. Finalizers may be run a long time after the object is no longer reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup. Note also that finalizers are run on a single VM-wide finalizer thread, so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary for a class that has a native peer and needs to call a native method to destroy that peer. Even then, it's better to provide an explicit close method (and implement Closeable), and insist that callers manually dispose of instances. This works well for something like files, but less well for something like a BigInteger where typical calling code would have to deal with lots of temporaries. Unfortunately, code that creates lots of temporaries is the worst kind of code from the point of view of the single finalizer thread.

        If you must use finalizers, consider at least providing your own ReferenceQueue and having your own thread process that queue.

        Unlike constructors, finalizers are not automatically chained. You are responsible for calling super.finalize() yourself.

        Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer thread. See Effective Java Item 7, "Avoid finalizers" for more.

        Overrides:
        finalize in class Object
        Throws:
        Throwable


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1359 / . Delta: 0.02543 с