diff --git a/dist/ueblueprint.js b/dist/ueblueprint.js index 0abf177..990104e 100755 --- a/dist/ueblueprint.js +++ b/dist/ueblueprint.js @@ -13,9 +13,9 @@ class Configuration { static linkCurveWidth = 80 // pixel static linkMinWidth = 100 // pixel /** - * @param {Number} start - * @param {Number} c1 - * @param {Number} c2 + * @param {Number} start + * @param {Number} c1 + * @param {Number} c2 * @returns {String} */ static linkRightSVGPath = (start, c1, c2) => { @@ -137,7 +137,7 @@ class ITemplate { /** * Computes the html content of the target element. * @param {IElement} entity Element of the graph - * @returns The result html + * @returns The result html */ render(entity) { return "" @@ -184,7 +184,6 @@ class OrderedIndexArray { } /** - * * @param {number} index The index of the value to return * @returns The element of the array */ @@ -230,7 +229,7 @@ class OrderedIndexArray { } } - /** + /** * Inserts the element in the array. * @param element {number} The value to insert into the array. * @returns {number} The position into occupied by value into the array. @@ -389,7 +388,7 @@ class FastSelectionModel { computeBoundaries() { this.boundaries = { - // Primary axis negative expanding + // Primary axis negative expanding primaryN: { v: this.primaryOrder.getPrevValue(), i: this.primaryOrder.getPrev() @@ -487,7 +486,6 @@ class IElement extends HTMLElement { static tagName = "" /** - * * @param {IEntity} entity The entity containing blueprint related data for this graph element * @param {ITemplate} template The template to render this node */ @@ -623,9 +621,8 @@ class BlueprintTemplate extends ITemplate { } /** - * - * @param {Blueprint} element - * @returns + * @param {Blueprint} element + * @returns */ viewport(element) { return html` @@ -645,8 +642,8 @@ class BlueprintTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {HTMLElement} element Target element - * @returns The computed html + * @param {HTMLElement} element Target element + * @returns The computed html */ render(element) { return html` @@ -772,8 +769,8 @@ class TypeInitialization { } /** - * @param {typeof Object} type - * @param {boolean} showDefault + * @param {typeof Object} type + * @param {boolean} showDefault * @param {*} value */ constructor(type, showDefault = true, value = undefined) { @@ -801,10 +798,9 @@ class Utility { } /** - * - * @param {Number[]} viewportLocation - * @param {HTMLElement} movementElement - * @returns + * @param {Number[]} viewportLocation + * @param {HTMLElement} movementElement + * @returns */ static convertLocation(viewportLocation, movementElement) { const scaleCorrection = 1 / Utility.getScale(movementElement); @@ -818,14 +814,14 @@ class Utility { /** * Sets a value in an object + * @param {Object} target Object holding the data * @param {String[]} keys The chained keys to access from object in order to set the value - * @param {any} value Value to be set - * @param {Object} target Object holding the data + * @param {*} value Value to be set * @param {Boolean} create Whether to create or not the key in case it doesn't exist * @returns {Boolean} Returns true on succes, false otherwise */ static objectSet(target, keys, value, create = false) { - if (keys.constructor != Array) { + if (!(keys instanceof Array)) { console.error("Expected keys to be an array."); } if (keys.length == 1) { @@ -834,7 +830,7 @@ class Utility { return true } } else if (keys.length > 0) { - if (create && target[keys[0]] === undefined) { + if (create && !(target[keys[0]] instanceof Object)) { target[keys[0]] = {}; } return Utility.objectSet(target[keys[0]], keys.slice(1), value, create) @@ -844,13 +840,13 @@ class Utility { /** * Gets a value from an object, gives defaultValue in case of failure - * @param {Object} source Object holding the data + * @param {Object} source Object holding the data * @param {String[]} keys The chained keys to access from object in order to get the value * @param {any} defaultValue Value to return in case from doesn't have it * @returns {any} The value in from corresponding to the keys or defaultValue otherwise */ static objectGet(source, keys, defaultValue = null) { - if (keys.constructor != Array) { + if (!(keys instanceof Array)) { console.error("Expected keys to be an array."); } if (keys.length == 0 || !(keys[0] in source) || source[keys[0]] === undefined) { @@ -869,8 +865,8 @@ class Utility { } /** - * - * @param {String} value + * + * @param {String} value */ static FirstCapital(value) { return value.charAt(0).toUpperCase() + value.substring(1) @@ -889,9 +885,8 @@ class Utility { } /** - * - * @param {Number[]} location - * @param {Number} gridSize + * @param {Number[]} location + * @param {Number} gridSize */ static snapToGrid(location, gridSize = Configuration.gridSize) { if (gridSize === 1) { @@ -908,10 +903,9 @@ class IEntity { constructor(options = {}) { /** - * - * @param {String[]} prefix - * @param {Object} target - * @param {Object} properties + * @param {String[]} prefix + * @param {Object} target + * @param {Object} properties */ const defineAllAttributes = (prefix, target, properties) => { let fullKey = prefix.concat(""); @@ -926,7 +920,7 @@ class IEntity { } /* * The value can either be: - * - Array: can contain multiple values, its property is assigned multiple times like (X=1, X=4, X="Hello World") + * - Array: can contain multiple values, its property is assigned multiple times like (X=1, X=4, X="Hello World") * - TypeInitialization: contains the maximum amount of information about the attribute. * - A type: the default value will be default constructed object without arguments. * - A proper value. @@ -963,9 +957,6 @@ class ObjectReferenceEntity extends IEntity { type: String, path: String } - - /** @type {String} */ type - /** @type {String} */ path } class FunctionReferenceEntity extends IEntity { @@ -994,11 +985,9 @@ class GuidEntity extends IEntity { values.forEach(n => { guid += ("0".repeat(8) + n.toString(16).toUpperCase()).slice(-8); }); - return new GuidEntity({ valud: guid }) + return new GuidEntity({ value: guid }) } - /** @type {String} */ value - toString() { return this.value } @@ -1020,8 +1009,6 @@ class IntegerEntity extends IEntity { this.value = Math.round(this.value); } - /** @type {Number} */ value - valueOf() { return this.value } @@ -1039,16 +1026,10 @@ class LocalizedTextEntity extends IEntity { key: String, value: String } - - /** @type {String} */ namespace - /** @type {String} */ key - /** @type {String} */ value } class PathSymbolEntity extends IEntity { - //value - static attributes = { value: String } @@ -1064,9 +1045,6 @@ class PinReferenceEntity extends IEntity { objectName: PathSymbolEntity, pinGuid: GuidEntity } - - /** @type {PathSymbolEntity} */ objectName - /** @type {GuidEntity} */ pinGuid } /** @@ -1116,23 +1094,6 @@ class PinEntity extends IEntity { bOrphanedPin: false, } - /** @type {GuidEntity} */ PinId - /** @type {String} */ PinName - /** @type {LocalizedTextEntity} */ PinFriendlyName - /** @type {String} */ PinToolTip - /** @type {String} */ Direction - /** @type {PinTypeObjectType} */ PinType - /** @type {PinReferenceEntity[]} */ LinkedTo - /** @type {String} */ DefaultValue - /** @type {String} */ AutogeneratedDefaultValue - /** @type {GuidEntity} */ PersistentGuid - /** @type {Boolean} */ bHidden - /** @type {Boolean} */ bNotConnectable - /** @type {Boolean} */ bDefaultValueIsReadOnly - /** @type {Boolean} */ bDefaultValueIsIgnored - /** @type {Boolean} */ bAdvancedView - /** @type {Boolean} */ bOrphanedPin - isInput() { return !this.bHidden && this.Direction !== "EGPD_Output" } @@ -1146,8 +1107,7 @@ class PinEntity extends IEntity { } /** - * - * @param {PinReferenceEntity} pinReferenceEntity + * @param {PinReferenceEntity} pinReferenceEntity */ connectTo(pinReferenceEntity) { /** @type {PinReferenceEntity[]} */ @@ -1169,10 +1129,6 @@ class VariableReferenceEntity extends IEntity { MemberGuid: GuidEntity, bSelfContext: false } - - /** @type {String} */ MemberName - /** @type {GuidEntity} */ MemberGuid - /** @type {Boolean} */ bSelfContext } class ObjectEntity extends IEntity { @@ -1193,20 +1149,6 @@ class ObjectEntity extends IEntity { CustomProperties: [PinEntity] } - /** @type {ObjectReferenceEntity} */ Class - /** @type {String} */ Name - /** @type {Boolean} */ bIsPureFunc - /** @type {VariableReferenceEntity} */ VariableReference - /** @type {FunctionReferenceEntity} */ FunctionReference - /** @type {FunctionReferenceEntity} */ EventReference - /** @type {ObjectReferenceEntity} */ TargetType - /** @type {IntegerEntity} */ NodePosX - /** @type {IntegerEntity} */ NodePosY - /** @type {GuidEntity} */ NodeGuid - /** @type {IntegerEntity} */ ErrorType - /** @type {String} */ ErrorMsg - /** @type {PinEntity[]} */ CustomProperties - /** * @returns {String} The name of the node */ @@ -1444,6 +1386,11 @@ class ISerializer { } } + /** + * @param {String[]} key + * @param {Object} object + * @returns {String} + */ subWrite(key, object) { let result = ""; let fullKey = key.concat(""); @@ -1507,8 +1454,7 @@ class ObjectSerializer extends ISerializer { } /** - * - * @param {String} value + * @param {String} value * @returns {ObjectEntity[]} */ readMultiple(value) { @@ -1521,9 +1467,7 @@ class ObjectSerializer extends ISerializer { } /** - * - * @param {ObjectEntity} object - * @returns + * @param {ObjectEntity} object */ write(object) { let result = `Begin Object Class=${this.writeValue(object.Class)} Name=${this.writeValue(object.Name)} @@ -1622,7 +1566,6 @@ class IKeyboardShortcut extends IContext { } /** - * * @param {String} keyString * @returns {Object} */ @@ -1649,10 +1592,9 @@ class IKeyboardShortcut extends IContext { class KeyvoardCanc extends IKeyboardShortcut { /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {OBject} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {OBject} options */ constructor(target, blueprint, options = {}) { options = IKeyboardShortcut.keyOptionsParse(options, Configuration.deleteNodesKeyboardKey); @@ -1667,10 +1609,9 @@ class KeyvoardCanc extends IKeyboardShortcut { class KeyboardSelectAll extends IKeyboardShortcut { /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {Object} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {Object} options */ constructor(target, blueprint, options = {}) { options = IKeyboardShortcut.keyOptionsParse(options, Configuration.selectAllKeyboardKey); @@ -1737,8 +1678,8 @@ class LinkTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {LinkElement} link connecting two graph nodes - * @returns The result html + * @param {LinkElement} link connecting two graph nodes + * @returns The result html */ render(link) { const uniqueId = crypto.randomUUID(); @@ -1766,7 +1707,6 @@ class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element */ applyStartDragging(link) { @@ -1779,7 +1719,6 @@ class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element */ applyFinishDragging(link) { @@ -1840,9 +1779,8 @@ class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element - * @param {LinkMessageElement} linkMessage + * @param {LinkMessageElement} linkMessage */ applyLinkMessage(link, linkMessage) { link.querySelectorAll(linkMessage.constructor.tagName).forEach(element => element.remove()); @@ -1894,16 +1832,14 @@ class LinkElement extends IElement { } /** - * - * @returns {Number[]} + * @returns {Number[]} */ getSourceLocation() { return this.sourceLocation } /** - * - * @param {Number[]} offset + * @param {Number[]} offset */ addSourceLocation(offset) { const location = [ @@ -1915,8 +1851,7 @@ class LinkElement extends IElement { } /** - * - * @param {Number[]} location + * @param {Number[]} location */ setSourceLocation(location) { if (location == null) { @@ -1927,7 +1862,6 @@ class LinkElement extends IElement { } /** - * * @returns {Number[]} */ getDestinationLocation() { @@ -1935,8 +1869,7 @@ class LinkElement extends IElement { } /** - * - * @param {Number[]} offset + * @param {Number[]} offset */ addDestinationLocation(offset) { const location = [ @@ -1947,8 +1880,7 @@ class LinkElement extends IElement { } /** - * - * @param {Number[]} location + * @param {Number[]} location */ setDestinationLocation(location) { if (location == null) { @@ -1959,7 +1891,6 @@ class LinkElement extends IElement { } /** - * * @returns {PinElement} */ getSourcePin() { @@ -1967,7 +1898,7 @@ class LinkElement extends IElement { } /** - * @param {PinElement} pin + * @param {PinElement} pin */ setSourcePin(pin) { if (this.#source) { @@ -1986,7 +1917,6 @@ class LinkElement extends IElement { } /** - * * @returns {PinElement} */ getDestinationPin() { @@ -1994,8 +1924,7 @@ class LinkElement extends IElement { } /** - * - * @param {PinElement} pin + * @param {PinElement} pin */ setDestinationPin(pin) { if (this.#destination) { @@ -2013,8 +1942,7 @@ class LinkElement extends IElement { } /** - * - * @param {LinkMessageElement} linkMessage + * @param {LinkMessageElement} linkMessage */ setLinkMessage(linkMessage) { if (linkMessage) { @@ -2044,9 +1972,7 @@ class IPointing extends IContext { } /** - * - * @param {MouseEvent} mouseEvent - * @returns + * @param {MouseEvent} mouseEvent */ locationFromEvent(mouseEvent) { return this.blueprint.compensateTranslation( @@ -2275,10 +2201,9 @@ class MouseTracking extends IPointing { class MouseMoveNodes extends IMouseClickDrag { /** - * - * @param {ISelectableDraggableElement} target - * @param {*} blueprint - * @param {*} options + * @param {ISelectableDraggableElement} target + * @param {*} blueprint + * @param {*} options */ constructor(target, blueprint, options) { super(target, blueprint, options); @@ -2404,8 +2329,7 @@ class LinkMessageTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {LinkMessageElement} linkMessage attached to link destination - * @returns The result html + * @param {LinkMessageElement} linkMessage */ render(linkMessage) { return html` @@ -2416,7 +2340,7 @@ class LinkMessageTemplate extends ITemplate { /** * Applies the style to the element. - * @param {LinkMessageElement} linkMessage element + * @param {LinkMessageElement} linkMessage */ apply(linkMessage) { super.apply(linkMessage); @@ -2495,7 +2419,7 @@ class LinkMessageElement extends IElement { customElements.define(LinkMessageElement.tagName, LinkMessageElement); -/** +/** * @typedef {import("../../element/LinkElement").default} LinkElement * @typedef {import("../../element/PinElement").default} PinElement */ @@ -2602,8 +2526,8 @@ class PinTemplate extends ITemplate { /** * Computes the html content of the pin. - * @param {PinElement} pin html element - * @returns The result html + * @param {PinElement} pin html element + * @returns The result html */ render(pin) { if (pin.isInput()) { @@ -2635,7 +2559,7 @@ class PinTemplate extends ITemplate { /** * Applies the connection style to the element. - * @param {PinElement} pin + * @param {PinElement} pin */ applyConnected(pin) { if (pin.isConnected()) { @@ -2646,9 +2570,7 @@ class PinTemplate extends ITemplate { } /** - * - * @param {PinElement} pin - * @returns + * @param {PinElement} pin */ getLinkLocation(pin) { const rect = pin.querySelector(".ueb-pin-icon").getBoundingClientRect(); @@ -2691,7 +2613,6 @@ class PinElement extends IElement { } /** - * * @returns {String} */ getPinDisplayName() { @@ -2771,8 +2692,8 @@ class NodeTemplate extends SelectableDraggableTemplate { /** * Computes the html content of the target element. - * @param {NodeElement} node Graph node element - * @returns The result html + * @param {NodeElement} node Graph node element + * @returns The result html */ render(node) { return html` @@ -2819,8 +2740,7 @@ class NodeElement extends ISelectableDraggableElement { static tagName = "ueb-node" /** - * - * @param {ObjectEntity} entity + * @param {ObjectEntity} entity */ constructor(entity) { super(entity, new NodeTemplate()); @@ -2841,7 +2761,6 @@ class NodeElement extends ISelectableDraggableElement { } /** - * * @returns {PinEntity[]} */ getPinEntities() { @@ -2963,8 +2882,7 @@ class Unfocus extends IContext { } /** - * - * @param {HTMLElement} e + * @param {HTMLElement} e */ clickedSomewhere(target) { // If target is outside the blueprint grid @@ -2991,10 +2909,9 @@ class IMouseWheel extends IPointing { #mouseParentWheelHandler /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {Object} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {Object} options */ constructor(target, blueprint, options) { options.wantsFocusCallback = true; @@ -3354,8 +3271,7 @@ class Blueprint extends IElement { } /** - * - * @param {...IElement} graphElements + * @param {...IElement} graphElements */ addGraphElement(...graphElements) { if (this.nodesContainerElement) { @@ -3378,8 +3294,7 @@ class Blueprint extends IElement { } /** - * - * @param {...IElement} graphElements + * @param {...IElement} graphElements */ removeGraphElement(...graphElements) { let removed = false; diff --git a/js/Blueprint.js b/js/Blueprint.js index 6b26af1..604177d 100755 --- a/js/Blueprint.js +++ b/js/Blueprint.js @@ -331,8 +331,7 @@ export default class Blueprint extends IElement { } /** - * - * @param {...IElement} graphElements + * @param {...IElement} graphElements */ addGraphElement(...graphElements) { if (this.nodesContainerElement) { @@ -355,8 +354,7 @@ export default class Blueprint extends IElement { } /** - * - * @param {...IElement} graphElements + * @param {...IElement} graphElements */ removeGraphElement(...graphElements) { let removed = false diff --git a/js/Configuration.js b/js/Configuration.js index 7762598..56e4406 100755 --- a/js/Configuration.js +++ b/js/Configuration.js @@ -13,9 +13,9 @@ export default class Configuration { static linkCurveWidth = 80 // pixel static linkMinWidth = 100 // pixel /** - * @param {Number} start - * @param {Number} c1 - * @param {Number} c2 + * @param {Number} start + * @param {Number} c1 + * @param {Number} c2 * @returns {String} */ static linkRightSVGPath = (start, c1, c2) => { diff --git a/js/Utility.js b/js/Utility.js index 6f5afd1..fbbe774 100755 --- a/js/Utility.js +++ b/js/Utility.js @@ -16,10 +16,9 @@ export default class Utility { } /** - * - * @param {Number[]} viewportLocation - * @param {HTMLElement} movementElement - * @returns + * @param {Number[]} viewportLocation + * @param {HTMLElement} movementElement + * @returns */ static convertLocation(viewportLocation, movementElement) { const scaleCorrection = 1 / Utility.getScale(movementElement) @@ -33,14 +32,14 @@ export default class Utility { /** * Sets a value in an object + * @param {Object} target Object holding the data * @param {String[]} keys The chained keys to access from object in order to set the value - * @param {any} value Value to be set - * @param {Object} target Object holding the data + * @param {*} value Value to be set * @param {Boolean} create Whether to create or not the key in case it doesn't exist * @returns {Boolean} Returns true on succes, false otherwise */ static objectSet(target, keys, value, create = false) { - if (keys.constructor != Array) { + if (!(keys instanceof Array)) { console.error("Expected keys to be an array.") } if (keys.length == 1) { @@ -49,7 +48,7 @@ export default class Utility { return true } } else if (keys.length > 0) { - if (create && target[keys[0]] === undefined) { + if (create && !(target[keys[0]] instanceof Object)) { target[keys[0]] = {} } return Utility.objectSet(target[keys[0]], keys.slice(1), value, create) @@ -59,13 +58,13 @@ export default class Utility { /** * Gets a value from an object, gives defaultValue in case of failure - * @param {Object} source Object holding the data + * @param {Object} source Object holding the data * @param {String[]} keys The chained keys to access from object in order to get the value * @param {any} defaultValue Value to return in case from doesn't have it * @returns {any} The value in from corresponding to the keys or defaultValue otherwise */ static objectGet(source, keys, defaultValue = null) { - if (keys.constructor != Array) { + if (!(keys instanceof Array)) { console.error("Expected keys to be an array.") } if (keys.length == 0 || !(keys[0] in source) || source[keys[0]] === undefined) { @@ -84,8 +83,8 @@ export default class Utility { } /** - * - * @param {String} value + * + * @param {String} value */ static FirstCapital(value) { return value.charAt(0).toUpperCase() + value.substring(1) @@ -104,9 +103,8 @@ export default class Utility { } /** - * - * @param {Number[]} location - * @param {Number} gridSize + * @param {Number[]} location + * @param {Number} gridSize */ static snapToGrid(location, gridSize = Configuration.gridSize) { if (gridSize === 1) { diff --git a/js/element/IElement.js b/js/element/IElement.js index 96e5243..80facd7 100644 --- a/js/element/IElement.js +++ b/js/element/IElement.js @@ -10,7 +10,6 @@ export default class IElement extends HTMLElement { static tagName = "" /** - * * @param {IEntity} entity The entity containing blueprint related data for this graph element * @param {ITemplate} template The template to render this node */ diff --git a/js/element/LinkElement.js b/js/element/LinkElement.js index b3f18f3..56eabf6 100644 --- a/js/element/LinkElement.js +++ b/js/element/LinkElement.js @@ -45,16 +45,14 @@ export default class LinkElement extends IElement { } /** - * - * @returns {Number[]} + * @returns {Number[]} */ getSourceLocation() { return this.sourceLocation } /** - * - * @param {Number[]} offset + * @param {Number[]} offset */ addSourceLocation(offset) { const location = [ @@ -66,8 +64,7 @@ export default class LinkElement extends IElement { } /** - * - * @param {Number[]} location + * @param {Number[]} location */ setSourceLocation(location) { if (location == null) { @@ -78,7 +75,6 @@ export default class LinkElement extends IElement { } /** - * * @returns {Number[]} */ getDestinationLocation() { @@ -86,8 +82,7 @@ export default class LinkElement extends IElement { } /** - * - * @param {Number[]} offset + * @param {Number[]} offset */ addDestinationLocation(offset) { const location = [ @@ -98,8 +93,7 @@ export default class LinkElement extends IElement { } /** - * - * @param {Number[]} location + * @param {Number[]} location */ setDestinationLocation(location) { if (location == null) { @@ -110,7 +104,6 @@ export default class LinkElement extends IElement { } /** - * * @returns {PinElement} */ getSourcePin() { @@ -118,7 +111,7 @@ export default class LinkElement extends IElement { } /** - * @param {PinElement} pin + * @param {PinElement} pin */ setSourcePin(pin) { if (this.#source) { @@ -137,7 +130,6 @@ export default class LinkElement extends IElement { } /** - * * @returns {PinElement} */ getDestinationPin() { @@ -145,8 +137,7 @@ export default class LinkElement extends IElement { } /** - * - * @param {PinElement} pin + * @param {PinElement} pin */ setDestinationPin(pin) { if (this.#destination) { @@ -164,8 +155,7 @@ export default class LinkElement extends IElement { } /** - * - * @param {LinkMessageElement} linkMessage + * @param {LinkMessageElement} linkMessage */ setLinkMessage(linkMessage) { if (linkMessage) { diff --git a/js/element/NodeElement.js b/js/element/NodeElement.js index 92c4960..abdd822 100644 --- a/js/element/NodeElement.js +++ b/js/element/NodeElement.js @@ -10,8 +10,7 @@ export default class NodeElement extends ISelectableDraggableElement { static tagName = "ueb-node" /** - * - * @param {ObjectEntity} entity + * @param {ObjectEntity} entity */ constructor(entity) { super(entity, new NodeTemplate()) @@ -32,7 +31,6 @@ export default class NodeElement extends ISelectableDraggableElement { } /** - * * @returns {PinEntity[]} */ getPinEntities() { diff --git a/js/element/PinElement.js b/js/element/PinElement.js index 78cbcf4..74faaf3 100644 --- a/js/element/PinElement.js +++ b/js/element/PinElement.js @@ -35,7 +35,6 @@ export default class PinElement extends IElement { } /** - * * @returns {String} */ getPinDisplayName() { diff --git a/js/entity/GuidEntity.js b/js/entity/GuidEntity.js index 2a1fb01..eaa16d7 100755 --- a/js/entity/GuidEntity.js +++ b/js/entity/GuidEntity.js @@ -1,5 +1,6 @@ import IEntity from "./IEntity" + export default class GuidEntity extends IEntity { static attributes = { @@ -15,11 +16,9 @@ export default class GuidEntity extends IEntity { values.forEach(n => { guid += ("0".repeat(8) + n.toString(16).toUpperCase()).slice(-8) }) - return new GuidEntity({ valud: guid }) + return new GuidEntity({ value: guid }) } - /** @type {String} */ value - toString() { return this.value } diff --git a/js/entity/IEntity.js b/js/entity/IEntity.js index 3a0c280..aa4c576 100644 --- a/js/entity/IEntity.js +++ b/js/entity/IEntity.js @@ -5,10 +5,9 @@ export default class IEntity { constructor(options = {}) { /** - * - * @param {String[]} prefix - * @param {Object} target - * @param {Object} properties + * @param {String[]} prefix + * @param {Object} target + * @param {Object} properties */ const defineAllAttributes = (prefix, target, properties) => { let fullKey = prefix.concat("") @@ -23,7 +22,7 @@ export default class IEntity { } /* * The value can either be: - * - Array: can contain multiple values, its property is assigned multiple times like (X=1, X=4, X="Hello World") + * - Array: can contain multiple values, its property is assigned multiple times like (X=1, X=4, X="Hello World") * - TypeInitialization: contains the maximum amount of information about the attribute. * - A type: the default value will be default constructed object without arguments. * - A proper value. diff --git a/js/entity/IntegerEntity.js b/js/entity/IntegerEntity.js index 07e38b9..e593f20 100755 --- a/js/entity/IntegerEntity.js +++ b/js/entity/IntegerEntity.js @@ -16,8 +16,6 @@ export default class IntegerEntity extends IEntity { this.value = Math.round(this.value) } - /** @type {Number} */ value - valueOf() { return this.value } diff --git a/js/entity/KeyBindingEntity.js b/js/entity/KeyBindingEntity.js index 405a80f..609decd 100644 --- a/js/entity/KeyBindingEntity.js +++ b/js/entity/KeyBindingEntity.js @@ -9,10 +9,4 @@ export default class KeyBindingEntity extends IEntity { Key: String, CommandName: String, } - - /** @type {Boolean} */ bCtrlDown - /** @type {Boolean} */ bAltDown - /** @type {Boolean} */ bShiftDown - /** @type {String} */ Key - /** @type {String} */ CommandName } diff --git a/js/entity/LocalizedTextEntity.js b/js/entity/LocalizedTextEntity.js index 222f6a1..a35fe46 100755 --- a/js/entity/LocalizedTextEntity.js +++ b/js/entity/LocalizedTextEntity.js @@ -8,8 +8,4 @@ export default class LocalizedTextEntity extends IEntity { key: String, value: String } - - /** @type {String} */ namespace - /** @type {String} */ key - /** @type {String} */ value } diff --git a/js/entity/ObjectEntity.js b/js/entity/ObjectEntity.js index 67118a2..19c7aa7 100755 --- a/js/entity/ObjectEntity.js +++ b/js/entity/ObjectEntity.js @@ -25,20 +25,6 @@ export default class ObjectEntity extends IEntity { CustomProperties: [PinEntity] } - /** @type {ObjectReferenceEntity} */ Class - /** @type {String} */ Name - /** @type {Boolean} */ bIsPureFunc - /** @type {VariableReferenceEntity} */ VariableReference - /** @type {FunctionReferenceEntity} */ FunctionReference - /** @type {FunctionReferenceEntity} */ EventReference - /** @type {ObjectReferenceEntity} */ TargetType - /** @type {IntegerEntity} */ NodePosX - /** @type {IntegerEntity} */ NodePosY - /** @type {GuidEntity} */ NodeGuid - /** @type {IntegerEntity} */ ErrorType - /** @type {String} */ ErrorMsg - /** @type {PinEntity[]} */ CustomProperties - /** * @returns {String} The name of the node */ diff --git a/js/entity/ObjectReferenceEntity.js b/js/entity/ObjectReferenceEntity.js index 6849ff7..84d3571 100755 --- a/js/entity/ObjectReferenceEntity.js +++ b/js/entity/ObjectReferenceEntity.js @@ -6,7 +6,4 @@ export default class ObjectReferenceEntity extends IEntity { type: String, path: String } - - /** @type {String} */ type - /** @type {String} */ path } diff --git a/js/entity/PathSymbolEntity.js b/js/entity/PathSymbolEntity.js index ddcc2bd..b995eb1 100755 --- a/js/entity/PathSymbolEntity.js +++ b/js/entity/PathSymbolEntity.js @@ -2,8 +2,6 @@ import IEntity from "./IEntity" export default class PathSymbolEntity extends IEntity { - //value - static attributes = { value: String } diff --git a/js/entity/PinEntity.js b/js/entity/PinEntity.js index 099f279..f05f352 100755 --- a/js/entity/PinEntity.js +++ b/js/entity/PinEntity.js @@ -52,23 +52,6 @@ export default class PinEntity extends IEntity { bOrphanedPin: false, } - /** @type {GuidEntity} */ PinId - /** @type {String} */ PinName - /** @type {LocalizedTextEntity} */ PinFriendlyName - /** @type {String} */ PinToolTip - /** @type {String} */ Direction - /** @type {PinTypeObjectType} */ PinType - /** @type {PinReferenceEntity[]} */ LinkedTo - /** @type {String} */ DefaultValue - /** @type {String} */ AutogeneratedDefaultValue - /** @type {GuidEntity} */ PersistentGuid - /** @type {Boolean} */ bHidden - /** @type {Boolean} */ bNotConnectable - /** @type {Boolean} */ bDefaultValueIsReadOnly - /** @type {Boolean} */ bDefaultValueIsIgnored - /** @type {Boolean} */ bAdvancedView - /** @type {Boolean} */ bOrphanedPin - isInput() { return !this.bHidden && this.Direction !== "EGPD_Output" } @@ -82,8 +65,7 @@ export default class PinEntity extends IEntity { } /** - * - * @param {PinReferenceEntity} pinReferenceEntity + * @param {PinReferenceEntity} pinReferenceEntity */ connectTo(pinReferenceEntity) { /** @type {PinReferenceEntity[]} */ diff --git a/js/entity/PinReferenceEntity.js b/js/entity/PinReferenceEntity.js index 12956fb..9e3d175 100755 --- a/js/entity/PinReferenceEntity.js +++ b/js/entity/PinReferenceEntity.js @@ -8,7 +8,4 @@ export default class PinReferenceEntity extends IEntity { objectName: PathSymbolEntity, pinGuid: GuidEntity } - - /** @type {PathSymbolEntity} */ objectName - /** @type {GuidEntity} */ pinGuid } diff --git a/js/entity/TypeInitialization.js b/js/entity/TypeInitialization.js index 9da2bbd..28fdd43 100755 --- a/js/entity/TypeInitialization.js +++ b/js/entity/TypeInitialization.js @@ -11,8 +11,8 @@ export default class TypeInitialization { } /** - * @param {typeof Object} type - * @param {boolean} showDefault + * @param {typeof Object} type + * @param {boolean} showDefault * @param {*} value */ constructor(type, showDefault = true, value = undefined) { diff --git a/js/entity/VariableReferenceEntity.js b/js/entity/VariableReferenceEntity.js index b135c50..c7f0bc9 100755 --- a/js/entity/VariableReferenceEntity.js +++ b/js/entity/VariableReferenceEntity.js @@ -8,8 +8,4 @@ export default class VariableReferenceEntity extends IEntity { MemberGuid: GuidEntity, bSelfContext: false } - - /** @type {String} */ MemberName - /** @type {GuidEntity} */ MemberGuid - /** @type {Boolean} */ bSelfContext } diff --git a/js/input/keybaord/IKeyboardShortcut.js b/js/input/keybaord/IKeyboardShortcut.js index 44cffc6..cce46c2 100644 --- a/js/input/keybaord/IKeyboardShortcut.js +++ b/js/input/keybaord/IKeyboardShortcut.js @@ -62,7 +62,6 @@ export default class IKeyboardShortcut extends IContext { } /** - * * @param {String} keyString * @returns {Object} */ diff --git a/js/input/keybaord/KeyboardCanc.js b/js/input/keybaord/KeyboardCanc.js index e456afb..6b4de39 100755 --- a/js/input/keybaord/KeyboardCanc.js +++ b/js/input/keybaord/KeyboardCanc.js @@ -4,10 +4,9 @@ import IKeyboardShortcut from "./IKeyboardShortcut" export default class KeyvoardCanc extends IKeyboardShortcut { /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {OBject} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {OBject} options */ constructor(target, blueprint, options = {}) { options = IKeyboardShortcut.keyOptionsParse(options, Configuration.deleteNodesKeyboardKey) diff --git a/js/input/keybaord/KeyboardSelectAll.js b/js/input/keybaord/KeyboardSelectAll.js index 9d8a9a8..4ded72c 100755 --- a/js/input/keybaord/KeyboardSelectAll.js +++ b/js/input/keybaord/KeyboardSelectAll.js @@ -4,10 +4,9 @@ import IKeyboardShortcut from "./IKeyboardShortcut" export default class KeyboardSelectAll extends IKeyboardShortcut { /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {Object} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {Object} options */ constructor(target, blueprint, options = {}) { options = IKeyboardShortcut.keyOptionsParse(options, Configuration.selectAllKeyboardKey) diff --git a/js/input/mouse/IMouseWheel.js b/js/input/mouse/IMouseWheel.js index f2b3cc1..d520ea9 100644 --- a/js/input/mouse/IMouseWheel.js +++ b/js/input/mouse/IMouseWheel.js @@ -9,10 +9,9 @@ export default class IMouseWheel extends IPointing { #mouseParentWheelHandler /** - * - * @param {HTMLElement} target - * @param {import("../../Blueprint").default} blueprint - * @param {Object} options + * @param {HTMLElement} target + * @param {import("../../Blueprint").default} blueprint + * @param {Object} options */ constructor(target, blueprint, options) { options.wantsFocusCallback = true diff --git a/js/input/mouse/IPointing.js b/js/input/mouse/IPointing.js index 5ec1151..07041bd 100644 --- a/js/input/mouse/IPointing.js +++ b/js/input/mouse/IPointing.js @@ -9,9 +9,7 @@ export default class IPointing extends IContext { } /** - * - * @param {MouseEvent} mouseEvent - * @returns + * @param {MouseEvent} mouseEvent */ locationFromEvent(mouseEvent) { return this.blueprint.compensateTranslation( diff --git a/js/input/mouse/MouseCreateLink.js b/js/input/mouse/MouseCreateLink.js index 1d27a8f..d10c357 100755 --- a/js/input/mouse/MouseCreateLink.js +++ b/js/input/mouse/MouseCreateLink.js @@ -2,7 +2,7 @@ import IMouseClickDrag from "./IMouseClickDrag" import LinkElement from "../../element/LinkElement" import LinkMessageElement from "../../element/LinkMessageElement" -/** +/** * @typedef {import("../../element/LinkElement").default} LinkElement * @typedef {import("../../element/PinElement").default} PinElement */ diff --git a/js/input/mouse/MouseMoveNodes.js b/js/input/mouse/MouseMoveNodes.js index 3814738..d68170a 100755 --- a/js/input/mouse/MouseMoveNodes.js +++ b/js/input/mouse/MouseMoveNodes.js @@ -7,10 +7,9 @@ import Utility from "../../Utility" export default class MouseMoveNodes extends IMouseClickDrag { /** - * - * @param {ISelectableDraggableElement} target - * @param {*} blueprint - * @param {*} options + * @param {ISelectableDraggableElement} target + * @param {*} blueprint + * @param {*} options */ constructor(target, blueprint, options) { super(target, blueprint, options) diff --git a/js/input/mouse/Unfocus.js b/js/input/mouse/Unfocus.js index e4a19a0..5655413 100755 --- a/js/input/mouse/Unfocus.js +++ b/js/input/mouse/Unfocus.js @@ -17,8 +17,7 @@ export default class Unfocus extends IContext { } /** - * - * @param {HTMLElement} e + * @param {HTMLElement} e */ clickedSomewhere(target) { // If target is outside the blueprint grid diff --git a/js/selection/FastSelectionModel.js b/js/selection/FastSelectionModel.js index 66233a7..ecf0a00 100755 --- a/js/selection/FastSelectionModel.js +++ b/js/selection/FastSelectionModel.js @@ -78,7 +78,7 @@ export default class FastSelectionModel { computeBoundaries() { this.boundaries = { - // Primary axis negative expanding + // Primary axis negative expanding primaryN: { v: this.primaryOrder.getPrevValue(), i: this.primaryOrder.getPrev() diff --git a/js/selection/OrderedIndexArray.js b/js/selection/OrderedIndexArray.js index 59fad37..ad13695 100755 --- a/js/selection/OrderedIndexArray.js +++ b/js/selection/OrderedIndexArray.js @@ -12,7 +12,6 @@ export default class OrderedIndexArray { } /** - * * @param {number} index The index of the value to return * @returns The element of the array */ @@ -58,7 +57,7 @@ export default class OrderedIndexArray { } } - /** + /** * Inserts the element in the array. * @param element {number} The value to insert into the array. * @returns {number} The position into occupied by value into the array. diff --git a/js/serialization/ISerializer.js b/js/serialization/ISerializer.js index ff636a7..38519a2 100644 --- a/js/serialization/ISerializer.js +++ b/js/serialization/ISerializer.js @@ -42,6 +42,11 @@ export default class ISerializer { } } + /** + * @param {String[]} key + * @param {Object} object + * @returns {String} + */ subWrite(key, object) { let result = "" let fullKey = key.concat("") diff --git a/js/serialization/ObjectSerializer.js b/js/serialization/ObjectSerializer.js index 55f3bd9..12cb2ff 100755 --- a/js/serialization/ObjectSerializer.js +++ b/js/serialization/ObjectSerializer.js @@ -30,8 +30,7 @@ export default class ObjectSerializer extends ISerializer { } /** - * - * @param {String} value + * @param {String} value * @returns {ObjectEntity[]} */ readMultiple(value) { @@ -44,9 +43,7 @@ export default class ObjectSerializer extends ISerializer { } /** - * - * @param {ObjectEntity} object - * @returns + * @param {ObjectEntity} object */ write(object) { let result = `Begin Object Class=${this.writeValue(object.Class)} Name=${this.writeValue(object.Name)} diff --git a/js/template/BlueprintTemplate.js b/js/template/BlueprintTemplate.js index 11103e9..1536ec9 100755 --- a/js/template/BlueprintTemplate.js +++ b/js/template/BlueprintTemplate.js @@ -21,9 +21,8 @@ export default class BlueprintTemplate extends ITemplate { } /** - * - * @param {Blueprint} element - * @returns + * @param {Blueprint} element + * @returns */ viewport(element) { return html` @@ -43,8 +42,8 @@ export default class BlueprintTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {HTMLElement} element Target element - * @returns The computed html + * @param {HTMLElement} element Target element + * @returns The computed html */ render(element) { return html` diff --git a/js/template/ITemplate.js b/js/template/ITemplate.js index 4e3d2cb..4ced7c3 100644 --- a/js/template/ITemplate.js +++ b/js/template/ITemplate.js @@ -6,7 +6,7 @@ export default class ITemplate { /** * Computes the html content of the target element. * @param {IElement} entity Element of the graph - * @returns The result html + * @returns The result html */ render(entity) { return "" diff --git a/js/template/LinkMessageTemplate.js b/js/template/LinkMessageTemplate.js index 9768ff3..ef71359 100644 --- a/js/template/LinkMessageTemplate.js +++ b/js/template/LinkMessageTemplate.js @@ -10,8 +10,7 @@ export default class LinkMessageTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {LinkMessageElement} linkMessage attached to link destination - * @returns The result html + * @param {LinkMessageElement} linkMessage */ render(linkMessage) { return html` @@ -22,7 +21,7 @@ export default class LinkMessageTemplate extends ITemplate { /** * Applies the style to the element. - * @param {LinkMessageElement} linkMessage element + * @param {LinkMessageElement} linkMessage */ apply(linkMessage) { super.apply(linkMessage) diff --git a/js/template/LinkTemplate.js b/js/template/LinkTemplate.js index 50567a6..12d2628 100755 --- a/js/template/LinkTemplate.js +++ b/js/template/LinkTemplate.js @@ -59,8 +59,8 @@ export default class LinkTemplate extends ITemplate { /** * Computes the html content of the target element. - * @param {LinkElement} link connecting two graph nodes - * @returns The result html + * @param {LinkElement} link connecting two graph nodes + * @returns The result html */ render(link) { const uniqueId = crypto.randomUUID() @@ -88,7 +88,6 @@ export default class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element */ applyStartDragging(link) { @@ -101,7 +100,6 @@ export default class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element */ applyFinishDragging(link) { @@ -163,9 +161,8 @@ export default class LinkTemplate extends ITemplate { } /** - * * @param {LinkElement} link element - * @param {LinkMessageElement} linkMessage + * @param {LinkMessageElement} linkMessage */ applyLinkMessage(link, linkMessage) { link.querySelectorAll(linkMessage.constructor.tagName).forEach(element => element.remove()) diff --git a/js/template/NodeTemplate.js b/js/template/NodeTemplate.js index d61c547..6db79b2 100755 --- a/js/template/NodeTemplate.js +++ b/js/template/NodeTemplate.js @@ -10,8 +10,8 @@ export default class NodeTemplate extends SelectableDraggableTemplate { /** * Computes the html content of the target element. - * @param {NodeElement} node Graph node element - * @returns The result html + * @param {NodeElement} node Graph node element + * @returns The result html */ render(node) { return html` diff --git a/js/template/PinTemplate.js b/js/template/PinTemplate.js index 4cd1203..8c10517 100755 --- a/js/template/PinTemplate.js +++ b/js/template/PinTemplate.js @@ -10,8 +10,8 @@ export default class PinTemplate extends ITemplate { /** * Computes the html content of the pin. - * @param {PinElement} pin html element - * @returns The result html + * @param {PinElement} pin html element + * @returns The result html */ render(pin) { if (pin.isInput()) { @@ -43,7 +43,7 @@ export default class PinTemplate extends ITemplate { /** * Applies the connection style to the element. - * @param {PinElement} pin + * @param {PinElement} pin */ applyConnected(pin) { if (pin.isConnected()) { @@ -54,9 +54,7 @@ export default class PinTemplate extends ITemplate { } /** - * - * @param {PinElement} pin - * @returns + * @param {PinElement} pin */ getLinkLocation(pin) { const rect = pin.querySelector(".ueb-pin-icon").getBoundingClientRect()