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): PointPoint constructor
Parameters
x(number | Point) — Whenxis anPointobject, a clone of it will be created.y(number, optional) — Not used whenxis anPoint
Instance Methods
setProperties($xml: external:jQuery): module:AWT.Point
Reads the properties of this Point from an XML element
Parameters
$xml(external:jQuery) — The xml element to be parsed
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 coordinatey(number, optional) —nullorundefinedwhennewPosis 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
p(module:AWT.Point) — The Point to check against to
Returns
boolean
distanceTo(point: module:AWT.Point): number
Calculates the distance between two points
Parameters
point(module:AWT.Point) — The Point to calculate the distance against to
Returns
number
clone(): module:AWT.Point
Clones this point
Returns