AWT. Point

Contains the x andy y coordinates of a point, and provides some useful methods.

Constructor

new Point(x, yopt)

Point constructor

Parameters:
NameTypeAttributesDescription
xnumber | Point

When x is an Point object, a clone of it will be created.

ynumber<optional>

Not used when x is an Point

Members

x :number

Type:
  • number

y :number

Type:
  • number

Methods

clone() → {module:AWT.Point}

Clones this point

Returns:
Type: 
module:AWT.Point

distanceTo(point) → {number}

Calculates the distance between two points

Parameters:
NameTypeDescription
pointmodule:AWT.Point

The Point to calculate the distance against to

Returns:
  • The distance between the two points.
Type: 
number

equals(p) → {boolean}

Checks if two points are at the same place

Parameters:
NameTypeDescription
pmodule:AWT.Point

The Point to check against to

Returns:
Type: 
boolean

getAttributes() → {object}

Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.

Returns:
  • The resulting object, with minimal attrributes
Type: 
object

moveBy(delta) → {module:AWT.Point}

Moves this Point to a new position, by a specified displacement

Parameters:
NameTypeDescription
deltaPoint | Dimension

The amount to move

Returns:
Type: 
module:AWT.Point

moveTo(newPos, yopt) → {module:AWT.Point}

Moves this Point to a new position

Parameters:
NameTypeAttributesDescription
newPosnumber | Point

The new position, or a x coordinate

ynumber<optional>

null or undefined when newPos is a Point

Returns:
Type: 
module:AWT.Point

multBy(delta) → {module:AWT.Point}

Multiplies the x and y coordinates by a specified delta

Parameters:
NameTypeDescription
deltaPoint | Dimension

The amount to multiply by.

Returns:
Type: 
module:AWT.Point

setAttributes(data) → {module:AWT.Point}

Reads the properties of this Point from a data object

Parameters:
NameTypeDescription
dataobject

The data object to be parsed

Returns:
Type: 
module:AWT.Point

setProperties($xml) → {module:AWT.Point}

Reads the properties of this Point from an XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The xml element to be parsed

Returns:
Type: 
module:AWT.Point