This commit is contained in:
barsdeveloper
2021-10-10 14:14:05 +02:00
parent 8ef5f3dab4
commit 82355b9126
8 changed files with 121 additions and 121 deletions

View File

@@ -8,7 +8,7 @@ export default class GraphEntity extends HTMLElement {
*/
constructor(template) {
super()
/** @type {import("./UEBlueprint").EBlueprint}" */
/** @type {import("./UEBlueprint").default}" */
this.blueprint = null
this.template = template
}

View File

@@ -1,7 +1,7 @@
import SelectableDraggable from "./SelectableDraggable"
import NodeTemplate from "./template/NodeTemplate"
export default class UEBlueprintObject extends SelectableDraggable {
export default class GraphNode extends SelectableDraggable {
constructor() {
super(new NodeTemplate())
@@ -21,4 +21,4 @@ export default class UEBlueprintObject extends SelectableDraggable {
}
}
customElements.define('u-object', UEBlueprintObject)
customElements.define('u-object', GraphNode)

View File

@@ -8,7 +8,7 @@ import GraphEntity from "./GraphEntity"
import BlueprintTemplate from "./template/BlueprintTemplate"
/**
* @typedef {import("./UEBlueprintObject").default} UEBlueprintObject
* @typedef {import("./GraphNode").default} GrapNode
*/
export default class UEBlueprint extends GraphEntity {
@@ -18,7 +18,7 @@ export default class UEBlueprint extends GraphEntity {
constructor() {
super(new BlueprintTemplate())
/** @type {UEBlueprintObject[]}" */
/** @type {GrapNode[]}" */
this.nodes = new Array()
this.expandGridSize = 400
/** @type {HTMLElement} */
@@ -44,7 +44,7 @@ export default class UEBlueprint extends GraphEntity {
/** @type {FastSelectionModel} */
this.selectionModel = null
let self = this
/** @type {(node: UEBlueprintObject) => BoundariesInfo} */
/** @type {(node: GrapNode) => BoundariesInfo} */
this.nodeBoundariesSupplier = (node) => {
let rect = node.getBoundingClientRect()
let gridRect = this.nodesContainerElement.getBoundingClientRect()
@@ -57,7 +57,7 @@ export default class UEBlueprint extends GraphEntity {
secondarySup: (rect.bottom - gridRect.bottom) * scaleCorrection
}
}
/** @type {(node: UEBlueprintObject, selected: bool) => void}} */
/** @type {(node: GrapNode, selected: bool) => void}} */
this.nodeSelectToggleFunction = (node, selected) => {
node.setSelected(selected)
}
@@ -331,7 +331,7 @@ export default class UEBlueprint extends GraphEntity {
/**
*
* @param {...UEBlueprintObject} blueprintNodes
* @param {...GrapNode} blueprintNodes
*/
addNode(...blueprintNodes) {
[...blueprintNodes].reduce(

View File

@@ -1,5 +1,5 @@
import UEBlueprint from "./UEBlueprint"
import UEBlueprintObject from "./UEBlueprintObject"
import GraphPin from "./GraphPin"
import GraphNode from "./GraphNode"
export { UEBlueprint as UEBlueprint, UEBlueprintObject, GraphPin as UGraphPin }
export { UEBlueprint as UEBlueprint, GraphNode as GraphNode, GraphPin as UGraphPin }

View File

@@ -5,7 +5,7 @@ export default class MouseWheel extends Pointing {
/**
*
* @param {HTMLElement} target
* @param {import("../UEBlueprint").EBlueprint} blueprint
* @param {import("../UEBlueprint").default} blueprint
* @param {Object} options
*/
constructor(target, blueprint, options) {

View File

@@ -5,7 +5,7 @@ export default class Pointing {
constructor(target, blueprint, options) {
/** @type {HTMLElement} */
this.target = target
/** @type {import("../UEBlueprint").EBlueprint}" */
/** @type {import("../UEBlueprint").default}" */
this.blueprint = blueprint
this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement
}