Packageorg.aswing.geom
Classpublic class 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.



Public Properties
 PropertyDefined by
  height : int = 0
IntRectangle
  width : int = 0
IntRectangle
  x : int = 0
IntRectangle
  y : int = 0
IntRectangle
Public Methods
 MethodDefined by
  
IntRectangle(x:int = 0, y:int = 0, width:int = 0, height:int = 0)
Creates a rectangle.
IntRectangle
  
Duplicates current instance.
IntRectangle
  
IntRectangle
  
[static] Create a int point with point.
IntRectangle
  
equals(o:Object):Boolean
IntRectangle
  
Returns the location of this rectangle.
IntRectangle
  
Returns the size of this rectangle.
IntRectangle
  
grow(h:int, v:int):void
Resizes the Rectangle both horizontally and vertically.
IntRectangle
  
IntRectangle
  
IntRectangle
  
move(dx:int, dy:int):void
IntRectangle
  
resize(dwidth:int = 0, dheight:int = 0):void
IntRectangle
  
IntRectangle
  
IntRectangle
  
Sets the x, y property of the rectangle.
IntRectangle
  
setRect(rect:IntRectangle):void
Sets the rectangle to be as same as rect.
IntRectangle
  
setRectXYWH(x:int, y:int, width:int, height:int):void
Sets the rect with x, y, width and height.
IntRectangle
  
setSize(size:IntDimension):void
Sets the width and height properties of the rectangle
IntRectangle
  
setWithRectangle(r:Rectangle):void
Sets the location with a Point, the value will be transfer to int.
IntRectangle
  
toRectangle():Rectangle
Return a Point instance with same value.
IntRectangle
  
toString():String
IntRectangle
  
Computes the union of this Rectangle with the specified Rectangle.
IntRectangle
Property detail
heightproperty
public var height:int = 0
widthproperty 
public var width:int = 0
xproperty 
public var x:int = 0
yproperty 
public var y:int = 0
Constructor detail
IntRectangle()constructor
public function IntRectangle(x:int = 0, y:int = 0, width:int = 0, height:int = 0)

Creates a rectangle.

Parameters
x:int (default = 0)
 
y:int (default = 0)
 
width:int (default = 0)
 
height:int (default = 0)
Method detail
clone()method
public function clone():IntRectangle

Duplicates current instance.

Returns
IntRectangle — copy of the current instance.
containsPoint()method 
public function containsPoint(p:IntPoint):BooleanParameters
p:IntPoint

Returns
Boolean
creatWithRectangle()method 
public static function creatWithRectangle(r:Rectangle):IntRectangle

Create a int point with point.

Parameters
r:Rectangle

Returns
IntRectangle
equals()method 
public function equals(o:Object):Boolean

Parameters
o:Object

Returns
Boolean
getLocation()method 
public function getLocation():IntPoint

Returns the location of this rectangle.

Returns
IntPoint
getSize()method 
public function getSize():IntDimension

Returns the size of this rectangle.

Returns
IntDimension
grow()method 
public 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.

Parameters
h:int — the horizontal expansion
 
v:int — the vertical expansion
leftBottom()method 
public function leftBottom():IntPoint

Returns
IntPoint
leftTop()method 
public function leftTop():IntPoint

Returns
IntPoint
move()method 
public function move(dx:int, dy:int):voidParameters
dx:int
 
dy:int
resize()method 
public function resize(dwidth:int = 0, dheight:int = 0):voidParameters
dwidth:int (default = 0)
 
dheight:int (default = 0)
rightBottom()method 
public function rightBottom():IntPoint

Returns
IntPoint
rightTop()method 
public function rightTop():IntPoint

Returns
IntPoint
setLocation()method 
public function setLocation(p:IntPoint):void

Sets the x, y property of the rectangle.

Parameters
p:IntPoint
setRect()method 
public function setRect(rect:IntRectangle):void

Sets the rectangle to be as same as rect.

Parameters
rect:IntRectangle
setRectXYWH()method 
public function setRectXYWH(x:int, y:int, width:int, height:int):void

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

Parameters
x:int
 
y:int
 
width:int
 
height:int
setSize()method 
public function setSize(size:IntDimension):void

Sets the width and height properties of the rectangle

Parameters
size:IntDimension
setWithRectangle()method 
public function setWithRectangle(r:Rectangle):void

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

Parameters
r:Rectangle — the location to be set.
toRectangle()method 
public function toRectangle():Rectangle

Return a Point instance with same value.

Returns
Rectangle
toString()method 
public function toString():String

Returns
String
union()method 
public 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

Parameters
r:IntRectangle — the specified Rectangle

Returns
IntRectangle — the smallest Rectangle containing both the specified Rectangle and this Rectangle.