Point

Source: AWT.js:584

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


Constructor

new Point(x: number | Point, y?: number): Point

Point constructor

Parameters

  • x (number | Point) — When x is an Point object, a clone of it will be created.
  • y (number, optional) — Not used when x is an Point

Instance Methods

setProperties($xml: external:jQuery): module:AWT.Point

Reads the properties of this Point from an XML element

Parameters

Returns

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

  • object

setAttributes(data: object): module:AWT.Point

Reads the properties of this Point from a data object

Parameters

  • data (object) — The data object to be parsed

Returns

moveBy(delta: Point | Dimension): module:AWT.Point

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

Parameters

Returns

moveTo(newPos: number | Point, y?: number): module:AWT.Point

Moves this Point to a new position

Parameters

  • newPos (number | Point) — The new position, or a x coordinate
  • y (number, optional) — null or undefined when newPos is a Point

Returns

multBy(delta: Point | Dimension): module:AWT.Point

Multiplies the x and y coordinates by a specified delta

Parameters

Returns

equals(p: module:AWT.Point): boolean

Checks if two points are at the same place

Parameters

Returns

  • boolean

distanceTo(point: module:AWT.Point): number

Calculates the distance between two points

Parameters

Returns

  • number

clone(): module:AWT.Point

Clones this point

Returns

Instance Fields

x: number

y: number