Print Friendly

Class YAHOO.util.Point

Package:YAHOO.util
Class:Point
Extends:Region
Defined In:dom.js
A point is a region that is special in that it represents a single point on the grid.

Public Properties

Property Defined By
  1 : Int Region
The region's top extent as index, for symmetry with set/getXY
  bottom : Int Region
The region's bottom extent
  left : Int Region
The region's left extent
  right : int Region
The region's right extent
  top : Int Region
The region's top extent
  x : Int Point
The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)
  y : Int Point
The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)

Public Methods

Method Defined By
  Point() Point
  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

1

public Int 1
The region's top extent as index, for symmetry with set/getXY
This property is defined by Region.

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.

top

public Int top
The region's top extent
This property is defined by Region.

x

public Int x
The X position of the point, which is also the right, left and index zero (for Dom.getXY symmetry)
This property is defined by Point.

y

public Int y
The Y position of the point, which is also the top, bottom and index one (for Dom.getXY symmetry)
This property is defined by Point.

Constructor Details

Point

public function Point()
Parameters:
  • None.

Method Details

contains

public function contains(Region region)
Returns true if this region contains the region passed in
Parameters:
  • region : Region
    The region to evaluate
Returns:
  • Boolean
    True if the region is contained with this region, else false
This method is defined by Region.

getArea

public function getArea()
Returns the area of the region
Parameters:
  • None.
Returns:
  • Int
    the region's area
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 : HTMLElement
    The element
Returns:
  • Region
    The region that the element occupies
This method is defined by Region.

intersect

public function intersect(Region region)
Returns the region where the passed in region overlaps with this one
Parameters:
  • region : Region
    The region that intersects
Returns:
  • Region
    The overlap region, or null if there is no overlap
This method is defined by Region.

toString

public function toString()
toString
Parameters:
  • None.
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.
Parameters:
  • region : Region
    The region that to create the union with
Returns:
  • Region
    The union region
This method is defined by Region.

yui-ext - Copyright © 2006 Jack Slocum. | Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.