|
@@ -0,0 +1,36 @@
|
|
|
|
+import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum";
|
|
|
|
+import { SelectableDrawer } from "../../../core/drawers/selectable-drawer";
|
|
|
|
+import { objects as Objects } from "../../../core/application/objects";
|
|
|
|
+
|
|
|
|
+export class TrashDrawer extends SelectableDrawer {
|
|
|
|
+ constructor() {
|
|
|
|
+ super();
|
|
|
|
+
|
|
|
|
+ this.setElementClass(ELEMENTS_CLASS.NONE);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ draw(e) {
|
|
|
|
+ const objects = Objects.getSelectedObjects();
|
|
|
|
+ objects.forEach(aggregator => {
|
|
|
|
+ this.delete(aggregator);
|
|
|
|
+ });
|
|
|
|
+ super.batchDraw();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ delete(aggregator) {
|
|
|
|
+
|
|
|
|
+ Objects.removeAggregator(aggregator);
|
|
|
|
+ aggregator.aggregators.forEach(dependenceAggregator => {
|
|
|
|
+ this.delete(dependenceAggregator);
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ aggregator.visible = false;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ update(aggregator, e) {
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+}
|