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