| Package | com.afcomponents.umap.types |
| Class | public class Bounds |
Notice that a rectangle in geographical coordinates is represented by a LatLngBounds object.
New Bounds rectangle can be created using any number of points represented by Point objects.
import com.afcomponents.umap.types.Bounds; import flash.geom.Point; var point1:Point = new Point(0,0); var point2:Point = new Point(10,20); var point3:Point = new Point(-5,10); var bounds:Bounds = new Bounds(point1, point2, point3); trace(bounds); // traces (min=(x=-5, y=0), max=(x=10, y=20))
See also
| Property | Defined by | ||
|---|---|---|---|
| center : Point [read-only]
The coordiantes of the center of the rectangle as a Point object.
| Bounds | ||
| height : Number [read-only]
The height of the rectangle.
| Bounds | ||
| max : Point
Gets or sets the maximum (bottom-right) coordinate of the rectangle.
| Bounds | ||
| maxX : Number
Gets or sets the x coordinate of the right edge of the rectangle.
| Bounds | ||
| maxY : Number
Gets or sets the x coordinate of the bottom edge of the rectangle.
| Bounds | ||
| min : Point
Gets or sets the minimum (top-left) coordinate of the rectangle.
| Bounds | ||
| minX : Number
Gets or sets the x coordinate of the left edge of the rectangle.
| Bounds | ||
| minY : Number
Gets or sets the y coordinate of the top edge of the rectangle.
| Bounds | ||
| width : Number [read-only]
The width of the rectangle.
| Bounds | ||
| Method | Defined by | ||
|---|---|---|---|
|
Bounds(... points)
Bounds constructor.
| Bounds | ||
|
Creates a copy of this Bounds object.
| Bounds | ||
|
containsPoint(point:Point):Boolean
Checks whether given point lies within this rectangle.
| Bounds | ||
|
containsRect(rect:Bounds):Boolean
| Bounds | ||
|
Determines whether two rectangles are equal.
| Bounds | ||
|
extend(point:Point):Boolean
Enlarges the rectangular area so that the point is also contained in the rectangular area.
| Bounds | ||
|
getCenter():Point
Return coordinates of the center point
| Bounds | ||
|
getTypeFromXML(xml:XML):Bounds
[static]
Returns new object, which will be constructed from the source XML data.
| Bounds | ||
|
getXMLFromType(bounds:Bounds, name:String):XML
[static]
Returns XML data that describes the Object.
| Bounds | ||
|
inflate(x:Number, y:Number):void
| Bounds | ||
| Bounds | |||
|
intersects(rect:Bounds):Boolean
| Bounds | ||
|
isValid():Boolean
Validates the rectangle.
| Bounds | ||
|
placeInsideBounds(rect:Bounds):void
| Bounds | ||
|
toString():String
Returns a
String that represents the coordinates of the rectangle's corners. | Bounds | ||
| Constant | Defined by | ||
|---|---|---|---|
| DEFAULT_NODE_NAME : String = "bounds" [static]
Defines default root node name for XML conversion.
| Bounds | ||
| center | property |
center:Point [read-only]The coordiantes of the center of the rectangle as a Point object. If target rectangle is invalid, center point equals null.
Implementation public function get center():Point
See also
| height | property |
height:Number [read-only]The height of the rectangle. If target rectangle is invalid, width equals Number.NaN.
Implementation public function get height():Number
See also
| max | property |
max:Point [read-write]Gets or sets the maximum (bottom-right) coordinate of the rectangle.
Implementation public function get max():Point
public function set max(value:Point):void
See also
| maxX | property |
maxX:Number [read-write]Gets or sets the x coordinate of the right edge of the rectangle.
Please note that if the maximum point have been set to null,
it will created as a new Point(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) object.
The default value is Number.NEGATIVE_INFINITY.
public function get maxX():Number
public function set maxX(value:Number):void
See also
| maxY | property |
maxY:Number [read-write]Gets or sets the x coordinate of the bottom edge of the rectangle.
Please note that if the maximum point have been set to null,
it will created as a new Point(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY) object.
The default value is Number.NEGATIVE_INFINITY.
public function get maxY():Number
public function set maxY(value:Number):void
See also
| min | property |
min:Point [read-write]Gets or sets the minimum (top-left) coordinate of the rectangle.
Implementation public function get min():Point
public function set min(value:Point):void
See also
| minX | property |
minX:Number [read-write]Gets or sets the x coordinate of the left edge of the rectangle.
Please note that if the minimum point have been set to null,
it will created as a new Point(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY) object.
The default value is Number.POSITIVE_INFINITY.
public function get minX():Number
public function set minX(value:Number):void
See also
| minY | property |
minY:Number [read-write]Gets or sets the y coordinate of the top edge of the rectangle.
Please note that if the minimum point have been set to null,
it will created as a new Point(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY) object.
The default value is Number.POSITIVE_INFINITY.
public function get minY():Number
public function set minY(value:Number):void
See also
| width | property |
width:Number [read-only]The width of the rectangle. If target rectangle is invalid, width equals Number.NaN.
Implementation public function get width():Number
See also
| Bounds | () | constructor |
public function Bounds(... points)Bounds constructor.
Constructs a rectangle from any number of Point objects. You can specify them either as a comma-separated list or as an Array instance.
var bounds:Bounds = new Bounds(point1, point2, point3);
var points:Array = new Array(point1, point2, point3); var bounds:Bounds = new Bounds(points);
Bounds object is saved as two Point objects that
indicate minimum (top-left) and maximum (bottom-right) corners of the rectangular area.
... points — Any number of Point objects or an Array of Point objects.
|
See also
| clone | () | method |
public function clone():BoundsCreates a copy of this Bounds object.
ReturnsBounds —
A copy of this object.
|
| containsPoint | () | method |
public function containsPoint(point:Point):BooleanChecks whether given point lies within this rectangle.
Returns true if given point lies within the rectangular area.
Returns false if given point lies outside of the rectangular area,
or if specified point or target rectangle are invalid.
point:Point — Target point for checking.
|
Boolean — A value of true if given point lies within the rectangular area; false if it is not.
|
See also
| containsRect | () | method |
| equals | () | method |
public function equals(other:Bounds):BooleanDetermines whether two rectangles are equal.
Two rectangles are equal if all parameters in this rectangle are equal to the parameters of the other.
Parametersother:Bounds — The object to be compared.
|
Boolean — A value of true if object is equal to this Bounds object; false if it is not.
|
| extend | () | method |
public function extend(point:Point):BooleanEnlarges the rectangular area so that the point is also contained in the rectangular area.
Returns true if the original area have been extended.
Returns false if no changes have been made to the original rectangle.
Please note that you cannot extend invalid Bounds object.
point:Point — Target point for extending.
|
Boolean — A value of true if the original area have been extended; false if it is not.
|
See also
| getCenter | () | method |
public function getCenter():PointReturn coordinates of the center point
ReturnsPoint — A point which indicates the rectangle's center, or null if the rectangle is not valid.
|
| getTypeFromXML | () | method |
public static function getTypeFromXML(xml:XML):BoundsReturns new object, which will be constructed from the source XML data.
Parametersxml:XML — Source XML data.
|
Bounds —
Object that was constructed from the source XML data.
|
| getXMLFromType | () | method |
public static function getXMLFromType(bounds:Bounds, name:String):XMLReturns XML data that describes the Object. You can also specify root node name in the second parameter.
Parametersbounds:Bounds — Object that should be converted to XML.
|
|
name:String — Root node name.
|
XML — XML data that describes the properties of the source object.
|
| inflate | () | method |
public function inflate(x:Number, y:Number):voidParameters
x:Number |
|
y:Number |
| intersection | () | method |
| intersects | () | method |
| isValid | () | method |
public function isValid():BooleanValidates the rectangle.
Returns true if both minimum (top-left) and maximum (bottom-right) points are defined.
Returns false if minimum (top-left) or maximum (bottom-right) are invalid or have a value of null.
Boolean — A value of true if both minimum and maximum points are defined; false if they are not.
|
See also
| placeInsideBounds | () | method |
| toString | () | method |
public function toString():String
Returns a String that represents the coordinates of the rectangle's corners.
The output will look like "(min=top-left corner, max=bottom-right corner)"
ReturnsString — A textual representation of the rectangle.
|
| DEFAULT_NODE_NAME | constant |
public static const DEFAULT_NODE_NAME:String = "bounds"Defines default root node name for XML conversion.