| sun.porting.graphicssystem.Region
All known Subclasses: sun.porting.utils.RegionImpl,
Region | public interface Region extends java.awt.Shape(Code) | | This is the interface for an object which represents rectilinear regions
(e.g. window visibility and clip regions).
version: 1.11, 08/19/02 |
Method Summary | |
boolean | contains(int x, int y) | boolean | contains(int x, int y, int w, int h) | Region | copy() Create an independent copy of the region. | void | defragment(boolean isClip) Defragment a region. | boolean | equals(Region r) Test for equality against the given region.
Parameters: r - The region against which to test. | Rectangle | getBounds() Get the bounding box of the region, i.e. the smallest rectangle
which completely encloses the region's current contents. | Enumeration | getRectangles() Return an Enumeration object which can be used to loop
through the elements of this region. | void | intersect(Region r) Do a destructive intersection operation with the given region. | void | intersect(int x, int y, int w, int h) Do a destructive intersection operation with a region described by
the rectangle (x,y,w,h). | void | intersect(Rectangle r) Do a destructive intersection operation with a region described by
the given Rectangle . | boolean | isEmpty() | boolean | isRectangle() | boolean | mayIntersect(Region r) A quick, bounding box overlap test to see whether this region occupies
the same general space as the given region r.
An overlap is possible only if the bounding box of this region
overlaps the bounding box of r. | boolean | mayIntersect(int x, int y, int w, int h) A quick, bounding box overlap test to see whether this region occupies
the same general space as a rectangle described by the given (x,y,w,h) tuple.
An overlap is possible only if the bounding box of this region
overlaps the area of the rectangle. | boolean | mayIntersect(Rectangle r) A quick, bounding box overlap test to see whether this region occupies
the same general space as the given rectangle r.
An overlap is possible only if the bounding box of this region
overlaps the area of the rectangle. | void | setEmpty() Set the region to an empty region. | void | subtract(Region r) Do a destructive subtract operation with the given region. | void | subtract(int x, int y, int w, int h) Do a destructive subtraction, removing the rectangle (x,y,w,h)
from the current region. | void | subtract(Rectangle r) Do a destructive subtraction, removing the given Rectangle . | void | translate(int dx, int dy) Translate the entire region by the vector (dx, dy). | void | union(Region r) Do a destructive union operation with the given region. | void | union(int x, int y, int w, int h) Do a destructive union operation with the rectangle (x,y,w,h). | void | union(Rectangle r) Do a destructive union operation with the given Rectangle . |
contains | boolean contains(int x, int y)(Code) | | Does the region contain the given point?
Parameters: x - The x coordinate of the test point Parameters: y - The y coordinate of the test point true if (x,y) is in the region, false otherwise. |
contains | boolean contains(int x, int y, int w, int h)(Code) | | Does the region contain the given rectangle (in its entirety)?
Parameters: x - The x coordinate of the test rectangle Parameters: y - The y coordinate of the test rectangle Parameters: w - The width of the test rectangle Parameters: h - The height of the test rectangle true if (x,y,w,h) is entirely in the region, false otherwise. |
copy | Region copy()(Code) | | Create an independent copy of the region.
|
defragment | void defragment(boolean isClip)(Code) | | Defragment a region. This call is a convenience for the Region
implementation; it indicates that a number of successive operations
have been done and now the region can be expected to stay static for
a period of time.
Parameters: isClip - Indicates that the region is going to be used directlyas a clip region. |
equals | boolean equals(Region r)(Code) | | Test for equality against the given region.
Parameters: r - The region against which to test. true if this region is equal to r, false otherwise. |
getBounds | Rectangle getBounds()(Code) | | Get the bounding box of the region, i.e. the smallest rectangle
which completely encloses the region's current contents. If the
region is empty, returns the rectangle (0,0,0,0).
A Rectangle describing the bounding box. |
getRectangles | Enumeration getRectangles()(Code) | | Return an Enumeration object which can be used to loop
through the elements of this region. WARNING: the enumeration
is not responsible for making sure that the region is not changed
in the meantime. If there is any risk of this, you should do
region.copy().getRectangles()
An Enumeration object associated with this region. |
intersect | void intersect(Region r)(Code) | | Do a destructive intersection operation with the given region.
Parameters: r - The region with which this region should be intersected. |
intersect | void intersect(int x, int y, int w, int h)(Code) | | Do a destructive intersection operation with a region described by
the rectangle (x,y,w,h).
Parameters: x - The x coordinate of the rectangle used for the intersection. Parameters: y - The y coordinate of the rectangle used for the intersection. Parameters: w - The width of the rectangle used for the intersection. Parameters: h - The height of the rectangle used for the intersection. |
intersect | void intersect(Rectangle r)(Code) | | Do a destructive intersection operation with a region described by
the given Rectangle .
Parameters: r - The rectangle with which this region should be intersected. |
isEmpty | boolean isEmpty()(Code) | | Is the region empty?
true if this region contains no area, false otherwise. |
isRectangle | boolean isRectangle()(Code) | | Does the region represent a simple rectangle?
true if this region contains only one rectangle, false otherwise. |
mayIntersect | boolean mayIntersect(Region r)(Code) | | A quick, bounding box overlap test to see whether this region occupies
the same general space as the given region r.
An overlap is possible only if the bounding box of this region
overlaps the bounding box of r. The bounding box test quickly eliminates
regions from consideration if they can't possibly intersect.
Parameters: r - The region which is to be tested for overlap. true if an overlap is possible, false otherwise. |
mayIntersect | boolean mayIntersect(int x, int y, int w, int h)(Code) | | A quick, bounding box overlap test to see whether this region occupies
the same general space as a rectangle described by the given (x,y,w,h) tuple.
An overlap is possible only if the bounding box of this region
overlaps the area of the rectangle. The bounding box test quickly eliminates
regions from consideration if they can't possibly intersect.
Parameters: x - The x coordinate of the test rectangle Parameters: y - The y coordinate of the test rectangle Parameters: w - The width of the test rectangle Parameters: h - The height of the test rectangle true if an overlap is possible, false otherwise. |
mayIntersect | boolean mayIntersect(Rectangle r)(Code) | | A quick, bounding box overlap test to see whether this region occupies
the same general space as the given rectangle r.
An overlap is possible only if the bounding box of this region
overlaps the area of the rectangle. The bounding box test quickly eliminates
regions from consideration if they can't possibly intersect.
Parameters: r - The rectangle which is to be tested for overlap. true If an overlap is possible, false otherwise. |
setEmpty | void setEmpty()(Code) | | Set the region to an empty region.
|
subtract | void subtract(Region r)(Code) | | Do a destructive subtract operation with the given region.
Parameters: r - The region which should be subtracted out. |
subtract | void subtract(int x, int y, int w, int h)(Code) | | Do a destructive subtraction, removing the rectangle (x,y,w,h)
from the current region.
Parameters: x - The x coordinate of the rectangle to be subtracted. Parameters: y - The y coordinate of the rectangle to be subtracted. Parameters: w - The width of the rectangle to be subtracted. Parameters: h - The height of the rectangle to be subtracted. |
subtract | void subtract(Rectangle r)(Code) | | Do a destructive subtraction, removing the given Rectangle .
Parameters: r - The rectangle to be subtracted out. |
translate | void translate(int dx, int dy)(Code) | | Translate the entire region by the vector (dx, dy).
Parameters: dx - The x component of the translation. Parameters: dy - The y component of the translation. |
union | void union(Region r)(Code) | | Do a destructive union operation with the given region.
Parameters: r - The other Region with which this Region should be combined. |
union | void union(int x, int y, int w, int h)(Code) | | Do a destructive union operation with the rectangle (x,y,w,h).
Parameters: x - The x coordinate of the rectangle used for the union. Parameters: y - The y coordinate of the rectangle used for the union. Parameters: w - The width of the rectangle used for the union. Parameters: h - The height of the rectangle used for the union. |
union | void union(Rectangle r)(Code) | | Do a destructive union operation with the given Rectangle .
Parameters: r - The rectangle which should be added to this region. |
|
|