From 84606486c41469a4e80fca53d0e68e2b80b4083c Mon Sep 17 00:00:00 2001 From: barsdeveloper Date: Sat, 9 Oct 2021 22:11:11 +0200 Subject: [PATCH] Naming --- js/{UGraphEntity.js => GraphEntity.js} | 4 ++-- js/{UGraphPin.js => GraphPin.js} | 10 +++++----- js/{FGuid.js => Guid.js} | 4 ++-- js/{ULink.js => Link.js} | 4 ++-- ...SelectableDraggable.js => SelectableDraggable.js} | 8 ++++---- js/UEBlueprint.js | 12 ++++++------ js/UEBlueprintObject.js | 4 ++-- js/exporting.js | 4 ++-- js/input/{UDrag.js => Drag.js} | 4 ++-- js/input/{UDragScroll.js => DragScroll.js} | 4 ++-- js/input/{UMouseClickDrag.js => MouseClickDrag.js} | 4 ++-- js/input/{UMouseWheel.js => MouseWheel.js} | 6 +++--- js/input/{UPointing.js => Pointing.js} | 4 ++-- js/input/{USelect.js => Select.js} | 4 ++-- js/input/{UZoom.js => Zoom.js} | 4 ++-- 15 files changed, 40 insertions(+), 40 deletions(-) rename js/{UGraphEntity.js => GraphEntity.js} (82%) rename js/{UGraphPin.js => GraphPin.js} (89%) rename js/{FGuid.js => Guid.js} (88%) rename js/{ULink.js => Link.js} (85%) rename js/{USelectableDraggable.js => SelectableDraggable.js} (88%) rename js/input/{UDrag.js => Drag.js} (92%) rename js/input/{UDragScroll.js => DragScroll.js} (50%) rename js/input/{UMouseClickDrag.js => MouseClickDrag.js} (97%) rename js/input/{UMouseWheel.js => MouseWheel.js} (84%) rename js/input/{UPointing.js => Pointing.js} (87%) rename js/input/{USelect.js => Select.js} (83%) rename js/input/{UZoom.js => Zoom.js} (65%) diff --git a/js/UGraphEntity.js b/js/GraphEntity.js similarity index 82% rename from js/UGraphEntity.js rename to js/GraphEntity.js index 5c46d18..77c1907 100644 --- a/js/UGraphEntity.js +++ b/js/GraphEntity.js @@ -1,10 +1,10 @@ /** * A Graph Entity is an element that can stay directly (as a first child) on the blueprint grid. Those entities are either nodes or links */ -export default class UGraphEntity extends HTMLElement { +export default class GraphEntity extends HTMLElement { constructor() { super() - /** @type {import("./UEBlueprint").default}" */ + /** @type {import("./UEBlueprint").EBlueprint}" */ this.blueprint = null } diff --git a/js/UGraphPin.js b/js/GraphPin.js similarity index 89% rename from js/UGraphPin.js rename to js/GraphPin.js index a4f4336..8d20ddb 100644 --- a/js/UGraphPin.js +++ b/js/GraphPin.js @@ -1,8 +1,8 @@ -import FGuid from "./FGuid"; +import Guid from "./Guid"; -export default class UGraphPin { +export default class GraphPin { constructor(Options) { - this.PinId = new FGuid(Options?.PinId) + this.PinId = new Guid(Options?.PinId) this.PinName = Options?.PinName ?? "" this.PinToolTip = Options?.PinToolTip ?? "" this.PinType = { @@ -50,9 +50,9 @@ export default class UGraphPin { prefix += prefix != "" ? "." : "" for (const property in object) { if (object[property]?.constructor?.name === 'Object') { - result += UGraphPin.subSerialize(prefix + property, object[property]) + result += GraphPin.subSerialize(prefix + property, object[property]) } else { - result += `${prefix + property}=${UGraphPin.serializeValue(object[property])},` + result += `${prefix + property}=${GraphPin.serializeValue(object[property])},` } } return result diff --git a/js/FGuid.js b/js/Guid.js similarity index 88% rename from js/FGuid.js rename to js/Guid.js index 65a038f..ee482f7 100644 --- a/js/FGuid.js +++ b/js/Guid.js @@ -1,4 +1,4 @@ -export default class FGuid { +export default class Guid { static generateGuid() { let result = "" let random = new Uint32Array(4); @@ -15,7 +15,7 @@ export default class FGuid { } else if (guid?.constructor?.name === 'FGuid') { this.value = guid.value } else { - this.value = FGuid.generateGuid() + this.value = Guid.generateGuid() } } diff --git a/js/ULink.js b/js/Link.js similarity index 85% rename from js/ULink.js rename to js/Link.js index e0e4acb..072f4f4 100644 --- a/js/ULink.js +++ b/js/Link.js @@ -1,6 +1,6 @@ import UBlueprintEntity from "./UBlueprintEntity" -export default class ULink extends UBlueprintEntity { +export default class Link extends UBlueprintEntity { /** * @@ -26,4 +26,4 @@ export default class ULink extends UBlueprintEntity { } } -customElements.define('u-link', ULink) +customElements.define('u-link', Link) diff --git a/js/USelectableDraggable.js b/js/SelectableDraggable.js similarity index 88% rename from js/USelectableDraggable.js rename to js/SelectableDraggable.js index d1630c6..b4872c2 100644 --- a/js/USelectableDraggable.js +++ b/js/SelectableDraggable.js @@ -1,7 +1,7 @@ -import UDrag from "./input/UDrag" -import UGraphEntity from "./UGraphEntity" +import Drag from "./input/Drag" +import GraphEntity from "./GraphEntity" -export default class USelectableDraggable extends UGraphEntity { +export default class SelectableDraggable extends GraphEntity { constructor() { super() @@ -17,7 +17,7 @@ export default class USelectableDraggable extends UGraphEntity { connectedCallback() { super.connectedCallback() - this.dragObject = new UDrag(this, null, { // UDrag doesn't need blueprint + this.dragObject = new Drag(this, null, { // UDrag doesn't need blueprint looseTarget: true }) } diff --git a/js/UEBlueprint.js b/js/UEBlueprint.js index 9332d47..bb30ab3 100644 --- a/js/UEBlueprint.js +++ b/js/UEBlueprint.js @@ -1,7 +1,7 @@ import Utility from "./Utility" -import UDragScroll from "./input/UDragScroll" -import USelect from "./input/USelect" -import UZoom from "./input/UZoom" +import DragScroll from "./input/DragScroll" +import Select from "./input/Select" +import Zoom from "./input/Zoom" import FastSelectionModel from "./selection/FastSelectionModel" import SimpleSelectionModel from "./selection/SimpleSelectionModel" @@ -108,17 +108,17 @@ export default class UEBlueprint extends HTMLElement { this.nodesContainerElement = this.querySelector('[data-nodes]') this.insertChildren() - this.dragObject = new UDragScroll(this.getGridDOMElement(), this, { + this.dragObject = new DragScroll(this.getGridDOMElement(), this, { clickButton: 2, moveEverywhere: true, exitAnyButton: false }) - this.zoomObject = new UZoom(this.getGridDOMElement(), this, { + this.zoomObject = new Zoom(this.getGridDOMElement(), this, { looseTarget: true }) - this.selectObject = new USelect(this.getGridDOMElement(), this, { + this.selectObject = new Select(this.getGridDOMElement(), this, { clickButton: 0, moveEverywhere: true, exitAnyButton: true diff --git a/js/UEBlueprintObject.js b/js/UEBlueprintObject.js index 8eb455c..f1908d0 100644 --- a/js/UEBlueprintObject.js +++ b/js/UEBlueprintObject.js @@ -1,6 +1,6 @@ -import USelectableDraggable from "./USelectableDraggable" +import SelectableDraggable from "./SelectableDraggable" -export default class UEBlueprintObject extends USelectableDraggable { +export default class UEBlueprintObject extends SelectableDraggable { static classInputs = [/* { name: "Input Example", diff --git a/js/exporting.js b/js/exporting.js index a8d8c07..a0f5105 100644 --- a/js/exporting.js +++ b/js/exporting.js @@ -1,5 +1,5 @@ import UEBlueprint from "./UEBlueprint" import UEBlueprintObject from "./UEBlueprintObject" -import UGraphPin from "./UGraphPin" +import GraphPin from "./GraphPin" -export { UEBlueprint, UEBlueprintObject, UGraphPin } \ No newline at end of file +export { UEBlueprint as UEBlueprint, UEBlueprintObject, GraphPin as UGraphPin } \ No newline at end of file diff --git a/js/input/UDrag.js b/js/input/Drag.js similarity index 92% rename from js/input/UDrag.js rename to js/input/Drag.js index 4ddeab0..6f31ded 100644 --- a/js/input/UDrag.js +++ b/js/input/Drag.js @@ -1,6 +1,6 @@ -import UMouseClickDrag from "./UMouseClickDrag" +import MouseClickDrag from "./MouseClickDrag" -export default class UDrag extends UMouseClickDrag { +export default class Drag extends MouseClickDrag { constructor(target, blueprint, options) { super(target, blueprint, options) this.stepSize = parseInt(options?.stepSize) diff --git a/js/input/UDragScroll.js b/js/input/DragScroll.js similarity index 50% rename from js/input/UDragScroll.js rename to js/input/DragScroll.js index b2ad623..a3ef91f 100644 --- a/js/input/UDragScroll.js +++ b/js/input/DragScroll.js @@ -1,6 +1,6 @@ -import UMouseClickDrag from "./UMouseClickDrag" +import MouseClickDrag from "./MouseClickDrag" -export default class UDragScroll extends UMouseClickDrag { +export default class DragScroll extends MouseClickDrag { dragTo(location, movement) { this.blueprint.scrollDelta([-movement[0], -movement[1]]) diff --git a/js/input/UMouseClickDrag.js b/js/input/MouseClickDrag.js similarity index 97% rename from js/input/UMouseClickDrag.js rename to js/input/MouseClickDrag.js index 21296b8..8e369d1 100644 --- a/js/input/UMouseClickDrag.js +++ b/js/input/MouseClickDrag.js @@ -1,9 +1,9 @@ -import UPointing from "./UPointing" +import Pointing from "./Pointing" /** * This class manages the ui gesture of mouse click and drag. Tha actual operations are implemented by the subclasses. */ -export default class UMouseClickDrag extends UPointing { +export default class MouseClickDrag extends Pointing { constructor(target, blueprint, options) { super(target, blueprint, options) this.clickButton = options?.clickButton ?? 0 diff --git a/js/input/UMouseWheel.js b/js/input/MouseWheel.js similarity index 84% rename from js/input/UMouseWheel.js rename to js/input/MouseWheel.js index fb9c5b9..457f16e 100644 --- a/js/input/UMouseWheel.js +++ b/js/input/MouseWheel.js @@ -1,11 +1,11 @@ -import UPointing from "./UPointing" +import Pointing from "./Pointing" -export default class UMouseWheel extends UPointing { +export default class MouseWheel extends Pointing { /** * * @param {HTMLElement} target - * @param {import("../UEBlueprint").default} blueprint + * @param {import("../UEBlueprint").EBlueprint} blueprint * @param {Object} options */ constructor(target, blueprint, options) { diff --git a/js/input/UPointing.js b/js/input/Pointing.js similarity index 87% rename from js/input/UPointing.js rename to js/input/Pointing.js index f1a09e3..95af48a 100644 --- a/js/input/UPointing.js +++ b/js/input/Pointing.js @@ -1,11 +1,11 @@ import Utility from "../Utility" -export default class UPointing { +export default class Pointing { constructor(target, blueprint, options) { /** @type {HTMLElement} */ this.target = target - /** @type {import("../UEBlueprint").default}" */ + /** @type {import("../UEBlueprint").EBlueprint}" */ this.blueprint = blueprint this.movementSpace = this.blueprint?.getGridDOMElement() ?? document.documentElement } diff --git a/js/input/USelect.js b/js/input/Select.js similarity index 83% rename from js/input/USelect.js rename to js/input/Select.js index ef5bb4f..28c7891 100644 --- a/js/input/USelect.js +++ b/js/input/Select.js @@ -1,6 +1,6 @@ -import UMouseClickDrag from "./UMouseClickDrag" +import MouseClickDrag from "./MouseClickDrag" -export default class USelect extends UMouseClickDrag { +export default class Select extends MouseClickDrag { constructor(target, blueprint, options) { super(target, blueprint, options) diff --git a/js/input/UZoom.js b/js/input/Zoom.js similarity index 65% rename from js/input/UZoom.js rename to js/input/Zoom.js index 13474ea..f9d5927 100644 --- a/js/input/UZoom.js +++ b/js/input/Zoom.js @@ -1,6 +1,6 @@ -import UMouseWheel from "./UMouseWheel"; +import MouseWheel from "./MouseWheel"; -export default class UZoom extends UMouseWheel { +export default class Zoom extends MouseWheel { wheel(variation, location) { let zoomLevel = this.blueprint.getZoom() zoomLevel -= variation