@eclipse-glsp/client 0.10.0-next.4ce46ea.160 → 0.10.0-next.6bee8eb.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/action-dispatcher.d.ts +1 -1
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +3 -3
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +8 -8
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.js +2 -2
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +3 -3
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/di.config.js +4 -4
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context-service.js +10 -9
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/focus-tracker.js +3 -3
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.d.ts.map +1 -1
- package/lib/base/model/model-registry.js +2 -2
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts +1 -1
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +12 -12
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.d.ts +2 -2
- package/lib/base/model-initialization-constraint.d.ts.map +1 -1
- package/lib/base/model-initialization-constraint.js +9 -10
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.d.ts.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +1 -1
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js +10 -10
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/view/view-registry.d.ts.map +1 -1
- package/lib/base/view/view-registry.js +2 -2
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +1 -1
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +3 -3
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +4 -4
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js +1 -1
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js +3 -3
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +4 -4
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js +2 -2
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +7 -7
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +4 -4
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +3 -3
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +7 -7
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/copy-paste/di.config.js +3 -3
- package/lib/features/copy-paste/di.config.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts +1 -1
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +2 -2
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/di.config.js +1 -1
- package/lib/features/edit-label/di.config.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js +1 -1
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +4 -4
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/di.config.js +2 -2
- package/lib/features/hints/di.config.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +1 -1
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +13 -13
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/di.config.js +9 -9
- package/lib/features/hover/di.config.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +2 -2
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/di.config.js +3 -3
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/freeform-layout.d.ts.map +1 -1
- package/lib/features/layout/freeform-layout.js +3 -3
- package/lib/features/layout/freeform-layout.js.map +1 -1
- package/lib/features/layout/layout-commands.d.ts +1 -1
- package/lib/features/layout/layout-commands.d.ts.map +1 -1
- package/lib/features/layout/layout-commands.js +23 -20
- package/lib/features/layout/layout-commands.js.map +1 -1
- package/lib/features/layout/layout-commands.spec.js +6 -6
- package/lib/features/layout/layout-commands.spec.js.map +1 -1
- package/lib/features/layout/vbox-layout.d.ts.map +1 -1
- package/lib/features/layout/vbox-layout.js +7 -7
- package/lib/features/layout/vbox-layout.js.map +1 -1
- package/lib/features/model-source-watcher/di.config.js +1 -1
- package/lib/features/model-source-watcher/di.config.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +7 -7
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +9 -5
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +9 -45
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/di.config.js +4 -4
- package/lib/features/navigation/di.config.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +9 -9
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +5 -5
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +9 -9
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/reconnect/model.d.ts +1 -1
- package/lib/features/reconnect/model.d.ts.map +1 -1
- package/lib/features/reconnect/model.js +1 -1
- package/lib/features/reconnect/model.js.map +1 -1
- package/lib/features/save/save-keylistener.d.ts +1 -1
- package/lib/features/save/save-keylistener.d.ts.map +1 -1
- package/lib/features/save/save-keylistener.js +2 -2
- package/lib/features/save/save-keylistener.js.map +1 -1
- package/lib/features/select/di.config.js +4 -4
- package/lib/features/select/di.config.js.map +1 -1
- package/lib/features/select/select-feedback-action.js +4 -4
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/selection-service.d.ts +3 -3
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +20 -18
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +19 -19
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +19 -19
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +19 -17
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +5 -5
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.js +14 -14
- package/lib/features/tool-feedback/di.config.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +32 -32
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +3 -3
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js +3 -3
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/model.d.ts +1 -2
- package/lib/features/tool-feedback/model.d.ts.map +1 -1
- package/lib/features/tool-feedback/model.js +1 -1
- package/lib/features/tool-feedback/model.js.map +1 -1
- package/lib/features/tool-feedback/view.js +4 -4
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/di.config.js +2 -2
- package/lib/features/tool-palette/di.config.js.map +1 -1
- package/lib/features/tool-palette/palette-item.js +2 -2
- package/lib/features/tool-palette/palette-item.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +16 -14
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.js +6 -6
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +31 -31
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.d.ts +1 -1
- package/lib/features/tools/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/delete-tool.js +14 -14
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.js +3 -3
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation-tool.js +14 -14
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +23 -23
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-behavior.spec.js +63 -63
- package/lib/features/tools/marquee-behavior.spec.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +15 -15
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.d.ts +1 -1
- package/lib/features/tools/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-tool.js +3 -3
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/model.d.ts +1 -1
- package/lib/features/tools/model.d.ts.map +1 -1
- package/lib/features/tools/model.js +1 -1
- package/lib/features/tools/model.js.map +1 -1
- package/lib/features/tools/node-creation-tool.d.ts +1 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation-tool.js +13 -13
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.d.ts.map +1 -1
- package/lib/features/tools/view.js +2 -2
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/validation/di.config.js +4 -4
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +21 -21
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.js +21 -21
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +1 -1
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +21 -21
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/di.config.js +6 -6
- package/lib/features/viewport/di.config.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.js +7 -3
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +1 -1
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +1 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +5 -5
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/protocol-reexport.js +7 -2
- package/lib/protocol-reexport.js.map +1 -1
- package/lib/utils/argument-utils.js +5 -5
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +106 -9
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +124 -38
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.js +3 -3
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/base-view-module.js +19 -19
- package/lib/views/base-view-module.js.map +1 -1
- package/lib/views/compartments.js +1 -1
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts +1 -1
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +1 -1
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/index.js +6 -2
- package/lib/views/index.js.map +1 -1
- package/lib/views/issue-marker-view.d.ts.map +1 -1
- package/lib/views/issue-marker-view.js +3 -3
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.d.ts.map +1 -1
- package/lib/views/rounded-corner-view.js +2 -2
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/package.json +6 -17
- package/src/base/action-dispatcher.ts +4 -4
- package/src/base/command-stack.ts +3 -3
- package/src/base/drag-aware-mouse-listener.ts +4 -4
- package/src/base/model/model-registry.ts +2 -2
- package/src/base/model/update-model-command.ts +2 -2
- package/src/base/model-initialization-constraint.ts +8 -9
- package/src/base/selection-clearing-mouse-listener.ts +1 -1
- package/src/base/tool-manager/glsp-tool-manager.ts +7 -7
- package/src/base/view/view-registry.ts +2 -2
- package/src/features/change-bounds/model.ts +5 -5
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +1 -1
- package/src/features/decoration/decoration-placer.ts +2 -2
- package/src/features/hints/type-hints.ts +2 -2
- package/src/features/hover/hover.ts +1 -1
- package/src/features/layout/freeform-layout.ts +3 -3
- package/src/features/layout/layout-commands.ts +9 -9
- package/src/features/layout/vbox-layout.ts +16 -12
- package/src/features/mouse-tool/mouse-tool.ts +14 -50
- package/src/features/reconnect/model.ts +2 -2
- package/src/features/save/save-keylistener.ts +2 -2
- package/src/features/select/selection-service.ts +5 -4
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +10 -9
- package/src/features/tool-feedback/creation-tool-feedback.ts +10 -10
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +15 -15
- package/src/features/tool-feedback/marquee-tool-feedback.ts +2 -2
- package/src/features/tool-feedback/model.ts +1 -3
- package/src/features/tool-palette/tool-palette.ts +5 -3
- package/src/features/tools/change-bounds-tool.ts +6 -6
- package/src/features/tools/delete-tool.ts +3 -3
- package/src/features/tools/edge-creation-tool.ts +3 -3
- package/src/features/tools/edge-edit-tool.ts +5 -5
- package/src/features/tools/marquee-mouse-tool.ts +6 -6
- package/src/features/tools/marquee-tool.ts +2 -2
- package/src/features/tools/model.ts +2 -2
- package/src/features/tools/node-creation-tool.ts +3 -3
- package/src/features/tools/view.tsx +2 -3
- package/src/features/validation/marker-navigator.ts +6 -4
- package/src/features/validation/validate.ts +4 -4
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +2 -2
- package/src/lib/model.ts +2 -3
- package/src/model-source/glsp-diagram-server.ts +5 -5
- package/src/utils/smodel-util.ts +121 -41
- package/src/views/glsp-edge-view.tsx +4 -4
- package/src/views/issue-marker-view.tsx +2 -2
- package/src/views/rounded-corner-view.tsx +2 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
SModelRoot,
|
|
32
32
|
TYPES
|
|
33
33
|
} from 'sprotty';
|
|
34
|
-
import { isNotUndefined } from '../../utils/smodel-util';
|
|
34
|
+
import { forEachElement, isNotUndefined } from '../../utils/smodel-util';
|
|
35
35
|
import { addResizeHandles, isResizable, removeResizeHandles, SResizeHandle } from '../change-bounds/model';
|
|
36
36
|
import { createMovementRestrictionFeedback, removeMovementRestrictionFeedback } from '../change-bounds/movement-restrictor';
|
|
37
37
|
import { CursorCSS, cursorFeedbackAction } from '../tool-feedback/css-feedback';
|
|
@@ -54,7 +54,8 @@ export class ShowChangeBoundsToolResizeFeedbackCommand extends FeedbackCommand {
|
|
|
54
54
|
|
|
55
55
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
56
56
|
const index = context.root.index;
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
forEachElement(index, isResizable, removeResizeHandles);
|
|
58
59
|
|
|
59
60
|
if (isNotUndefined(this.action.elementId)) {
|
|
60
61
|
const resizeElement = index.getById(this.action.elementId);
|
|
@@ -74,7 +75,7 @@ export class HideChangeBoundsToolResizeFeedbackCommand extends FeedbackCommand {
|
|
|
74
75
|
|
|
75
76
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
76
77
|
const index = context.root.index;
|
|
77
|
-
index
|
|
78
|
+
forEachElement(index, isResizable, removeResizeHandles);
|
|
78
79
|
return context.root;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -95,7 +96,7 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
95
96
|
super();
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
99
|
+
override mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
99
100
|
if (event.button === 0 && !(target instanceof SResizeHandle)) {
|
|
100
101
|
const moveable = findParentByFeature(target, isMoveable);
|
|
101
102
|
if (moveable !== undefined) {
|
|
@@ -108,7 +109,7 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
108
109
|
return [];
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
112
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
112
113
|
const result: Action[] = [];
|
|
113
114
|
if (event.buttons === 0) {
|
|
114
115
|
this.mouseUp(target, event);
|
|
@@ -219,14 +220,14 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
mouseEnter(target: SModelElement, event: MouseEvent): Action[] {
|
|
223
|
+
override mouseEnter(target: SModelElement, event: MouseEvent): Action[] {
|
|
223
224
|
if (target instanceof SModelRoot && event.buttons === 0 && !this.startDragPosition) {
|
|
224
225
|
this.mouseUp(target, event);
|
|
225
226
|
}
|
|
226
227
|
return [];
|
|
227
228
|
}
|
|
228
229
|
|
|
229
|
-
mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
230
|
+
override mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
230
231
|
const result: Action[] = [];
|
|
231
232
|
if (this.startDragPosition) {
|
|
232
233
|
const moveAction = this.getElementMoves(target, event, true);
|
|
@@ -244,7 +245,7 @@ export class FeedbackMoveMouseListener extends MouseListener {
|
|
|
244
245
|
return result;
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
decorate(vnode: VNode, _element: SModelElement): VNode {
|
|
248
|
+
override decorate(vnode: VNode, _element: SModelElement): VNode {
|
|
248
249
|
return vnode;
|
|
249
250
|
}
|
|
250
251
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
SRoutableElement,
|
|
39
39
|
TYPES
|
|
40
40
|
} from 'sprotty';
|
|
41
|
-
import {
|
|
41
|
+
import { BoundsAwareModelElement, isRoutable } from '../../utils/smodel-util';
|
|
42
42
|
import { getAbsolutePosition, toAbsoluteBounds, toAbsolutePosition } from '../../utils/viewpoint-util';
|
|
43
43
|
import { FeedbackCommand } from './model';
|
|
44
44
|
|
|
@@ -86,7 +86,7 @@ export class FeedbackEdgeEnd extends SDanglingAnchor {
|
|
|
86
86
|
readonly sourceId: string,
|
|
87
87
|
readonly elementTypeId: string,
|
|
88
88
|
public feedbackEdge: SRoutableElement | undefined = undefined,
|
|
89
|
-
|
|
89
|
+
override readonly type: string = FeedbackEdgeEnd.TYPE
|
|
90
90
|
) {
|
|
91
91
|
super();
|
|
92
92
|
}
|
|
@@ -97,7 +97,7 @@ export class FeedbackEdgeEndMovingMouseListener extends MouseListener {
|
|
|
97
97
|
super();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
100
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
101
101
|
const root = target.root;
|
|
102
102
|
const edgeEnd = root.index.getById(feedbackEdgeEndId(root));
|
|
103
103
|
if (!(edgeEnd instanceof FeedbackEdgeEnd) || !edgeEnd.feedbackEdge) {
|
|
@@ -106,9 +106,9 @@ export class FeedbackEdgeEndMovingMouseListener extends MouseListener {
|
|
|
106
106
|
|
|
107
107
|
const edge = edgeEnd.feedbackEdge;
|
|
108
108
|
const position = getAbsolutePosition(edgeEnd, event);
|
|
109
|
-
const endAtMousePosition = findChildrenAtPosition(target.root, position)
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
const endAtMousePosition = findChildrenAtPosition(target.root, position)
|
|
110
|
+
.reverse()
|
|
111
|
+
.find(element => isConnectable(element) && element.canConnect(edge, 'target'));
|
|
112
112
|
|
|
113
113
|
if (endAtMousePosition instanceof SConnectableElement && edge.source && isBoundsAware(edge.source)) {
|
|
114
114
|
const anchor = this.computeAbsoluteAnchor(endAtMousePosition, center(toAbsoluteBounds(edge.source)));
|
|
@@ -146,8 +146,8 @@ export class FeedbackEdgeEndMovingMouseListener extends MouseListener {
|
|
|
146
146
|
* @param absolutePoint a point in absolute coordinates
|
|
147
147
|
* @returns the equivalent point, relative to the element's parent coordinates
|
|
148
148
|
*/
|
|
149
|
-
function absoluteToParent(element: BoundsAwareModelElement & SChildElement, absolutePoint: Point): Point{
|
|
150
|
-
if (isBoundsAware(element.parent)){
|
|
149
|
+
function absoluteToParent(element: BoundsAwareModelElement & SChildElement, absolutePoint: Point): Point {
|
|
150
|
+
if (isBoundsAware(element.parent)) {
|
|
151
151
|
return absoluteToLocal(element.parent, absolutePoint);
|
|
152
152
|
}
|
|
153
153
|
// If the parent is not bounds-aware, assume it's at 0; 0 and proceed
|
|
@@ -163,7 +163,7 @@ function absoluteToParent(element: BoundsAwareModelElement & SChildElement, abso
|
|
|
163
163
|
*/
|
|
164
164
|
function absoluteToLocal(element: BoundsAwareModelElement, absolutePoint: Point): Point {
|
|
165
165
|
const absoluteElementBounds = toAbsoluteBounds(element);
|
|
166
|
-
return {x: absolutePoint.x - absoluteElementBounds.x, y: absolutePoint.y - absoluteElementBounds.y};
|
|
166
|
+
return { x: absolutePoint.x - absoluteElementBounds.x, y: absolutePoint.y - absoluteElementBounds.y };
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
export function feedbackEdgeId(root: SModelRoot): string {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
SwitchEditModeCommand,
|
|
43
43
|
TYPES
|
|
44
44
|
} from 'sprotty';
|
|
45
|
-
import { isNotUndefined, isRoutable, isRoutingHandle } from '../../utils/smodel-util';
|
|
45
|
+
import { forEachElement, isNotUndefined, isRoutable, isRoutingHandle } from '../../utils/smodel-util';
|
|
46
46
|
import { getAbsolutePosition, toAbsoluteBounds } from '../../utils/viewpoint-util';
|
|
47
47
|
import { addReconnectHandles, removeReconnectHandles } from '../reconnect/model';
|
|
48
48
|
import { FeedbackEdgeEnd, feedbackEdgeEndId, FeedbackEdgeEndMovingMouseListener, feedbackEdgeId } from './creation-tool-feedback';
|
|
@@ -70,7 +70,7 @@ export class ShowEdgeReconnectHandlesFeedbackCommand extends FeedbackCommand {
|
|
|
70
70
|
|
|
71
71
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
72
72
|
const index = context.root.index;
|
|
73
|
-
index
|
|
73
|
+
forEachElement(index, isRoutable, removeReconnectHandles);
|
|
74
74
|
|
|
75
75
|
if (isNotUndefined(this.action.elementId)) {
|
|
76
76
|
const routableElement = index.getById(this.action.elementId);
|
|
@@ -92,7 +92,7 @@ export class HideEdgeReconnectHandlesFeedbackCommand extends FeedbackCommand {
|
|
|
92
92
|
|
|
93
93
|
execute(context: CommandExecutionContext): CommandReturn {
|
|
94
94
|
const index = context.root.index;
|
|
95
|
-
index
|
|
95
|
+
forEachElement(index, isRoutable, removeReconnectHandles);
|
|
96
96
|
return context.root;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -102,9 +102,9 @@ export class HideEdgeReconnectHandlesFeedbackCommand extends FeedbackCommand {
|
|
|
102
102
|
|
|
103
103
|
export class SwitchRoutingModeAction extends SwitchEditModeAction {
|
|
104
104
|
constructor(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
override readonly elementsToActivate: string[] = [],
|
|
106
|
+
override readonly elementsToDeactivate: string[] = [],
|
|
107
|
+
override readonly kind: string = SwitchRoutingModeCommand.KIND
|
|
108
108
|
) {
|
|
109
109
|
super(elementsToActivate, elementsToDeactivate);
|
|
110
110
|
}
|
|
@@ -112,7 +112,7 @@ export class SwitchRoutingModeAction extends SwitchEditModeAction {
|
|
|
112
112
|
|
|
113
113
|
@injectable()
|
|
114
114
|
export class SwitchRoutingModeCommand extends SwitchEditModeCommand {
|
|
115
|
-
static KIND = 'switchRoutingMode';
|
|
115
|
+
static override KIND = 'switchRoutingMode';
|
|
116
116
|
constructor(@inject(TYPES.Action) action: SwitchRoutingModeAction) {
|
|
117
117
|
super(action);
|
|
118
118
|
}
|
|
@@ -149,7 +149,7 @@ export class DrawFeedbackEdgeSourceCommand extends FeedbackCommand {
|
|
|
149
149
|
*/
|
|
150
150
|
|
|
151
151
|
export class FeedbackEdgeTargetMovingMouseListener extends FeedbackEdgeEndMovingMouseListener {
|
|
152
|
-
constructor(protected anchorRegistry: AnchorComputerRegistry) {
|
|
152
|
+
constructor(protected override anchorRegistry: AnchorComputerRegistry) {
|
|
153
153
|
super(anchorRegistry);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -159,7 +159,7 @@ export class FeedbackEdgeSourceMovingMouseListener extends MouseListener {
|
|
|
159
159
|
super();
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
162
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
163
163
|
const root = target.root;
|
|
164
164
|
const edgeEnd = root.index.getById(feedbackEdgeEndId(root));
|
|
165
165
|
if (!(edgeEnd instanceof FeedbackEdgeEnd) || !edgeEnd.feedbackEdge) {
|
|
@@ -208,7 +208,7 @@ export class FeedbackEdgeRouteMovingMouseListener extends MouseListener {
|
|
|
208
208
|
super();
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
211
|
+
override mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
212
212
|
const result: Action[] = [];
|
|
213
213
|
if (event.button === 0) {
|
|
214
214
|
const routingHandle = findParentByFeature(target, isRoutingHandle);
|
|
@@ -223,7 +223,7 @@ export class FeedbackEdgeRouteMovingMouseListener extends MouseListener {
|
|
|
223
223
|
return result;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
226
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
227
227
|
const result: Action[] = [];
|
|
228
228
|
if (event.buttons === 0) {
|
|
229
229
|
this.mouseUp(target, event);
|
|
@@ -273,20 +273,20 @@ export class FeedbackEdgeRouteMovingMouseListener extends MouseListener {
|
|
|
273
273
|
return undefined;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
mouseEnter(target: SModelElement, event: MouseEvent): Action[] {
|
|
276
|
+
override mouseEnter(target: SModelElement, event: MouseEvent): Action[] {
|
|
277
277
|
if (target instanceof SModelRoot && event.buttons === 0) {
|
|
278
278
|
this.mouseUp(target, event);
|
|
279
279
|
}
|
|
280
280
|
return [];
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
mouseUp(_target: SModelElement, event: MouseEvent): Action[] {
|
|
283
|
+
override mouseUp(_target: SModelElement, event: MouseEvent): Action[] {
|
|
284
284
|
this.hasDragged = false;
|
|
285
285
|
this.lastDragPosition = undefined;
|
|
286
286
|
return [];
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
decorate(vnode: VNode, _element: SModelElement): VNode {
|
|
289
|
+
override decorate(vnode: VNode, _element: SModelElement): VNode {
|
|
290
290
|
return vnode;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -68,7 +68,7 @@ export class MarqueeEndMovingMouseListener extends MouseListener {
|
|
|
68
68
|
super();
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
71
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
72
72
|
return [];
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -19,8 +19,6 @@ export abstract class FeedbackCommand extends Command {
|
|
|
19
19
|
// used by the `FeedbackAwareUpdateModelCommand`
|
|
20
20
|
readonly priority: number = 0;
|
|
21
21
|
|
|
22
|
-
abstract execute(context: CommandExecutionContext): CommandReturn;
|
|
23
|
-
|
|
24
22
|
undo(context: CommandExecutionContext): CommandReturn {
|
|
25
23
|
return context.root;
|
|
26
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -75,7 +75,7 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
75
75
|
this.editorContext.register(this);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
initialize(): boolean {
|
|
78
|
+
override initialize(): boolean {
|
|
79
79
|
if (!this.paletteItems) {
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
@@ -88,7 +88,7 @@ export class ToolPalette extends AbstractUIExtension implements IActionHandler,
|
|
|
88
88
|
this.lastActivebutton = this.defaultToolsButton;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
protected onBeforeShow(_containerElement: HTMLElement, root: Readonly<SModelRoot>): void {
|
|
91
|
+
protected override onBeforeShow(_containerElement: HTMLElement, root: Readonly<SModelRoot>): void {
|
|
92
92
|
this.modelRootId = root.id;
|
|
93
93
|
this.containerElement.style.maxHeight = PALETTE_HEIGHT;
|
|
94
94
|
}
|
|
@@ -410,10 +410,12 @@ export function createToolGroup(item: PaletteItem): HTMLElement {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
export function changeCSSClass(element: Element, css: string): void {
|
|
413
|
+
// eslint-disable-next-line chai-friendly/no-unused-expressions
|
|
413
414
|
element.classList.contains(css) ? element.classList.remove(css) : element.classList.add(css);
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
export function changeCodiconClass(element: Element, codiconId: string): void {
|
|
418
|
+
// eslint-disable-next-line chai-friendly/no-unused-expressions
|
|
417
419
|
element.classList.contains(codiconCSSClasses(codiconId)[1])
|
|
418
420
|
? element.classList.remove(codiconCSSClasses(codiconId)[1])
|
|
419
421
|
: element.classList.add(codiconCSSClasses(codiconId)[1]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -138,7 +138,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
138
138
|
super();
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
141
|
+
override mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
142
142
|
super.mouseDown(target, event);
|
|
143
143
|
if (event.button !== 0) {
|
|
144
144
|
return [];
|
|
@@ -157,7 +157,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
157
157
|
return [];
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
160
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
161
161
|
super.mouseMove(target, event);
|
|
162
162
|
if (this.isMouseDrag && this.activeResizeHandle) {
|
|
163
163
|
// rely on the FeedbackMoveMouseListener to update the element bounds of selected elements
|
|
@@ -176,7 +176,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
176
176
|
return [];
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
draggingMouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
179
|
+
override draggingMouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
180
180
|
if (this.lastDragPosition === undefined) {
|
|
181
181
|
this.resetPosition();
|
|
182
182
|
return [];
|
|
@@ -209,7 +209,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
209
209
|
const result: Operation[] = [];
|
|
210
210
|
const newBounds: ElementAndBounds[] = [];
|
|
211
211
|
const selectedElements: (SModelElement & BoundsAware)[] = [];
|
|
212
|
-
forEachElement(target, isNonRoutableSelectedMovableBoundsAware, element => {
|
|
212
|
+
forEachElement(target.index, isNonRoutableSelectedMovableBoundsAware, element => {
|
|
213
213
|
selectedElements.push(element);
|
|
214
214
|
});
|
|
215
215
|
|
|
@@ -238,7 +238,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements Sele
|
|
|
238
238
|
protected handleMoveRoutingPointsOnServer(target: SModelElement): Action[] {
|
|
239
239
|
const result: Operation[] = [];
|
|
240
240
|
const newRoutingPoints: ElementAndRoutingPoints[] = [];
|
|
241
|
-
forEachElement(target, isNonRoutableSelectedMovableBoundsAware, element => {
|
|
241
|
+
forEachElement(target.index, isNonRoutableSelectedMovableBoundsAware, element => {
|
|
242
242
|
// If client routing is enabled -> delegate routingpoints of connected edges to server
|
|
243
243
|
if (this.tool.edgeRouterRegistry && element instanceof SConnectableElement) {
|
|
244
244
|
element.incomingEdges.map(toElementAndRoutingPoints).forEach(ear => newRoutingPoints.push(ear));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -60,7 +60,7 @@ export class DelKeyDeleteTool implements GLSPTool {
|
|
|
60
60
|
|
|
61
61
|
@injectable()
|
|
62
62
|
export class DeleteKeyListener extends KeyListener {
|
|
63
|
-
keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
63
|
+
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
64
64
|
if (matchesKeystroke(event, 'Delete')) {
|
|
65
65
|
const deleteElementIds = Array.from(
|
|
66
66
|
element.root.index
|
|
@@ -108,7 +108,7 @@ export class MouseDeleteTool implements GLSPTool {
|
|
|
108
108
|
|
|
109
109
|
@injectable()
|
|
110
110
|
export class DeleteToolMouseListener extends MouseListener {
|
|
111
|
-
mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
111
|
+
override mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
112
112
|
const deletableParent = findParentByFeature(target, isDeletable);
|
|
113
113
|
if (deletableParent === undefined) {
|
|
114
114
|
return [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -99,7 +99,7 @@ export class EdgeCreationToolMouseListener extends DragAwareMouseListener {
|
|
|
99
99
|
this.tool.dispatchFeedback([new RemoveFeedbackEdgeAction()]);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
nonDraggingMouseUp(_element: SModelElement, event: MouseEvent): Action[] {
|
|
102
|
+
override nonDraggingMouseUp(_element: SModelElement, event: MouseEvent): Action[] {
|
|
103
103
|
const result: Action[] = [];
|
|
104
104
|
if (event.button === 0) {
|
|
105
105
|
if (!this.isSourceSelected()) {
|
|
@@ -134,7 +134,7 @@ export class EdgeCreationToolMouseListener extends DragAwareMouseListener {
|
|
|
134
134
|
return this.target !== undefined;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
137
|
+
override mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
138
138
|
const newCurrentTarget = findParentByFeature(target, isConnectable);
|
|
139
139
|
if (newCurrentTarget !== this.currentTarget) {
|
|
140
140
|
this.currentTarget = newCurrentTarget;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -185,7 +185,7 @@ class EdgeEditListener extends DragAwareMouseListener implements SelectionListen
|
|
|
185
185
|
return this.routingHandle !== undefined;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
188
|
+
override mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
189
189
|
const result: Action[] = super.mouseDown(target, event);
|
|
190
190
|
if (event.button === 0) {
|
|
191
191
|
const reconnectHandle = findParentByFeature(target, isReconnectHandle);
|
|
@@ -208,7 +208,7 @@ class EdgeEditListener extends DragAwareMouseListener implements SelectionListen
|
|
|
208
208
|
return result;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
211
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
212
212
|
const result = super.mouseMove(target, event);
|
|
213
213
|
if (this.isMouseDrag) {
|
|
214
214
|
// reset any selected connectables when we are dragging, maybe the user is just panning
|
|
@@ -217,7 +217,7 @@ class EdgeEditListener extends DragAwareMouseListener implements SelectionListen
|
|
|
217
217
|
return result;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
220
|
+
override mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
221
221
|
const result = super.mouseUp(target, event);
|
|
222
222
|
if (!this.isReadyToReconnect() && !this.isReadyToReroute()) {
|
|
223
223
|
return result;
|
|
@@ -242,7 +242,7 @@ class EdgeEditListener extends DragAwareMouseListener implements SelectionListen
|
|
|
242
242
|
return result;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
245
|
+
override mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
246
246
|
if (this.edge && this.isReconnecting()) {
|
|
247
247
|
const currentTarget = findParentByFeature(target, isConnectable);
|
|
248
248
|
if (!this.newConnectable || currentTarget !== this.newConnectable) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -28,8 +28,8 @@ import {
|
|
|
28
28
|
TYPES
|
|
29
29
|
} from 'sprotty';
|
|
30
30
|
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
|
|
31
|
-
import { GLSP_TYPES } from '../../base/types';
|
|
32
31
|
import { DragAwareMouseListener } from '../../base/drag-aware-mouse-listener';
|
|
32
|
+
import { GLSP_TYPES } from '../../base/types';
|
|
33
33
|
import { getAbsolutePosition, toAbsoluteBounds } from '../../utils/viewpoint-util';
|
|
34
34
|
import { CursorCSS, cursorFeedbackAction } from '../tool-feedback/css-feedback';
|
|
35
35
|
import { RemoveMarqueeAction } from '../tool-feedback/marquee-tool-feedback';
|
|
@@ -93,7 +93,7 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
|
|
|
93
93
|
this.edges = Array.from(document.querySelectorAll('g')).filter(e => sEdges.includes(this.domHelper.findSModelIdByDOMElement(e)));
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
96
|
+
override mouseDown(target: SModelElement, event: MouseEvent): Action[] {
|
|
97
97
|
this.isActive = true;
|
|
98
98
|
this.marqueeUtil.updateStartPoint(getAbsolutePosition(target, event));
|
|
99
99
|
if (event.ctrlKey) {
|
|
@@ -108,7 +108,7 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
|
|
|
108
108
|
return [];
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
111
|
+
override mouseMove(target: SModelElement, event: MouseEvent): Action[] {
|
|
112
112
|
this.marqueeUtil.updateCurrentPoint(getAbsolutePosition(target, event));
|
|
113
113
|
if (this.isActive) {
|
|
114
114
|
const nodeIdsSelected = this.nodes.filter(e => this.marqueeUtil.isNodeMarked(toAbsoluteBounds(e))).map(e => e.id);
|
|
@@ -123,7 +123,7 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
|
|
|
123
123
|
return [];
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
126
|
+
override mouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
127
127
|
this.isActive = false;
|
|
128
128
|
if (event.shiftKey) {
|
|
129
129
|
return [new RemoveMarqueeAction()];
|
|
@@ -144,7 +144,7 @@ export class MarqueeMouseListener extends DragAwareMouseListener {
|
|
|
144
144
|
|
|
145
145
|
@injectable()
|
|
146
146
|
export class ShiftKeyListener extends KeyListener {
|
|
147
|
-
keyUp(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
147
|
+
override keyUp(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
148
148
|
if (event.shiftKey) {
|
|
149
149
|
return [];
|
|
150
150
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -42,7 +42,7 @@ export class MarqueeTool extends BaseGLSPTool {
|
|
|
42
42
|
|
|
43
43
|
@injectable()
|
|
44
44
|
export class MarqueeKeyListener extends KeyListener {
|
|
45
|
-
keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
45
|
+
override keyDown(element: SModelElement, event: KeyboardEvent): Action[] {
|
|
46
46
|
if (event.shiftKey) {
|
|
47
47
|
return [new EnableToolsAction([MarqueeMouseTool.ID])];
|
|
48
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { boundsFeature, Point, RectangularNode } from 'sprotty';
|
|
17
17
|
|
|
18
18
|
export class MarqueeNode extends RectangularNode {
|
|
19
|
-
static readonly DEFAULT_FEATURES = [boundsFeature];
|
|
19
|
+
static override readonly DEFAULT_FEATURES = [boundsFeature];
|
|
20
20
|
startPoint: Point;
|
|
21
21
|
endPoint: Point;
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -83,7 +83,7 @@ export class NodeCreationToolMouseListener extends DragAwareMouseListener {
|
|
|
83
83
|
return this.triggerAction.elementTypeId;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
nonDraggingMouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
86
|
+
override nonDraggingMouseUp(target: SModelElement, event: MouseEvent): Action[] {
|
|
87
87
|
const result: Action[] = [];
|
|
88
88
|
if (this.creationAllowed(this.elementTypeId)) {
|
|
89
89
|
const containerId = this.container ? this.container.id : undefined;
|
|
@@ -102,7 +102,7 @@ export class NodeCreationToolMouseListener extends DragAwareMouseListener {
|
|
|
102
102
|
return result;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
105
|
+
override mouseOver(target: SModelElement, event: MouseEvent): Action[] {
|
|
106
106
|
const currentContainer = findParentByFeature(target, isContainable);
|
|
107
107
|
if (!this.container || currentContainer !== this.container) {
|
|
108
108
|
this.container = currentContainer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2021 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2021-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import { injectable } from 'inversify';
|
|
17
17
|
import { VNode } from 'snabbdom';
|
|
18
18
|
import { RectangularNodeView, RenderingContext, svg } from 'sprotty';
|
|
19
|
-
|
|
20
19
|
import { MarqueeNode } from './model';
|
|
21
20
|
|
|
22
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -24,7 +23,7 @@ const JSX = { createElement: svg };
|
|
|
24
23
|
|
|
25
24
|
@injectable()
|
|
26
25
|
export class MarqueeView extends RectangularNodeView {
|
|
27
|
-
render(node: MarqueeNode, context: RenderingContext): VNode {
|
|
26
|
+
override render(node: MarqueeNode, context: RenderingContext): VNode {
|
|
28
27
|
const graph = (
|
|
29
28
|
<g>
|
|
30
29
|
<rect
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020-
|
|
2
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -180,9 +180,11 @@ export class NavigateToMarkerCommand extends Command {
|
|
|
180
180
|
if (this.action.selectedElementIds !== undefined && this.action.selectedElementIds.length > 0) {
|
|
181
181
|
selectedIds = this.action.selectedElementIds;
|
|
182
182
|
} else {
|
|
183
|
-
|
|
183
|
+
return this.selectionService.getSelectedElements();
|
|
184
184
|
}
|
|
185
|
-
return selectedIds.map(id => root.index.getById(id)).filter(isSelectable)
|
|
185
|
+
return selectedIds.map(id => root.index.getById(id)).filter(element => element !== undefined && isSelectable(element)) as Array<
|
|
186
|
+
SModelElement & Selectable
|
|
187
|
+
>;
|
|
186
188
|
}
|
|
187
189
|
|
|
188
190
|
protected getTarget(selected: SModelElement[], root: SModelRoot): SIssueMarker | undefined {
|
|
@@ -250,7 +252,7 @@ export class MarkerNavigatorContextMenuItemProvider implements IContextMenuItemP
|
|
|
250
252
|
|
|
251
253
|
@injectable()
|
|
252
254
|
export class MarkerNavigatorKeyListener extends KeyListener {
|
|
253
|
-
keyDown(_element: SModelElement, event: KeyboardEvent): Action[] {
|
|
255
|
+
override keyDown(_element: SModelElement, event: KeyboardEvent): Action[] {
|
|
254
256
|
if (matchesKeystroke(event, 'Period', 'ctrl')) {
|
|
255
257
|
return [new NavigateToMarkerAction('next')];
|
|
256
258
|
} else if (matchesKeystroke(event, 'Comma', 'ctrl')) {
|