Browse Source

create drawer and geometric class

Victor Luiz Domingues 5 years ago
parent
commit
84d556e9b2

+ 3 - 2
src/app/app.js

@@ -34,9 +34,10 @@ export const app = (function() {
       }
     });
     _stage.on("click tap", function(e) {
-      let tool = _getSelectedTool();
+      const tool = _getSelectedTool();
       if (tool != undefined) {
-        tool.draw(tool.object);
+        const fun = tool.draw.bind(tool);
+        fun();
         return;
       }
       if (e.target === _stage) {

+ 12 - 0
src/app/core/application/application.js

@@ -0,0 +1,12 @@
+import { menu } from "../../core/application/menu";
+export class Application {
+  constructor() {
+    this.stages = [];
+    this.actions = [];
+    this.menu = menu;
+  }
+  bootstrap() {}
+  registryComponent(component) {
+    menu.add(component);
+  }
+}

+ 8 - 0
src/app/core/models/drawers/drawer-manager.js

@@ -0,0 +1,8 @@
+import { Stage } from "../drawers/stage";
+
+export class DrawerManager {
+  constructor() {
+    this.stage = new Stage();
+    this.stage.newStage();
+  }
+}

+ 10 - 0
src/app/core/models/drawers/drawer.js

@@ -0,0 +1,10 @@
+import { DrawerManager } from "./drawer-manager";
+
+export class Drawer {
+  constructor() {
+    this.component;
+    this.drawerManager = new DrawerManager();
+    this.drawing = false;
+  }
+  onDragMove() {}
+}

+ 12 - 0
src/app/core/models/drawers/stage.js

@@ -0,0 +1,12 @@
+export class Stage {
+  constructor() {
+    this.currentLayer;
+    this.stage;
+  }
+  setStage(stage) {
+    this.stage = stage;
+  }
+  static newStage() {
+    throw "not implemented exceptio";
+  }
+}

+ 9 - 0
src/app/core/models/objects/dynamic-object.js

@@ -0,0 +1,9 @@
+import { GenericObject } from "./generic-object";
+
+export class DynamicObject extends GenericObject {
+  constructor() {
+    this.label;
+    this.dependencies = [];
+  }
+  setLabel()
+}

src/app/core/models/geometrics/generic-object.js → src/app/core/models/objects/generic-object.js


+ 2 - 4
src/app/core/models/geometrics/geometric-object.js

@@ -1,12 +1,10 @@
-import { GenericObject } from "./generic-object";
+import { DynamicObject } from "./dynamic-object";
 
-export class GeometricObject extends GenericObject {
+export class GeometricObject extends DynamicObject {
   constructor() {
     this.borderColor;
     this.backgroundColor;
     this.edgeThinckness;
-    this.label;
-    this.dependencies = [];
   }
   setBorderColor(color) {
     this.borderColor = color;