component.js 541 B

1234567891011121314151617181920212223242526
  1. import { menu as Menu } from "../../application/menu";
  2. import { app as App } from "../../../app";
  3. export class Component {
  4. constructor(drawer, options) {
  5. this.options = options;
  6. // this.genericObject;
  7. this.states;
  8. this.drawer;
  9. this.setDrawer(drawer);
  10. this._bootstrap();
  11. }
  12. _bootstrap() {
  13. if (this.options == undefined) return;
  14. Menu.add(this);
  15. }
  16. setDrawer(drawer) {
  17. this.drawer = drawer;
  18. }
  19. draw() {
  20. this.drawer.draw();
  21. }
  22. click() {
  23. App.setSelectedTool(this);
  24. this.draw();
  25. }
  26. }