Class YAHOO.util.Region
Package: | YAHOO.util |
Class: | Region |
Extends: | Object |
Subclasses: | Point |
Defined In: | dom.js |
A region is a representation of an object on a grid. It is defined
by the top, right, bottom, left extents, so is rectangular by default. If
other shapes are required, this class could be extended to support it.
Public Properties
|
bottom : Int |
Region |
The region's bottom extent |
|
left : Int |
Region |
The region's left extent |
|
right : int |
Region |
The region's right extent |
|
1 : Int |
Region |
The region's top extent as index, for symmetry with set/getXY |
|
top : Int |
Region |
The region's top extent |
Public Methods
|
Region() |
Region |
|
|
contains(Region region ) : Boolean |
Region |
Returns true if this region contains the region passed in |
|
getArea() : Int |
Region |
Returns the area of the region |
|
getRegion(HTMLElement el ) : Region |
Region |
<static> Returns a region that is occupied by the DOM element |
|
intersect(Region region ) : Region |
Region |
Returns the region where the passed in region overlaps with this one |
|
toString() : string |
Region |
toString |
|
union(Region region ) : Region |
Region |
Returns the region representing the smallest region that can contain both
the passed in region and this region. |
Public Events
This class has no public events.
Property Details
bottom
public Int bottom
The region's bottom extent
This property is defined by Region.
left
public Int left
The region's left extent
This property is defined by Region.
right
public int right
The region's right extent
This property is defined by Region.
1
public Int 1
The region's top extent as index, for symmetry with set/getXY
This property is defined by Region.
top
public Int top
The region's top extent
This property is defined by Region.
Constructor Details
Region
public function Region()
Method Details
contains
public function contains(Region region
)
Returns true if this region contains the region passed in
Parameters:
region
: RegionThe region to evaluate
Returns:
This method is defined by Region.
getArea
public function getArea()
Returns the area of the region
This method is defined by Region.
getRegion
public function getRegion(HTMLElement el
)
<static> Returns a region that is occupied by the DOM element
Parameters:
el
: HTMLElementThe element
Returns:
This method is defined by Region.
intersect
public function intersect(Region region
)
Returns the region where the passed in region overlaps with this one
This method is defined by Region.
toString
public function toString()
toString
Parameters:
Returns:
string
the region properties
This method is defined by Region.
union
public function union(Region region
)
Returns the region representing the smallest region that can contain both
the passed in region and this region.
This method is defined by Region.
yui-ext - Copyright © 2006 Jack Slocum. |
Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.