class org.aswing.geom.IntRectangle

A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-left point (x, y) in the coordinate space, its width, and its height.

Class Fields

static function creatWithRectangle(r:Rectangle): IntRectangle

Create a int point with point.

Instance Fields

var x:Int

var y:Int

function new(?x:Int = 0, ?y:Int = 0, ?width:Int = 0, ?height:Int = 0): Void

Creates a rectangle.

function clone(): IntRectangle

Duplicates current instance.

returns

copy of the current instance.

function equals(o:Dynamic): Bool

function getLocation(): IntPoint

Returns the location of this rectangle.

function getSize(): IntDimension

Returns the size of this rectangle.

function grow(h:Int, v:Int): Void

Resizes the Rectangle both horizontally and vertically.

This method modifies the Rectangle so that it is h units larger on both the left and right side, and v units larger at both the top and bottom.

The new Rectangle has (x - h, y - v) as its top-left corner, a width of width + 2h, and a height of height + 2v.

If negative values are supplied for h and v, the size of the Rectangle decreases accordingly. The grow method does not check whether the resulting values of width and height are non-negative.

h

the horizontal expansion

v

the vertical expansion

function leftBottom(): IntPoint

function leftTop(): IntPoint

function move(dx:Int, dy:Int): Void

function resize(?dwidth:Int = 0, ?dheight:Int = 0): Void

function rightBottom(): IntPoint

function rightTop(): IntPoint

function setLocation(p:IntPoint): Void

Sets the x, y property of the rectangle.

function setRect(rect:IntRectangle): Void

Sets the rectangle to be as same as rect.

function setRectXYWH(x:Int, y:Int, width:Int, height:Int): Void

Sets the rect with x, y, width and height.

function setSize(size:IntDimension): Void

Sets the width and height properties of the rectangle

function setWithRectangle(r:Rectangle): Void

Sets the location with a Point, the value will be transfer to int.

p

the location to be set.

function toRectangle(): Rectangle

Return a Point instance with same value.

function toString(): String

function union(r:IntRectangle): IntRectangle

Computes the union of this Rectangle with the specified Rectangle. Returns a new Rectangle that represents the union of the two rectangles

r

the specified Rectangle

returns

the smallest Rectangle containing both the specified Rectangle and this Rectangle.