Revize db835ac0
Přidáno uživatelem Pavel Fidranský před více než 6 roky(ů)
sources/src/main/webapp/js/valueObjects/coordinates.js | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Class representing a coordinates pair. |
3 |
* @constructor |
|
4 |
* @param {float} x X coordinate. |
|
5 |
* @param {float} y Y coordinate. |
|
6 | 3 |
*/ |
7 |
function Coordinates(x, y) { |
|
8 |
/** @prop {float} x X coordinate. */ |
|
9 |
this.x = x; |
|
10 |
/** @prop {float} y Y coordinate. */ |
|
11 |
this.y = y; |
|
4 |
class Coordinates { |
|
5 |
/** |
|
6 |
* @constructor |
|
7 |
* @param {float} x X coordinate. |
|
8 |
* @param {float} y Y coordinate. |
|
9 |
*/ |
|
10 |
constructor(x, y) { |
|
11 |
this.x = x; |
|
12 |
this.y = y; |
|
13 |
} |
|
12 | 14 |
} |
sources/src/main/webapp/js/valueObjects/diagram.js | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Class representing a saved diagram. |
3 |
* @constructor |
|
4 |
* @param {object} props Properties of the diagram. |
|
5 | 3 |
*/ |
6 |
function Diagram(props) { |
|
7 |
/** @prop {int} id Identifier of the diagram. */ |
|
8 |
this.id = parseInt(props.id); |
|
9 |
/** @prop {string} name Name of the diagram. */ |
|
10 |
this.name = props.name; |
|
11 |
/** @prop {bool} public True if the diagram is public, otherwise false. */ |
|
12 |
this.public = props.public === '1'; |
|
4 |
class Diagram { |
|
5 |
/** |
|
6 |
* @constructor |
|
7 |
* @param {object} props Object loaded from database holding properties of the diagram. |
|
8 |
*/ |
|
9 |
constructor(props) { |
|
10 |
this.id = parseInt(props.id); |
|
11 |
this.name = props.name; |
|
12 |
this.public = props.public === '1'; |
|
13 |
} |
|
13 | 14 |
} |
sources/src/main/webapp/js/valueObjects/dimensions.js | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Class representing a dimensions pair. |
3 |
* @constructor |
|
4 |
* @param {float} width Width dimension. |
|
5 |
* @param {float} height Height dimension. |
|
6 | 3 |
*/ |
7 |
function Dimensions(width, height) { |
|
8 |
/** @prop {float} width Width dimension. */ |
|
9 |
this.width = width; |
|
10 |
/** @prop {float} height Height dimension. */ |
|
11 |
this.height = height; |
|
4 |
class Dimensions { |
|
5 |
/** |
|
6 |
* @constructor |
|
7 |
* @param {float} width Width dimension. |
|
8 |
* @param {float} height Height dimension. |
|
9 |
*/ |
|
10 |
constructor(width, height) { |
|
11 |
this.width = width; |
|
12 |
this.height = height; |
|
13 |
} |
|
12 | 14 |
} |
Také k dispozici: Unified diff
reworked VO classes to ES6 classes