From 8e5b0f4d2e84178c2bb49662ad4c98902aa3b472 Mon Sep 17 00:00:00 2001 From: Maximilian Giller <m.giller@tu-bs.de> Date: Thu, 1 Sep 2022 16:28:34 +0200 Subject: [PATCH] Removed unused code --- src/editor/js/state.ts | 89 ------------------------------- src/editor/js/structures/space.ts | 15 ------ 2 files changed, 104 deletions(-) delete mode 100644 src/editor/js/state.ts delete mode 100644 src/editor/js/structures/space.ts diff --git a/src/editor/js/state.ts b/src/editor/js/state.ts deleted file mode 100644 index 335c8ee..0000000 --- a/src/editor/js/state.ts +++ /dev/null @@ -1,89 +0,0 @@ -// export const TOOLS = { -// undo: new UndoTool("undo"), -// redo: new RedoTool("redo"), -// select: new SelectTool("select"), -// delete: new DeleteTool("delete"), -// addnode: new AddNodeTool("addnode"), -// connect: new ConnectTool("connect"), -// settings: new SettingsTool("settings"), -// save: new SaveTool("save"), -// }; -// export class State extends Tool { -// onNodeDragEnd(node: any, translate: any) { -// // Handle as click event, if drag distance under a certain threshold -// const distanceDragged = Math.sqrt( -// Math.pow(translate.x, 2) + Math.pow(translate.y, 2) -// ); -// if (distanceDragged < DRAG_THRESHOLD_2D) { -// this.onNodeClick(node); -// return; -// } else { -// this.tool.onNodeDragEnd(node, translate); -// } -// } - -// onKeyDown(key: any) { -// const previous = this.keyStates[id]; -// if (previous !== true) { -// this.tool.onKeyDown(key); -// } -// } - -// onKeyUp(key: any) { -// const previous = this.keyStates[id]; -// if (previous !== false) { -// this.tool.onKeyUp(key); -// } -// } - -// nodePointerAreaPaint(node: any, color: any, ctx: any) { -// const toolValue = this.tool.nodePointerAreaPaint(node, color, ctx); - -// if (toolValue !== undefined) { -// return toolValue; -// } - -// const imageSize = 12; -// ctx.fillStyle = color; -// ctx.fillRect( -// node.x - imageSize / 2, -// node.y - imageSize / 2, -// imageSize, -// imageSize -// ); // draw square as pointer trap -// } - -// linkWidth(link: any) { -// const toolValue = this.tool.linkWidth(link); - -// if (toolValue !== undefined) { -// return toolValue; -// } - -// return this.isLinkHighlighted(link) ? 2 : 1; -// } - -// linkDirectionalParticles() { -// const toolValue = this.tool.linkDirectionalParticles(); - -// if (toolValue !== undefined) { -// return toolValue; -// } - -// return 4; -// } - -// linkDirectionalParticleWidth(link: any) { -// const toolValue = this.tool.linkDirectionalParticleWidth(link); - -// if (toolValue !== undefined) { -// return toolValue; -// } - -// return this.isLinkHighlighted(link) ? 4 : 0; -// } - -// onBackgroundClick(event: any, positions: any) { -// this.tool.onBackgroundClick(event, positions); -// } -// } diff --git a/src/editor/js/structures/space.ts b/src/editor/js/structures/space.ts deleted file mode 100644 index 470e13d..0000000 --- a/src/editor/js/structures/space.ts +++ /dev/null @@ -1,15 +0,0 @@ -import {GLOBAL_PARAMS, SerializableItem} from "./helper/serializableitem"; -import {Graph} from "./graph/graph"; - -const SPACE_PARAMS = ["name", "description", "graph", ...GLOBAL_PARAMS]; - -export class Space extends SerializableItem { - public name: string; - public description: string; - - public graph: Graph; - - serialize(): any { - return this.serializeProperties(SPACE_PARAMS); - } -} \ No newline at end of file -- GitLab