Class Index | File Index

Classes


Class Point


Defined in: primitives.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Point(x, y)
Creates an instance of Point
Field Summary
Field Attributes Field Name and Description
 
Serialization type
 
The Style of the Point
 
x
The x coordinate of point
 
y
The y coordinate of point
Method Summary
Method Attributes Method Name and Description
 
Clone current Point
<static>  
Point.cloneArray(v)
Clones an array of points
 
contains(x, y)
 
equals(anotherPoint)
Tests if this point is similar to other point
 
 
<static>  
Point.load(o)
Creates a {Point} out of JSON parsed object
<static>  
Point.loadArray(v)
Creates an array of points from an array of {JSONObject}s
 
near(x, y, radius)
Tests to see if a point (x, y) is within a range of current Point
 
paint(context)
Paint current {Point} withing a context If you want to use a different style then the default one change the style
 
 
We will draw a point a circle.
 
transform(matrix)
Class Detail
Point(x, y)
Creates an instance of Point
Author: Alex Gheorghiu Note: Even if it is named Point this class should be named Dot as Dot is closer then Point from math perspective..
Parameters:
{Number} x
The x coordinate of point.
{Number} y
The y coordinate of point.
Field Detail
oType
Serialization type

style
The Style of the Point

x
The x coordinate of point

y
The y coordinate of point
Method Detail
clone()
Clone current Point

<static> Point.cloneArray(v)
Clones an array of points
Parameters:
{Array} v
- the array of {Point}s
Returns:
an {Array} of {Point}s

contains(x, y)
Parameters:
x
y

equals(anotherPoint)
Tests if this point is similar to other point
Parameters:
{Point} anotherPoint
- the other point

getBounds()

getPoints()

<static> {Point} Point.load(o)
Creates a {Point} out of JSON parsed object
Author: Alex Gheorghiu .
Parameters:
{JSONObject} o
- the JSON parsed object
Returns:
{Point} a newly constructed Point

<static> Point.loadArray(v)
Creates an array of points from an array of {JSONObject}s
Parameters:
{Array} v
- the array of JSONObjects
Returns:
an {Array} of {Point}s

near(x, y, radius)
Tests to see if a point (x, y) is within a range of current Point
Author: Alex Gheorghiu .
Parameters:
{Numeric} x
- the x coordinate of tested point
{Numeric} y
- the x coordinate of tested point
{Numeric} radius
- the radius of the vicinity

paint(context)
Paint current {Point} withing a context If you want to use a different style then the default one change the style
Parameters:
context

toString()

toSVG()
We will draw a point a circle. The "visual" color and thicknes of the point will be created by the SVG's element style
See:
http://tutorials.jenkov.com/svg/circle-element.html Example:

transform(matrix)
Parameters:
matrix

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Jun 09 2011 12:47:26 GMT+0300 (EEST)