org.gnu.gdk

Class Region


public class Region
extends Boxed

Represents a set of pixels on the Screen.

Field Summary

Fields inherited from class org.gnu.glib.Boxed

handle

Constructor Summary

Region()
Create a new empty Region.
Region(Rectangle rectangle)
Create a new Region containing the area of the Rectangle.
Region(Region regionToCopy)
Create a new Region that is a copy of the provided Region
Region(points[] , FillRule rule)
Create a new Region using the poligon defined by a number of points.

Method Summary

boolean
containsPoint(int x, int y)
Returns true if the provided point is in the Region.
OverlapType
containsRectangle(Rectangle rect)
Tests whether a Rectangle is within the Region.
protected void
finalize()
protected static Handle
gdk_region_copy(Handle region)
protected static void
gdk_region_destroy(Handle region)
protected static boolean
gdk_region_empty(Handle region)
protected static boolean
gdk_region_equal(Handle region1, Handle region2)
protected static void
gdk_region_get_clipbox(Handle region, Handle rectangle)
protected static Handle[]
gdk_region_get_rectangles(Handle region)
protected static void
gdk_region_intersect(Handle source1, Handle source2)
protected static Handle
gdk_region_new()
protected static void
gdk_region_offset(Handle retion, int dx, int dy)
protected static boolean
gdk_region_point_in(Handle region, int x, int y)
protected static Handle
gdk_region_polygon(Handle[] points, int fillRule)
protected static int
gdk_region_rect_in(Handle region, Handle rect)
protected static Handle
gdk_region_rectangle(Handle rectangle)
protected static void
gdk_region_shrink(Handle region, int dx, int dy)
protected static void
gdk_region_subtract(Handle source1, Handle source2)
protected static void
gdk_region_union(Handle source1, Handle source2)
protected static void
gdk_region_union_with_rect(Handle region, Handle rect)
protected static void
gdk_region_xor(Handle source1, Handle source2)
Rectangle
getClipbox()
Return the smallest rectangle which includes the entire Region.
Rectangle[]
getRectangles()
Obtain the area covered by this Region as a list of Rectangles.
void
intersect(Region region)
Sets the area to the intersection of areas for this Region and the provided Region.
boolean
isEmpty()
Returns true if the Region is empty.
boolean
isEqual(Region other)
Returns true if the provided Region is the same as this one.
void
offset(int x, int y)
Move the specified distance.
void
shrink(int x, int y)
Resizes this Regions by the specified amount.
void
subtract(Region region)
Subtracts the area of the provided Region from this Region.
void
union(Region region)
Sets the area to the union of areas for this Region and the provided Region.
void
unionWithRect(Rectangle rect)
Sets the area to the union of this Region and the provided Rectangle.
void
xor(Region region)
Sets the area of this Region to the exclusive-OR of the areas of this Region and the provided Region.

Methods inherited from class org.gnu.glib.Boxed

equals, getHandle, hashCode, setHandle

Constructor Details

Region

public Region()
Create a new empty Region.


Region

public Region(Rectangle rectangle)
Create a new Region containing the area of the Rectangle.

Parameters:
rectangle -


Region

public Region(Region regionToCopy)
Create a new Region that is a copy of the provided Region

Parameters:
regionToCopy -


Region

public Region(points[] ,
              FillRule rule)
Create a new Region using the poligon defined by a number of points.

Parameters:
rule -

Method Details

containsPoint

public boolean containsPoint(int x,
                             int y)
Returns true if the provided point is in the Region.

Parameters:
x -
y -


containsRectangle

public OverlapType containsRectangle(Rectangle rect)
Tests whether a Rectangle is within the Region.

Parameters:
rect -


finalize

protected void finalize()
            throws Throwable


gdk_region_copy

protected static final Handle gdk_region_copy(Handle region)


gdk_region_destroy

protected static final void gdk_region_destroy(Handle region)


gdk_region_empty

protected static final boolean gdk_region_empty(Handle region)


gdk_region_equal

protected static final boolean gdk_region_equal(Handle region1,
                                                Handle region2)


gdk_region_get_clipbox

protected static final void gdk_region_get_clipbox(Handle region,
                                                   Handle rectangle)


gdk_region_get_rectangles

protected static final Handle[] gdk_region_get_rectangles(Handle region)


gdk_region_intersect

protected static final void gdk_region_intersect(Handle source1,
                                                 Handle source2)


gdk_region_new

protected static final Handle gdk_region_new()


gdk_region_offset

protected static final void gdk_region_offset(Handle retion,
                                              int dx,
                                              int dy)


gdk_region_point_in

protected static final boolean gdk_region_point_in(Handle region,
                                                   int x,
                                                   int y)


gdk_region_polygon

protected static final Handle gdk_region_polygon(Handle[] points,
                                                 int fillRule)


gdk_region_rect_in

protected static final int gdk_region_rect_in(Handle region,
                                              Handle rect)


gdk_region_rectangle

protected static final Handle gdk_region_rectangle(Handle rectangle)


gdk_region_shrink

protected static final void gdk_region_shrink(Handle region,
                                              int dx,
                                              int dy)


gdk_region_subtract

protected static final void gdk_region_subtract(Handle source1,
                                                Handle source2)


gdk_region_union

protected static final void gdk_region_union(Handle source1,
                                             Handle source2)


gdk_region_union_with_rect

protected static final void gdk_region_union_with_rect(Handle region,
                                                       Handle rect)


gdk_region_xor

protected static final void gdk_region_xor(Handle source1,
                                           Handle source2)


getClipbox

public Rectangle getClipbox()
Return the smallest rectangle which includes the entire Region.


getRectangles

public Rectangle[] getRectangles()
Obtain the area covered by this Region as a list of Rectangles.


intersect

public void intersect(Region region)
Sets the area to the intersection of areas for this Region and the provided Region.

Parameters:
region -


isEmpty

public boolean isEmpty()
Returns true if the Region is empty.


isEqual

public boolean isEqual(Region other)
Returns true if the provided Region is the same as this one.

Parameters:
other -


offset

public void offset(int x,
                   int y)
Move the specified distance.

Parameters:
x -
y -


shrink

public void shrink(int x,
                   int y)
Resizes this Regions by the specified amount. Positive values shrink the Region. Negative numbers expand it.

Parameters:
x -
y -


subtract

public void subtract(Region region)
Subtracts the area of the provided Region from this Region.

Parameters:
region -


union

public void union(Region region)
Sets the area to the union of areas for this Region and the provided Region.

Parameters:
region -


unionWithRect

public void unionWithRect(Rectangle rect)
Sets the area to the union of this Region and the provided Rectangle.

Parameters:
rect -


xor

public void xor(Region region)
Sets the area of this Region to the exclusive-OR of the areas of this Region and the provided Region.

Parameters:
region -