mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:28:17 +08:00
Classes naming refactoring
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import GraphNode from "../../graph/GraphNode"
|
||||
import NodeElement from "../../element/NodeElement"
|
||||
import ObjectSerializer from "../../serialization/ObjectSerializer"
|
||||
import Context from "../Context"
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class Paste extends Context {
|
||||
let left = 0
|
||||
let count = 0
|
||||
let nodes = this.serializer.readMultiple(value).map(entity => {
|
||||
let node = new GraphNode(entity)
|
||||
let node = new NodeElement(entity)
|
||||
top += node.location[1]
|
||||
left += node.location[0]
|
||||
++count
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import GraphLink from "../../graph/GraphLink"
|
||||
import GraphLinkMessage from "../../graph/GraphLinkMessage"
|
||||
import LinkElement from "../../element/LinkElement"
|
||||
import LinkMessageElement from "../../element/LinkMessageElement"
|
||||
import MouseClickDrag from "./MouseClickDrag"
|
||||
|
||||
/** @typedef {import("../../graph/GraphPin").default} GraphPin */
|
||||
/** @typedef {import("../../element/PinElement").default} PinElement */
|
||||
export default class MouseCreateLink extends MouseClickDrag {
|
||||
|
||||
/** @type {NodeListOf<GraphPin>} */
|
||||
/** @type {NodeListOf<PinElement>} */
|
||||
#listenedPins
|
||||
|
||||
/** @type {(e: MouseEvent) => void} */
|
||||
@@ -16,9 +16,9 @@ export default class MouseCreateLink extends MouseClickDrag {
|
||||
|
||||
constructor(target, blueprint, options) {
|
||||
super(target, blueprint, options)
|
||||
/** @type {import("../../graph/GraphPin").default} */
|
||||
/** @type {import("../../element/PinElement").PinElement} */
|
||||
this.target
|
||||
/** @type {import("../../graph/GraphLink").default} */
|
||||
/** @type {import("../../element/LinkElement").LinkElement} */
|
||||
this.link
|
||||
/** @type {import("../../entity/PinEntity").default} */
|
||||
this.enteredPin
|
||||
@@ -37,8 +37,8 @@ export default class MouseCreateLink extends MouseClickDrag {
|
||||
}
|
||||
|
||||
startDrag() {
|
||||
this.link = new GraphLink(this.target, null)
|
||||
this.link.setLinkMessage(GraphLinkMessage.PLACE_NODE())
|
||||
this.link = new LinkElement(this.target, null)
|
||||
this.link.setLinkMessage(LinkMessageElement.placeNode())
|
||||
this.blueprint.nodesContainerElement.insertBefore(this.link, this.blueprint.selectorElement.nextElementSibling)
|
||||
this.#listenedPins = this.blueprint.querySelectorAll(this.target.constructor.tagName)
|
||||
this.#listenedPins.forEach(pin => {
|
||||
|
||||
@@ -2,13 +2,13 @@ import MouseClickDrag from "./MouseClickDrag"
|
||||
import Utility from "../../Utility"
|
||||
|
||||
/**
|
||||
* @typedef {import("../../graph/SelectableDraggable").default} SelectableDraggable
|
||||
* @typedef {import("../../element/ISelectableDraggableElement").ISelectableDraggableElement} ISelectableDraggableElement
|
||||
*/
|
||||
export default class MouseMoveNodes extends MouseClickDrag {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {SelectableDraggable} target
|
||||
* @param {ISelectableDraggableElement} target
|
||||
* @param {*} blueprint
|
||||
* @param {*} options
|
||||
*/
|
||||
@@ -16,7 +16,7 @@ export default class MouseMoveNodes extends MouseClickDrag {
|
||||
super(target, blueprint, options)
|
||||
this.stepSize = parseInt(options?.stepSize ?? this.blueprint.gridSize)
|
||||
this.mouseLocation = [0, 0]
|
||||
/** @type {SelectableDraggable} */
|
||||
/** @type {ISelectableDraggableElement} */
|
||||
this.target
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user