Classes naming refactoring

This commit is contained in:
barsdeveloper
2022-02-27 12:44:48 +01:00
parent 96f0d593e7
commit e8946745d6
35 changed files with 790 additions and 786 deletions

View File

@@ -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

View File

@@ -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 => {

View File

@@ -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
}