org.gnu.gdk

Class Rectangle


public class Rectangle
extends Boxed

Represents a rectangle with x, y, width and height members.

Constructor Summary

Rectangle()
Construct an empty Rectangle
Rectangle(Handle handle)
Rectangle(int x, int y, int width, int height)
Construct a Rectangle providing the x and y left-top coordinates, width and height.

Method Summary

int
getHeight()
Retrieve the height of the Rectangle.
static Rectangle
getRectangle(Handle handle)
For internal use of Java-Gnome only;
static Type
getType()
Retrieve the runtime type used by the GLib library.
int
getWidth()
Retrieve the width of the Rectangle.
int
getX()
Retrieve the x coordinate for the Rectangle.
int
getY()
Retrieve the y coordinate for the Rectangle.
Rectangle
intersect(Rectangle rect)
Returns the intersection of this Rectangle and the provided Rectangle or null if there is no intersection.
void
setHeight(int heigth)
Set the height of the Rectangle.
void
setWidth(int width)
Set the width of the Rectangle.
void
setX(int x)
Set the x coordinate for the Rectangle.
void
setY(int y)
Set the y coordinate for the Rectangle.
Rectangle
union(Rectangle rect)
Returns the union of this Rectangle and the provided Rectangle or null if there is no union.

Constructor Details

Rectangle

public Rectangle()
Construct an empty Rectangle

Rectangle

public Rectangle(Handle handle)

Rectangle

public Rectangle(int x,
                 int y,
                 int width,
                 int height)
Construct a Rectangle providing the x and y left-top coordinates, width and height.
Parameters:
x -
y -
width -
height -

Method Details

getHeight

public int getHeight()
Retrieve the height of the Rectangle.

getRectangle

public static Rectangle getRectangle(Handle handle)
For internal use of Java-Gnome only;

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

getWidth

public int getWidth()
Retrieve the width of the Rectangle.

getX

public int getX()
Retrieve the x coordinate for the Rectangle.

getY

public int getY()
Retrieve the y coordinate for the Rectangle.

intersect

public Rectangle intersect(Rectangle rect)
Returns the intersection of this Rectangle and the provided Rectangle or null if there is no intersection.
Parameters:
rect -

setHeight

public void setHeight(int heigth)
Set the height of the Rectangle.
Parameters:
heigth -

setWidth

public void setWidth(int width)
Set the width of the Rectangle.
Parameters:
width -

setX

public void setX(int x)
Set the x coordinate for the Rectangle.
Parameters:
x -

setY

public void setY(int y)
Set the y coordinate for the Rectangle.
Parameters:
y -

union

public Rectangle union(Rectangle rect)
Returns the union of this Rectangle and the provided Rectangle or null if there is no union.
Parameters:
rect -