All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface sun.porting.graphicssystem.Region

public interface Region
extends Shape
This is the interface for an object which represents rectilinear regions (e.g. window visibility and clip regions).


Method Index

 o contains(int, int)
Does the region contain the given point?
 o contains(int, int, int, int)
Does the region contain the given rectangle (in its entirety)?
 o copy()
Create an independent copy of the region.
 o defragment(boolean)
Defragment a region.
 o equals(Region)
Test for equality against the given region.
 o getBounds()
Get the bounding box of the region, i.e. the smallest rectangle which completely encloses the region's current contents.
 o getRectangles()
Return an Enumeration object which can be used to loop through the elements of this region.
 o intersect(int, int, int, int)
Do a destructive intersection operation with a region described by the rectangle (x,y,w,h).
 o intersect(Rectangle)
Do a destructive intersection operation with a region described by the given Rectangle.
 o intersect(Region)
Do a destructive intersection operation with the given region.
 o isEmpty()
Is the region empty?
 o isRectangle()
Does the region represent a simple rectangle?
 o mayIntersect(int, int, int, int)
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.
 o mayIntersect(Rectangle)
A quick, bounding box overlap test to see whether this region occupies the same general space as the given rectangle r.
 o mayIntersect(Region)
A quick, bounding box overlap test to see whether this region occupies the same general space as the given region r.
 o setEmpty()
Set the region to an empty region.
 o subtract(int, int, int, int)
Do a destructive subtraction, removing the rectangle (x,y,w,h) from the current region.
 o subtract(Rectangle)
Do a destructive subtraction, removing the given Rectangle.
 o subtract(Region)
Do a destructive subtract operation with the given region.
 o translate(int, int)
Translate the entire region by the vector (dx, dy).
 o union(int, int, int, int)
Do a destructive union operation with the rectangle (x,y,w,h).
 o union(Rectangle)
Do a destructive union operation with the given Rectangle.
 o union(Region)
Do a destructive union operation with the given region.

Methods

 o copy
 public abstract Region copy()
Create an independent copy of the region.

 o equals
 public abstract boolean equals(Region r)
Test for equality against the given region.

Parameters:
r - The region against which to test.
Returns:
true if this region is equal to r, false otherwise.
 o isRectangle
 public abstract boolean isRectangle()
Does the region represent a simple rectangle?

Returns:
true if this region contains only one rectangle, false otherwise.
 o isEmpty
 public abstract boolean isEmpty()
Is the region empty?

Returns:
true if this region contains no area, false otherwise.
 o setEmpty
 public abstract void setEmpty()
Set the region to an empty region.

 o translate
 public abstract void translate(int dx,
                                int dy)
Translate the entire region by the vector (dx, dy).

Parameters:
dx - The x component of the translation.
dy - The y component of the translation.
 o getRectangles
 public abstract Enumeration getRectangles()
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()

Returns:
An Enumeration object associated with this region.
 o defragment
 public abstract void defragment(boolean isClip)
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 directly as a clip region.
 o getBounds
 public abstract Rectangle getBounds()
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).

Returns:
A Rectangle describing the bounding box.
 o union
 public abstract void union(Region r)
Do a destructive union operation with the given region.

Parameters:
r - The other Region with which this Region should be combined.
 o union
 public abstract void union(int x,
                            int y,
                            int w,
                            int h)
Do a destructive union operation with the rectangle (x,y,w,h).

Parameters:
x - The x coordinate of the rectangle used for the union.
y - The y coordinate of the rectangle used for the union.
w - The width of the rectangle used for the union.
h - The height of the rectangle used for the union.
 o union
 public abstract void union(Rectangle r)
Do a destructive union operation with the given Rectangle.

Parameters:
r - The rectangle which should be added to this region.
 o subtract
 public abstract void subtract(Region r)
Do a destructive subtract operation with the given region.

Parameters:
r - The region which should be subtracted out.
 o subtract
 public abstract 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.

Parameters:
x - The x coordinate of the rectangle to be subtracted.
y - The y coordinate of the rectangle to be subtracted.
w - The width of the rectangle to be subtracted.
h - The height of the rectangle to be subtracted.
 o subtract
 public abstract void subtract(Rectangle r)
Do a destructive subtraction, removing the given Rectangle.

Parameters:
r - The rectangle to be subtracted out.
 o intersect
 public abstract void intersect(Region r)
Do a destructive intersection operation with the given region.

Parameters:
r - The region with which this region should be intersected.
 o intersect
 public abstract 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).

Parameters:
x - The x coordinate of the rectangle used for the intersection.
y - The y coordinate of the rectangle used for the intersection.
w - The width of the rectangle used for the intersection.
h - The height of the rectangle used for the intersection.
 o intersect
 public abstract void intersect(Rectangle r)
Do a destructive intersection operation with a region described by the given Rectangle.

Parameters:
r - The rectangle with which this region should be intersected.
 o contains
 public abstract boolean contains(int x,
                                  int y)
Does the region contain the given point?

Parameters:
x - The x coordinate of the test point
y - The y coordinate of the test point
Returns:
true if (x,y) is in the region, false otherwise.
 o contains
 public abstract boolean contains(int x,
                                  int y,
                                  int w,
                                  int h)
Does the region contain the given rectangle (in its entirety)?

Parameters:
x - The x coordinate of the test rectangle
y - The y coordinate of the test rectangle
w - The width of the test rectangle
h - The height of the test rectangle
Returns:
true if (x,y,w,h) is entirely in the region, false otherwise.
 o mayIntersect
 public abstract 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. 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.
Returns:
true if an overlap is possible, false otherwise.
 o mayIntersect
 public abstract 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. The bounding box test quickly eliminates regions from consideration if they can't possibly intersect.

Parameters:
x - The x coordinate of the test rectangle
y - The y coordinate of the test rectangle
w - The width of the test rectangle
h - The height of the test rectangle
Returns:
true if an overlap is possible, false otherwise.
 o mayIntersect
 public abstract 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. 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.
Returns:
true If an overlap is possible, false otherwise.

All Packages  Class Hierarchy  This Package  Previous  Next  Index