Package | com.yworks.yfiles.geom |
Class | public class YRectangle |
Inheritance | YRectangle YDimension YObject Object |
Implements | PlaneObject |
Property | Defined By | ||
---|---|---|---|
boundingBox : YRectangle [read-only]
Returns this object. | YRectangle | ||
height : Number [read-only]
Get the height of the dimension object. | YDimension | ||
location : YPoint [read-only]
Returns coordinates of upper left corner. | YRectangle | ||
width : Number [read-only]
Get the width of the dimension object. | YDimension | ||
x : Number [read-only]
Returns x-coordinate of upper left corner. | YRectangle | ||
y : Number [read-only]
Returns y-coordinate of upper left corner. | YRectangle |
Method | Defined By | ||
---|---|---|---|
YRectangle(x:Number, y:Number, width:Number, height:Number, init:Boolean = true)
Creates a new rectangle with given upper left corner and size. | YRectangle | ||
compareTo(o:Object):int [override] | YRectangle | ||
contains(rx:Number, ry:Number, rw:Number, rh:Number, x:Number, y:Number):Boolean [static]
Determines whether the specified rectangle contains the specified point. | YRectangle | ||
contains2(rx:Number, ry:Number, rw:Number, rh:Number, x:Number, y:Number, closed:Boolean):Boolean [static]
Determines whether the specified rectangle contains the specified point. | YRectangle | ||
containsPoint(p:YPoint):Boolean
Checks whether or not this YRectangle contains the given point. | YRectangle | ||
containsPoint2(x:Number, y:Number):Boolean
Checks whether or not this YRectangle contains the given point. | YRectangle | ||
containsRectangle(p:YRectangle):Boolean
Checks whether or not this YRectangle contains the given rectangle. | YRectangle | ||
containsRectangle2(x:Number, y:Number, width:Number, height:Number):Boolean
Checks whether or not this YRectangle contains the rectangle defined by the given frame. | YRectangle | ||
equals(o:Object):Boolean [override] | YRectangle | ||
getClass():Class [override] | YRectangle | ||
getManhattanDistance(other:YRectangle):Number
Returns the Manhattan distance to the passed rectangle. | YRectangle | ||
hashCode():int [override] | YRectangle | ||
[static]
Returns whether or not the given rectangles intersect. | YRectangle | ||
newYDimension(width:Number, height:Number):YDimension [static]
Creates a new YDimension2D object for given size. | YDimension | ||
[static]
Creates a new rectangle with upper left corner (0,0) and size (0,0). | YRectangle | ||
[static]
Creates a new rectangle with given upper left corner and size. | YRectangle | ||
newYRectangle3(x:Number, y:Number, width:Number, height:Number):YRectangle [static]
Creates a new rectangle with given upper left corner and size. | YRectangle | ||
toString():String [override]
Returns a string representation of this rectangle
| YRectangle |
Method | Defined By | ||
---|---|---|---|
initYDimension(width:Number, height:Number):void
Initializes this object. | YDimension | ||
initYRectangle1():void
Initializes this object. | YRectangle | ||
Initializes this object. | YRectangle | ||
initYRectangle3(x:Number, y:Number, width:Number, height:Number):void
Initializes this object. | YRectangle |
boundingBox | property |
boundingBox:YRectangle
[read-only] Returns this object.
public function get boundingBox():YRectangle
location | property |
location:YPoint
[read-only] Returns coordinates of upper left corner.
public function get location():YPoint
x | property |
x:Number
[read-only] Returns x-coordinate of upper left corner.
public function get x():Number
y | property |
y:Number
[read-only] Returns y-coordinate of upper left corner.
public function get y():Number
YRectangle | () | Constructor |
public function YRectangle(x:Number, y:Number, width:Number, height:Number, init:Boolean = true)
Creates a new rectangle with given upper left corner and size.
Parametersx:Number — x-coordinate of upper left corner of the rectangle.
| |
y:Number — y-coordinate of upper left corner of the rectangle.
| |
width:Number — width of the rectangle.
| |
height:Number — height of the rectangle.
| |
init:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
compareTo | () | method |
override public function compareTo(o:Object):int
Parameters
o:Object |
int |
contains | () | method |
public static function contains(rx:Number, ry:Number, rw:Number, rh:Number, x:Number, y:Number):Boolean
Determines whether the specified rectangle contains the specified point.
Parameters
rx:Number — the x-coordinate of the upper left corner of the rectangle.
| |
ry:Number — the y-coordinate of the upper left corner of the rectangle.
| |
rw:Number — the width of the rectangle.
| |
rh:Number — the height of the rectangle.
| |
x:Number — the x-coordinate of the point to check.
| |
y:Number — the x-coordinate of the point to check.
|
Boolean — true if the point lies inside the rectangle; false otherwise.
|
contains2 | () | method |
public static function contains2(rx:Number, ry:Number, rw:Number, rh:Number, x:Number, y:Number, closed:Boolean):Boolean
Determines whether the specified rectangle contains the specified point.
Parameters
rx:Number — the x-coordinate of the upper left corner of the rectangle.
| |
ry:Number — the y-coordinate of the upper left corner of the rectangle.
| |
rw:Number — the width of the rectangle.
| |
rh:Number — the height of the rectangle.
| |
x:Number — the x-coordinate of the point to check.
| |
y:Number — the x-coordinate of the point to check.
| |
closed:Boolean — if true , all points on the border of the rectangle are considered to be contained.
|
Boolean — true if the point lies inside the rectangle; false otherwise.
|
containsPoint | () | method |
public function containsPoint(p:YPoint):Boolean
Checks whether or not this YRectangle
contains the given point.
Parameters
p:YPoint |
Boolean |
containsPoint2 | () | method |
public function containsPoint2(x:Number, y:Number):Boolean
Checks whether or not this YRectangle
contains the given point.
Parameters
x:Number — the x-coordinate of the point to check.
| |
y:Number — the x-coordinate of the point to check.
|
Boolean — true if the point lies inside the rectangle; false otherwise.
|
containsRectangle | () | method |
public function containsRectangle(p:YRectangle):Boolean
Checks whether or not this YRectangle
contains the given rectangle.
Parameters
p:YRectangle |
Boolean |
containsRectangle2 | () | method |
public function containsRectangle2(x:Number, y:Number, width:Number, height:Number):Boolean
Checks whether or not this YRectangle
contains the rectangle defined by the given frame.
Parameters
x:Number | |
y:Number | |
width:Number | |
height:Number |
Boolean |
equals | () | method |
override public function equals(o:Object):Boolean
Parameters
o:Object |
Boolean |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getManhattanDistance | () | method |
public function getManhattanDistance(other:YRectangle):Number
Returns the Manhattan distance to the passed rectangle. If they overlap the distance is 0.
Parameters
other:YRectangle — the second rectangle.
|
Number — the distance to the given rectangle.
|
hashCode | () | method |
override public function hashCode():int
Returnsint |
initYRectangle1 | () | method |
protected final function initYRectangle1():void
Initializes this object. See the documentation of the corresponding factory method newYRectangle1()
for details.
See also
initYRectangle2 | () | method |
protected final function initYRectangle2(pos:YPoint, size:YDimension):void
Initializes this object. See the documentation of the corresponding factory method newYRectangle2()
for details.
Parameters
pos:YPoint | |
size:YDimension |
See also
initYRectangle3 | () | method |
protected final function initYRectangle3(x:Number, y:Number, width:Number, height:Number):void
Initializes this object. See the documentation of the corresponding factory method newYRectangle3()
for details.
Parameters
x:Number | |
y:Number | |
width:Number | |
height:Number |
See also
intersects | () | method |
public static function intersects(r1:YRectangle, r2:YRectangle):Boolean
Returns whether or not the given rectangles intersect.
Parameters
r1:YRectangle | |
r2:YRectangle |
Boolean |
newYRectangle1 | () | method |
public static function newYRectangle1():YRectangle
Creates a new rectangle with upper left corner (0,0) and size (0,0).
ReturnsYRectangle |
newYRectangle2 | () | method |
public static function newYRectangle2(pos:YPoint, size:YDimension):YRectangle
Creates a new rectangle with given upper left corner and size.
Parameters
pos:YPoint — upper left corner of the rectangle.
| |
size:YDimension — size of the rectangle.
|
YRectangle |
newYRectangle3 | () | method |
public static function newYRectangle3(x:Number, y:Number, width:Number, height:Number):YRectangle
Creates a new rectangle with given upper left corner and size.
Parameters
x:Number — x-coordinate of upper left corner of the rectangle.
| |
y:Number — y-coordinate of upper left corner of the rectangle.
| |
width:Number — width of the rectangle.
| |
height:Number — height of the rectangle.
|
YRectangle |
toString | () | method |
override public function toString():String
Returns a string representation of this rectangle
ReturnsString |