@eclipse-glsp-examples/workflow-glsp 0.9.0-rc-01 → 0.10.0-next.bb1c2fd.157

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.
@@ -1,17 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
16
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -21,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
21
8
  Object.defineProperty(exports, "__esModule", { value: true });
22
9
  exports.IconView = exports.WorkflowEdgeView = void 0;
23
10
  /********************************************************************************
24
- * Copyright (c) 2019 EclipseSource and others.
11
+ * Copyright (c) 2019-2021 EclipseSource and others.
25
12
  *
26
13
  * This program and the accompanying materials are made available under the
27
14
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -35,46 +22,38 @@ exports.IconView = exports.WorkflowEdgeView = void 0;
35
22
  *
36
23
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
37
24
  ********************************************************************************/
38
- var client_1 = require("@eclipse-glsp/client");
39
- var inversify_1 = require("inversify");
40
- var snabbdom = require("snabbdom-jsx");
25
+ const client_1 = require("@eclipse-glsp/client");
26
+ const inversify_1 = require("inversify");
27
+ const sprotty_1 = require("sprotty");
41
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
- var JSX = { createElement: snabbdom.svg };
43
- var WorkflowEdgeView = /** @class */ (function (_super) {
44
- __extends(WorkflowEdgeView, _super);
45
- function WorkflowEdgeView() {
46
- return _super !== null && _super.apply(this, arguments) || this;
47
- }
48
- WorkflowEdgeView.prototype.renderAdditionals = function (edge, segments, context) {
49
- var additionals = _super.prototype.renderAdditionals.call(this, edge, segments, context);
50
- var p1 = segments[segments.length - 2];
51
- var p2 = segments[segments.length - 1];
52
- var arrow = JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1.5,0 L 10,-4 L 10,4 Z', transform: "rotate(" + client_1.toDegrees(client_1.angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y })) + " " + p2.x + " " + p2.y + ") translate(" + p2.x + " " + p2.y + ")" });
29
+ const JSX = { createElement: sprotty_1.svg };
30
+ let WorkflowEdgeView = class WorkflowEdgeView extends client_1.PolylineEdgeViewWithGapsOnIntersections {
31
+ renderAdditionals(edge, segments, context) {
32
+ const additionals = super.renderAdditionals(edge, segments, context);
33
+ const p1 = segments[segments.length - 2];
34
+ const p2 = segments[segments.length - 1];
35
+ const arrow = (JSX.createElement("path", { "class-sprotty-edge": true, "class-arrow": true, d: 'M 1.5,0 L 10,-4 L 10,4 Z', transform: `rotate(${client_1.toDegrees(client_1.angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${p2.y})` }));
53
36
  additionals.push(arrow);
54
37
  return additionals;
55
- };
56
- WorkflowEdgeView = __decorate([
57
- inversify_1.injectable()
58
- ], WorkflowEdgeView);
59
- return WorkflowEdgeView;
60
- }(client_1.GEdgeView));
38
+ }
39
+ };
40
+ WorkflowEdgeView = __decorate([
41
+ inversify_1.injectable()
42
+ ], WorkflowEdgeView);
61
43
  exports.WorkflowEdgeView = WorkflowEdgeView;
62
- var IconView = /** @class */ (function () {
63
- function IconView() {
44
+ let IconView = class IconView {
45
+ render(element, context) {
46
+ const radius = this.getRadius();
47
+ return (JSX.createElement("g", null,
48
+ JSX.createElement("circle", { "class-sprotty-icon": true, r: radius, cx: radius + 2, cy: radius + 2 }),
49
+ context.renderChildren(element)));
64
50
  }
65
- IconView.prototype.render = function (element, context) {
66
- var radius = this.getRadius();
67
- return JSX.createElement("g", null,
68
- JSX.createElement("circle", { "class-sprotty-icon": true, r: radius, cx: radius, cy: radius }),
69
- context.renderChildren(element));
70
- };
71
- IconView.prototype.getRadius = function () {
72
- return 16;
73
- };
74
- IconView = __decorate([
75
- inversify_1.injectable()
76
- ], IconView);
77
- return IconView;
78
- }());
51
+ getRadius() {
52
+ return 14;
53
+ }
54
+ };
55
+ IconView = __decorate([
56
+ inversify_1.injectable()
57
+ ], IconView);
79
58
  exports.IconView = IconView;
80
59
  //# sourceMappingURL=workflow-views.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-views.js","sourceRoot":"","sources":["../src/workflow-views.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAQ8B;AAC9B,uCAAuC;AACvC,uCAAyC;AAKzC,6DAA6D;AAC7D,IAAM,GAAG,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC;AAG5C;IAAsC,oCAAS;IAA/C;;IAUA,CAAC;IATa,4CAAiB,GAA3B,UAA4B,IAAW,EAAE,QAAiB,EAAE,OAAyB;QACjF,IAAM,WAAW,GAAG,iBAAM,iBAAiB,YAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrE,IAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAM,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAM,KAAK,GAAG,kDAA0B,IA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AAO,CAAC,CAChC,CACP,CAAC;IACN,CAAC;IAED,SAAS;QACL,OAAO,EAAE,CAAC;IACd,CAAC;CACJ,CAAA;AAdY,QAAQ;IADpB,sBAAU,EAAE;GACA,QAAQ,CAcpB;AAdY,4BAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-glsp",
3
- "version": "0.9.0-rc-01",
3
+ "version": "0.10.0-next.bb1c2fd.157+bb1c2fd",
4
4
  "description": "GLSP diagrams for the Workflow DSL",
5
5
  "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
6
6
  "keywords": [
@@ -20,23 +20,13 @@
20
20
  "bugs": "https://github.com/eclipse-glsp/glsp/issues",
21
21
  "contributors": [
22
22
  {
23
- "name": "Philip Langer",
24
- "email": "planger@eclipsesource.com",
25
- "url": "https://www.eclipsesource.com"
26
- },
27
- {
28
- "name": "Tobias Ortmayr",
29
- "email": "tortmayr@eclipsesource.com",
30
- "url": "https://www.eclipsesource.com"
31
- },
32
- {
33
- "name": "Martin Fleck",
34
- "email": "mfleck@eclipsesource.com",
35
- "url": "https://www.eclipsesource.com"
23
+ "name": "Eclipse GLSP Project",
24
+ "email": "glsp-dev@eclipse.org",
25
+ "url": "https://projects.eclipse.org/projects/ecd.glsp"
36
26
  }
37
27
  ],
38
28
  "dependencies": {
39
- "@eclipse-glsp/client": "0.9.0-rc-01",
29
+ "@eclipse-glsp/client": "0.10.0-next.bb1c2fd.157+bb1c2fd",
40
30
  "balloon-css": "^0.5.0"
41
31
  },
42
32
  "devDependencies": {
@@ -62,5 +52,6 @@
62
52
  "types": "lib/index",
63
53
  "publishConfig": {
64
54
  "access": "public"
65
- }
55
+ },
56
+ "gitHead": "bb1c2fd0120feb99965b33b6fdf57fcb7fe0d62d"
66
57
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -13,20 +13,23 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import download from "mvn-artifact-download";
17
- import { join, resolve } from "path";
16
+ import download from 'mvn-artifact-download';
17
+ import { join, resolve } from 'path';
18
18
 
19
- const downloadDir = resolve(join(__dirname)) + "/../../..";
20
- const mavenRepository = "https://oss.sonatype.org/content/repositories/snapshots/";
21
- const groupId = "org.eclipse.glsp.example";
22
- const artifactId = "org.eclipse.glsp.example.workflow";
23
- const version = "0.9.0";
24
- const classifier = "glsp";
19
+ const downloadDir = resolve(join(__dirname)) + '/../../..';
20
+ const mavenRepository = 'https://oss.sonatype.org/content/repositories/snapshots/';
21
+ const groupId = 'org.eclipse.glsp.example';
22
+ const artifactId = 'org.eclipse.glsp.example.workflow';
23
+ const version = '0.9.0';
24
+ const classifier = 'glsp';
25
25
 
26
- console.log("Downloading latest version of the Workflow Example Java Server from the maven repository...");
27
- download({ groupId, artifactId, version, classifier, isSnapShot: true }, downloadDir, mavenRepository)
28
- .then(() => console.log("Download completed. Start the server using this command: \njava -jar org.eclipse.glsp.example.workflow-"
29
- + version + "-SNAPSHOT-glsp.jar org.eclipse.glsp.example.workflow.launch.ExampleServerLauncher --port=8081 --websocket\n\n"
30
- + "After starting the server, access the following file locally in your browser to see the running example:\n"
31
- + "./examples/workflow-standalone/app/diagram.html"
32
- ));
26
+ console.log('Downloading latest version of the Workflow Example Java Server from the maven repository...');
27
+ download({ groupId, artifactId, version, classifier, isSnapShot: true }, downloadDir, mavenRepository).then(() =>
28
+ console.log(
29
+ 'Download completed. Start the server using this command: \njava -jar org.eclipse.glsp.example.workflow-' +
30
+ version +
31
+ '-SNAPSHOT-glsp.jar org.eclipse.glsp.example.workflow.launch.ExampleServerLauncher --port=8081 --websocket\n\n' +
32
+ 'After starting the server, access the following file locally in your browser to see the running example:\n' +
33
+ './examples/workflow-standalone/app/diagram.html'
34
+ )
35
+ );
package/src/di.config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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
@@ -13,74 +13,40 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import '../css/diagram.css';
17
- import 'balloon-css/balloon.min.css';
18
- import 'sprotty/css/edit-label.css';
19
-
20
16
  import {
21
- boundsModule,
22
- buttonModule,
23
17
  configureDefaultModelElements,
24
18
  configureModelElement,
25
19
  ConsoleLogger,
26
- defaultGLSPModule,
27
- defaultModule,
28
- DefaultTypes,
20
+ createClientContainer,
29
21
  DeleteElementContextMenuItemProvider,
30
22
  DiamondNodeView,
31
- edgeLayoutModule,
32
23
  editLabelFeature,
33
- expandModule,
34
- exportModule,
35
- fadeModule,
36
- GLSP_TYPES,
37
- glspCommandPaletteModule,
38
- glspContextMenuModule,
39
- glspDecorationModule,
40
- glspEditLabelModule,
41
- glspHoverModule,
42
- glspMouseToolModule,
43
- glspSelectModule,
44
- glspServerCopyPasteModule,
45
- glspViewportModule,
46
24
  GridSnapper,
47
- labelEditUiModule,
48
- layoutCommandsModule,
49
25
  LogLevel,
50
- markerNavigatorModule,
51
- modelHintsModule,
52
- modelSourceModule,
53
- modelSourceWatcherModule,
54
- navigationModule,
55
- NoOverlapMovmentRestrictor,
56
- openModule,
57
26
  overrideViewerOptions,
58
- paletteModule,
27
+ RectangularNodeView,
59
28
  RevealNamedElementActionProvider,
60
29
  RoundedCornerNodeView,
61
- routingModule,
62
30
  SCompartment,
63
31
  SCompartmentView,
64
32
  SEdge,
65
33
  SLabel,
66
34
  SLabelView,
67
- toolFeedbackModule,
68
- toolsModule,
69
- TYPES,
70
- validationModule,
71
- zorderModule,
72
- RectangularNodeView
35
+ StructureCompartmentView,
36
+ TYPES
73
37
  } from '@eclipse-glsp/client';
38
+ import { DefaultTypes } from '@eclipse-glsp/protocol';
39
+ import 'balloon-css/balloon.min.css';
74
40
  import { Container, ContainerModule } from 'inversify';
75
-
41
+ import 'sprotty/css/edit-label.css';
42
+ import '../css/diagram.css';
76
43
  import { directTaskEditor } from './direct-task-editing/di.config';
77
- import { ActivityNode, Icon, TaskNode, WeightedEdge } from './model';
44
+ import { ActivityNode, CategoryNode, Icon, TaskNode, WeightedEdge } from './model';
78
45
  import { IconView, WorkflowEdgeView } from './workflow-views';
79
46
 
80
47
  const workflowDiagramModule = new ContainerModule((bind, unbind, isBound, rebind) => {
81
48
  rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
82
49
  rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
83
- bind(GLSP_TYPES.IMovementRestrictor).to(NoOverlapMovmentRestrictor).inSingletonScope();
84
50
  bind(TYPES.ISnapper).to(GridSnapper);
85
51
  bind(TYPES.ICommandPaletteActionProvider).to(RevealNamedElementActionProvider);
86
52
  bind(TYPES.IContextMenuItemProvider).to(DeleteElementContextMenuItemProvider);
@@ -100,21 +66,16 @@ const workflowDiagramModule = new ContainerModule((bind, unbind, isBound, rebind
100
66
  configureModelElement(context, 'activityNode:decision', ActivityNode, DiamondNodeView);
101
67
  configureModelElement(context, 'activityNode:fork', ActivityNode, RectangularNodeView);
102
68
  configureModelElement(context, 'activityNode:join', ActivityNode, RectangularNodeView);
69
+
70
+ configureModelElement(context, 'category', CategoryNode, RoundedCornerNodeView);
71
+ configureModelElement(context, 'struct', SCompartment, StructureCompartmentView);
103
72
  });
104
73
 
105
74
  export default function createContainer(widgetId: string): Container {
106
- const container = new Container();
107
-
108
- container.load(defaultModule, defaultGLSPModule, glspMouseToolModule, validationModule, glspSelectModule, boundsModule, glspViewportModule, toolsModule,
109
- glspHoverModule, fadeModule, exportModule, expandModule, openModule, buttonModule, modelSourceModule, labelEditUiModule, glspEditLabelModule,
110
- workflowDiagramModule, toolFeedbackModule, modelHintsModule, glspContextMenuModule, glspServerCopyPasteModule, modelSourceWatcherModule,
111
- glspCommandPaletteModule, paletteModule, routingModule, glspDecorationModule, edgeLayoutModule, zorderModule,
112
- layoutCommandsModule, directTaskEditor, navigationModule, markerNavigatorModule);
113
-
75
+ const container = createClientContainer(workflowDiagramModule, directTaskEditor);
114
76
  overrideViewerOptions(container, {
115
77
  baseDiv: widgetId,
116
78
  hiddenDiv: widgetId + '_hidden'
117
79
  });
118
-
119
80
  return container;
120
81
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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,12 +42,11 @@ import { isTaskNode, TaskNode } from '../model';
42
42
  export class ApplyTaskEditOperation implements Action {
43
43
  static readonly KIND = 'applyTaskEdit';
44
44
  readonly kind = ApplyTaskEditOperation.KIND;
45
- constructor(readonly taskId: string, readonly expression: string) { }
45
+ constructor(readonly taskId: string, readonly expression: string) {}
46
46
  }
47
47
 
48
48
  @injectable()
49
49
  export class TaskEditor extends AbstractUIExtension {
50
-
51
50
  static readonly ID = 'task-editor';
52
51
  readonly autoSuggestionSettings = {
53
52
  noSuggestionsMessage: 'No suggestions available',
@@ -86,14 +85,16 @@ export class TaskEditor extends AbstractUIExtension {
86
85
  this.autoSuggestionSettings,
87
86
  { provideSuggestions: input => this.retrieveSuggestions(input) },
88
87
  { executeFromSuggestion: input => this.executeFromSuggestion(input) },
89
- () => this.hide(), this.logger);
88
+ () => this.hide(),
89
+ this.logger
90
+ );
90
91
  this.autoSuggestion.configureValidation(
91
92
  { validate: input => this.validateInput(input) },
92
93
  new ValidationDecorator(containerElement)
93
94
  );
94
- this.autoSuggestion.configureTextSubmitHandler(
95
- { executeFromTextOnlyInput: (input: string) => this.executeFromTextOnlyInput(input) }
96
- );
95
+ this.autoSuggestion.configureTextSubmitHandler({
96
+ executeFromTextOnlyInput: (input: string) => this.executeFromTextOnlyInput(input)
97
+ });
97
98
  this.autoSuggestion.initialize(containerElement);
98
99
  }
99
100
 
@@ -124,8 +125,9 @@ export class TaskEditor extends AbstractUIExtension {
124
125
  }
125
126
 
126
127
  protected async retrieveSuggestions(input: string): Promise<LabeledAction[]> {
127
- const response = await this.actionDispatcher.request(new RequestContextActions(TaskEditor.ID,
128
- this.editorContextService.get({ ['text']: input })));
128
+ const response = await this.actionDispatcher.request(
129
+ new RequestContextActions(TaskEditor.ID, this.editorContextService.get({ ['text']: input }))
130
+ );
129
131
  if (isSetContextActionsAction(response)) {
130
132
  return response.actions;
131
133
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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,4 +19,3 @@ export * from './model';
19
19
  export * from './workflow-views';
20
20
  export * from './direct-task-editing/direct-task-editor';
21
21
  export { createWorkflowDiagramContainer };
22
-
package/src/model.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020 EclipseSource and others.
2
+ * Copyright (c) 2020-2021 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
@@ -40,8 +40,19 @@ import {
40
40
  } from '@eclipse-glsp/client';
41
41
 
42
42
  export class TaskNode extends RectangularNode implements Nameable, WithEditableLabel {
43
- static readonly DEFAULT_FEATURES = [connectableFeature, deletableFeature, selectFeature, boundsFeature,
44
- moveFeature, layoutContainerFeature, fadeFeature, hoverFeedbackFeature, popupFeature, nameFeature, withEditLabelFeature];
43
+ static readonly DEFAULT_FEATURES = [
44
+ connectableFeature,
45
+ deletableFeature,
46
+ selectFeature,
47
+ boundsFeature,
48
+ moveFeature,
49
+ layoutContainerFeature,
50
+ fadeFeature,
51
+ hoverFeedbackFeature,
52
+ popupFeature,
53
+ nameFeature,
54
+ withEditLabelFeature
55
+ ];
45
56
  name = '';
46
57
  duration?: number;
47
58
  taskType?: string;
@@ -76,7 +87,6 @@ export class ActivityNode extends DiamondNode {
76
87
  strokeWidth = 1;
77
88
  }
78
89
 
79
- // eslint-disable-next-line no-redeclare
80
90
  export namespace ActivityNode {
81
91
  export namespace Type {
82
92
  export const INITIAL = 'initalNode';
@@ -99,3 +109,28 @@ export class Icon extends SShapeElement implements LayoutContainer {
99
109
  height: 32
100
110
  };
101
111
  }
112
+
113
+ export class CategoryNode extends RectangularNode implements Nameable, WithEditableLabel {
114
+ static readonly DEFAULT_FEATURES = [
115
+ deletableFeature,
116
+ selectFeature,
117
+ boundsFeature,
118
+ moveFeature,
119
+ layoutContainerFeature,
120
+ fadeFeature,
121
+ hoverFeedbackFeature,
122
+ popupFeature,
123
+ nameFeature,
124
+ withEditLabelFeature
125
+ ];
126
+
127
+ name = '';
128
+
129
+ get editableLabel(): (SChildElement & EditableLabel) | undefined {
130
+ const label = this.children.find(element => element.type === 'label:heading');
131
+ if (label && isEditableLabel(label)) {
132
+ return label;
133
+ }
134
+ return undefined;
135
+ }
136
+ }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2019 EclipseSource and others.
2
+ * Copyright (c) 2019-2021 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
@@ -15,30 +15,37 @@
15
15
  ********************************************************************************/
16
16
  import {
17
17
  angleOfPoint,
18
- GEdgeView,
19
18
  IView,
20
19
  Point,
20
+ PolylineEdgeViewWithGapsOnIntersections,
21
21
  RenderingContext,
22
22
  SEdge,
23
23
  toDegrees
24
24
  } from '@eclipse-glsp/client';
25
25
  import { injectable } from 'inversify';
26
- import * as snabbdom from 'snabbdom-jsx';
27
- import { VNode } from 'snabbdom/vnode';
28
-
26
+ import { VNode } from 'snabbdom';
27
+ import { svg } from 'sprotty';
29
28
  import { Icon } from './model';
30
29
 
31
30
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
- const JSX = { createElement: snabbdom.svg };
31
+ const JSX = { createElement: svg };
33
32
 
34
33
  @injectable()
35
- export class WorkflowEdgeView extends GEdgeView {
34
+ export class WorkflowEdgeView extends PolylineEdgeViewWithGapsOnIntersections {
36
35
  protected renderAdditionals(edge: SEdge, segments: Point[], context: RenderingContext): VNode[] {
37
36
  const additionals = super.renderAdditionals(edge, segments, context);
38
37
  const p1 = segments[segments.length - 2];
39
38
  const p2 = segments[segments.length - 1];
40
- const arrow = <path class-sprotty-edge={true} class-arrow={true} d='M 1.5,0 L 10,-4 L 10,4 Z'
41
- transform={`rotate(${toDegrees(angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${p2.y})`} />;
39
+ const arrow = (
40
+ <path
41
+ class-sprotty-edge={true}
42
+ class-arrow={true}
43
+ d='M 1.5,0 L 10,-4 L 10,4 Z'
44
+ transform={`rotate(${toDegrees(angleOfPoint({ x: p1.x - p2.x, y: p1.y - p2.y }))} ${p2.x} ${p2.y}) translate(${p2.x} ${
45
+ p2.y
46
+ })`}
47
+ />
48
+ );
42
49
  additionals.push(arrow);
43
50
  return additionals;
44
51
  }
@@ -48,13 +55,15 @@ export class WorkflowEdgeView extends GEdgeView {
48
55
  export class IconView implements IView {
49
56
  render(element: Icon, context: RenderingContext): VNode {
50
57
  const radius = this.getRadius();
51
- return <g>
52
- <circle class-sprotty-icon={true} r={radius} cx={radius} cy={radius}></circle>
53
- {context.renderChildren(element)}
54
- </g>;
58
+ return (
59
+ <g>
60
+ <circle class-sprotty-icon={true} r={radius} cx={radius + 2} cy={radius + 2}></circle>
61
+ {context.renderChildren(element)}
62
+ </g>
63
+ );
55
64
  }
56
65
 
57
66
  getRadius(): number {
58
- return 16;
67
+ return 14;
59
68
  }
60
69
  }