Constructor
new Dimension(w, h)
Dimension constructor
Name | Type | Description |
---|---|---|
w | number | | The width of this Dimension, or the upper-left vertex of a |
h | number | | The height of this Dimension, or the bottom-right vertex of a |
Members
height :number
- number
width :number
- number
Methods
equals(d) → {boolean}
Check if two dimensions are equivalent
Name | Type | Description |
---|---|---|
d | module:AWT. |
- 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.
- The resulting object, with minimal attrributes
- Type:
- object
getSurface() → {number}
Calculates the area of a Rectangle with this dimension
The resulting area
- Type:
- number
multBy(delta) → {module:AWT.Dimension}
Multiplies the w
and h
co-ordinates by a specified delta
Name | Type | Description |
---|---|---|
delta | Point | |
- Type:
- module:AWT.
Dimension
setAttributes(data) → {module:AWT.Dimension}
Reads the properties of this Dimension from a data object
Name | Type | Description |
---|---|---|
data | object | The data object to be parsed |
- Type:
- module:AWT.
Dimension
setDimension(width, heightopt) → {module:AWT.Dimension}
Sets new values for width and height.width
can be a number or another Dimension
object
Name | Type | Attributes | Description |
---|---|---|---|
width | number | | The new width, or a full Dimension to copy it from. | |
height | number | <optional> | Not used when |
- Type:
- module:AWT.
Dimension
setProperties($xml) → {module:AWT.Dimension}
Reads the properties of this Dimension from an XML element
Name | Type | Description |
---|---|---|
$xml | external:jQuery | The xml element to be parsed |
- Type:
- module:AWT.
Dimension