@eclipse-glsp/server 2.4.0-next.118 → 2.4.0-next.119
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/common/gmodel/change-bounds-operation-handler.d.ts +2 -1
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js +16 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +2 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +19 -5
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/operations/compound-operation-handler.js +1 -1
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
- package/lib/common/operations/operation-action-handler.js +2 -1
- package/lib/common/operations/operation-action-handler.js.map +1 -1
- package/package.json +3 -3
- package/src/common/gmodel/change-bounds-operation-handler.ts +19 -3
- package/src/common/gmodel/change-routing-points-operation-handler.ts +19 -6
- package/src/common/operations/compound-operation-handler.ts +1 -1
- package/src/common/operations/operation-action-handler.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeBoundsOperation, Dimension, MaybePromise, Point } from '@eclipse-glsp/protocol';
|
|
1
|
+
import { ChangeBoundsOperation, Dimension, ElementAndBounds, MaybePromise, Point } from '@eclipse-glsp/protocol';
|
|
2
2
|
import { Command } from '../command/command';
|
|
3
3
|
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
4
4
|
/**
|
|
@@ -7,6 +7,7 @@ import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
|
7
7
|
export declare class GModelChangeBoundsOperationHandler extends GModelOperationHandler {
|
|
8
8
|
operationType: string;
|
|
9
9
|
createCommand(operation: ChangeBoundsOperation): MaybePromise<Command | undefined>;
|
|
10
|
+
protected hasChanged(element: ElementAndBounds): boolean;
|
|
10
11
|
protected executeChangeBounds(operation: ChangeBoundsOperation): void;
|
|
11
12
|
protected changeElementBounds(elementId: string, newSize: Dimension, newPosition: Point | undefined): void;
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-bounds-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"change-bounds-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEjH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,qBACa,kCAAmC,SAAQ,sBAAsB;IAC1E,aAAa,SAA8B;IAE3C,aAAa,CAAC,SAAS,EAAE,qBAAqB,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAQlF,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;IAYxD,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,qBAAqB,GAAG,IAAI;IAMrE,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI;CAuB7G"}
|
|
@@ -35,7 +35,22 @@ let GModelChangeBoundsOperationHandler = class GModelChangeBoundsOperationHandle
|
|
|
35
35
|
this.operationType = protocol_1.ChangeBoundsOperation.KIND;
|
|
36
36
|
}
|
|
37
37
|
createCommand(operation) {
|
|
38
|
-
|
|
38
|
+
const newBounds = operation.newBounds.filter(element => this.hasChanged(element));
|
|
39
|
+
if (newBounds.length === 0) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
return this.commandOf(() => this.executeChangeBounds({ ...operation, newBounds }));
|
|
43
|
+
}
|
|
44
|
+
hasChanged(element) {
|
|
45
|
+
const knownElement = this.modelState.index.find(element.elementId);
|
|
46
|
+
if (!knownElement || !(0, graph_1.isGBoundsAware)(knownElement)) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const sizeChanged = knownElement.size ? !protocol_1.Dimension.equals(knownElement.size, element.newSize) : true;
|
|
50
|
+
if (sizeChanged) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return knownElement.position && element.newPosition ? !protocol_1.Point.equals(knownElement.position, element.newPosition) : true;
|
|
39
54
|
}
|
|
40
55
|
executeChangeBounds(operation) {
|
|
41
56
|
for (const element of operation.newBounds) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-bounds-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+
|
|
1
|
+
{"version":3,"file":"change-bounds-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-bounds-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+CAAwE;AACxE,qDAAiH;AACjH,yCAAuC;AAEvC,yEAAoE;AAEpE;;GAEG;AAEI,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,iDAAsB;IAAvE;;QACH,kBAAa,GAAG,gCAAqB,CAAC,IAAI,CAAC;IAmD/C,CAAC;IAjDG,aAAa,CAAC,SAAgC;QAC1C,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,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-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { ChangeRoutingPointsOperation, MaybePromise } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { ChangeRoutingPointsOperation, ElementAndRoutingPoints, MaybePromise } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { Command } from '../command/command';
|
|
18
18
|
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
19
19
|
export declare class GModelChangeRoutingPointsOperationHandler extends GModelOperationHandler {
|
|
20
20
|
operationType: string;
|
|
21
21
|
createCommand(operation: ChangeRoutingPointsOperation): MaybePromise<Command | undefined>;
|
|
22
|
+
protected hasChanged(element: ElementAndRoutingPoints): boolean;
|
|
22
23
|
executeChangeRoutingPoints(operation: ChangeRoutingPointsOperation): MaybePromise<void>;
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=change-routing-points-operation-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-routing-points-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"change-routing-points-operation-handler.d.ts","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,YAAY,EAAS,MAAM,wBAAwB,CAAC;AAEpH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,qBACa,yCAA0C,SAAQ,sBAAsB;IACjF,aAAa,SAAqC;IAElD,aAAa,CAAC,SAAS,EAAE,4BAA4B,GAAG,YAAY,CAAC,OAAO,GAAG,SAAS,CAAC;IAQzF,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO;IAa/D,0BAA0B,CAAC,SAAS,EAAE,4BAA4B,GAAG,YAAY,CAAC,IAAI,CAAC;CAI1F"}
|
|
@@ -22,9 +22,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.GModelChangeRoutingPointsOperationHandler = void 0;
|
|
25
|
+
const graph_1 = require("@eclipse-glsp/graph");
|
|
25
26
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
26
27
|
const inversify_1 = require("inversify");
|
|
27
|
-
const glsp_server_error_1 = require("../utils/glsp-server-error");
|
|
28
28
|
const layout_util_1 = require("../utils/layout-util");
|
|
29
29
|
const gmodel_operation_handler_1 = require("./gmodel-operation-handler");
|
|
30
30
|
let GModelChangeRoutingPointsOperationHandler = class GModelChangeRoutingPointsOperationHandler extends gmodel_operation_handler_1.GModelOperationHandler {
|
|
@@ -33,12 +33,26 @@ let GModelChangeRoutingPointsOperationHandler = class GModelChangeRoutingPointsO
|
|
|
33
33
|
this.operationType = protocol_1.ChangeRoutingPointsOperation.KIND;
|
|
34
34
|
}
|
|
35
35
|
createCommand(operation) {
|
|
36
|
-
|
|
36
|
+
const newRoutingPoints = operation.newRoutingPoints.filter(newRoutingPoints => this.hasChanged(newRoutingPoints));
|
|
37
|
+
if (newRoutingPoints.length === 0) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return this.commandOf(() => this.executeChangeRoutingPoints({ ...operation, newRoutingPoints }));
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
hasChanged(element) {
|
|
43
|
+
var _a;
|
|
44
|
+
const knownElement = this.modelState.index.findByClass(element.elementId, graph_1.GEdge);
|
|
45
|
+
if (!knownElement || knownElement.routingPoints.length !== ((_a = element.newRoutingPoints) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
for (let i = 0; i < knownElement.routingPoints.length; i++) {
|
|
49
|
+
if (!protocol_1.Point.equals(knownElement.routingPoints[i], element.newRoutingPoints[i])) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
41
52
|
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
executeChangeRoutingPoints(operation) {
|
|
42
56
|
const index = this.modelState.index;
|
|
43
57
|
operation.newRoutingPoints.forEach(routingPoints => (0, layout_util_1.applyRoutingPoints)(routingPoints, index));
|
|
44
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-routing-points-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"change-routing-points-operation-handler.js","sourceRoot":"","sources":["../../../src/common/gmodel/change-routing-points-operation-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,+CAA4C;AAC5C,qDAAoH;AACpH,yCAAuC;AAEvC,sDAA0D;AAC1D,yEAAoE;AAG7D,IAAM,yCAAyC,GAA/C,MAAM,yCAA0C,SAAQ,iDAAsB;IAA9E;;QACH,kBAAa,GAAG,uCAA4B,CAAC,IAAI,CAAC;IA2BtD,CAAC;IAzBG,aAAa,CAAC,SAAuC;QACjD,MAAM,gBAAgB,GAAG,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAClH,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,0BAA0B,CAAC,EAAE,GAAG,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACrG,CAAC;IAES,UAAU,CAAC,OAAgC;;QACjD,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,aAAK,CAAC,CAAC;QACjF,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,aAAa,CAAC,MAAM,MAAK,MAAA,OAAO,CAAC,gBAAgB,0CAAE,MAAM,CAAA,EAAE,CAAC;YAC1F,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzD,IAAI,CAAC,gBAAK,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5E,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,0BAA0B,CAAC,SAAuC;QAC9D,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACpC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,IAAA,gCAAkB,EAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;IAClG,CAAC;CACJ,CAAA;AA5BY,8FAAyC;oDAAzC,yCAAyC;IADrD,IAAA,sBAAU,GAAE;GACA,yCAAyC,CA4BrD"}
|
|
@@ -48,7 +48,7 @@ let CompoundOperationHandler = class CompoundOperationHandler extends operation_
|
|
|
48
48
|
commands.push(command);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
return new command_1.CompoundCommand(commands);
|
|
51
|
+
return commands.length > 0 ? new command_1.CompoundCommand(commands) : undefined;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
exports.CompoundOperationHandler = CompoundOperationHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compound-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA2D;AAC3D,yCAA+C;AAC/C,gDAA8D;AAC9D,2DAAuD;AACvD,6EAAwE;AAExE;;;;GAIG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAgB;IAAvD;;QAIH,kBAAa,GAAG,4BAAiB,CAAC,IAAI,CAAC;IAa3C,CAAC;IAXG,KAAK,CAAC,aAAa,CAAC,SAA4B;QAC5C,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,EAAE,CAAC,0CAAE,OAAO,CAAC,EAAE,CAAC,CAAA,EAAA,CAAC,CAAC;QAC5H,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;YACxC,IAAI,OAAO,EAAE,CAAC;gBACV,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACL,CAAC;QACD,OAAO,IAAI,yBAAe,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"compound-operation-handler.js","sourceRoot":"","sources":["../../../src/common/operations/compound-operation-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA2D;AAC3D,yCAA+C;AAC/C,gDAA8D;AAC9D,2DAAuD;AACvD,6EAAwE;AAExE;;;;GAIG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAgB;IAAvD;;QAIH,kBAAa,GAAG,4BAAiB,CAAC,IAAI,CAAC;IAa3C,CAAC;IAXG,KAAK,CAAC,aAAa,CAAC,SAA4B;QAC5C,MAAM,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,EAAE,CAAC,0CAAE,OAAO,CAAC,EAAE,CAAC,CAAA,EAAA,CAAC,CAAC;QAC5H,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;YACxC,IAAI,OAAO,EAAE,CAAC;gBACV,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,CAAC;CACJ,CAAA;AAjBY,4DAAwB;AAEvB;IADT,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BACG,qDAAwB;0EAAC;mCAFpD,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAiBpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-action-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/operation-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAiB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,qBACa,sBAAuB,YAAW,aAAa;IAaxB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAX9D,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAG7D,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGzD,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAGjC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;gBAEI,WAAW,EAAE,MAAM,EAAE;IAE9D,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAclD,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;cAQxD,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"operation-action-handler.d.ts","sourceRoot":"","sources":["../../../src/common/operations/operation-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAiB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,qBACa,sBAAuB,YAAW,aAAa;IAaxB,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAX9D,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAG7D,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IAGzD,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC;IAGjC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;gBAEI,WAAW,EAAE,MAAM,EAAE;IAE9D,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;IAclD,SAAS,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;cAQxD,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;cASlF,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,SAAS,CAAC,WAAW,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;IAI/C,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IAEH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,wBAAwB,GAAG,gBAAgB,GAAG,SAAS;CAGrH"}
|
|
@@ -65,8 +65,9 @@ let OperationActionHandler = OperationActionHandler_1 = class OperationActionHan
|
|
|
65
65
|
const command = await handler.execute(operation);
|
|
66
66
|
if (command) {
|
|
67
67
|
await this.executeCommand(command);
|
|
68
|
+
return this.submitModel();
|
|
68
69
|
}
|
|
69
|
-
return
|
|
70
|
+
return [];
|
|
70
71
|
}
|
|
71
72
|
async executeCommand(command) {
|
|
72
73
|
return this.commandStack.execute(command);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-action-handler.js","sourceRoot":"","sources":["../../../src/common/operations/oper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|
|
1
|
+
{"version":3,"file":"operation-action-handler.js","sourceRoot":"","sources":["../../../src/common/operations/operation-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAwF;AACxF,yCAA+C;AAG/C,4DAAwD;AACxD,mEAAuD;AACvD,+DAA2D;AAC3D,yFAAoF;AACpF,kEAA6D;AAE7D,6EAAwE;AAGjE,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAa/B,YAAyC,WAAqB;QAArB,gBAAW,GAAX,WAAW,CAAU;IAAG,CAAC;IAElE,OAAO,CAAC,MAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,mCAAe,CAAC,6BAA6B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;YAC7B,OAAO;gBACH,wBAAa,CAAC,MAAM,CAAC,4DAA4D,MAAM,CAAC,IAAI,EAAE,EAAE;oBAC5F,QAAQ,EAAE,SAAS;iBACtB,CAAC;aACL,CAAC;QACN,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;IAES,gBAAgB,CAAC,SAAoB;QAC3C,MAAM,gBAAgB,GAAG,wBAAsB,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC9G,IAAI,gBAAgB,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,SAAoB,EAAE,OAAyB;QAC1E,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,OAAO,EAAE,CAAC;YACV,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9B,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,KAAK,CAAC,cAAc,CAAC,OAAgB;QAC3C,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAES,WAAW;QACjB,OAAO,IAAI,CAAC,sBAAsB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,CAAC,MAAc;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IAEH,MAAM,CAAC,mBAAmB,CAAC,SAAoB,EAAE,QAAkC;QAC/E,OAAO,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACJ,CAAA;AAjEY,wDAAsB;AAErB;IADT,IAAA,kBAAM,EAAC,qDAAwB,CAAC;8BACG,qDAAwB;wEAAC;AAGnD;IADT,IAAA,kBAAM,EAAC,iDAAsB,CAAC;8BACG,iDAAsB;sEAAC;AAG/C;IADT,IAAA,kBAAM,EAAC,wBAAU,CAAC;;0DACc;AAGvB;IADT,IAAA,kBAAM,EAAC,4BAAY,CAAC;;4DACgB;iCAX5B,sBAAsB;IADlC,IAAA,sBAAU,GAAE;IAcI,WAAA,IAAA,kBAAM,EAAC,gCAAU,CAAC,CAAA;;GAbtB,sBAAsB,CAiElC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "2.4.0-next.
|
|
3
|
+
"version": "2.4.0-next.119+86e89a1",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"watch": "tsc -w"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@eclipse-glsp/graph": "2.4.0-next.
|
|
61
|
+
"@eclipse-glsp/graph": "2.4.0-next.119+86e89a1",
|
|
62
62
|
"@eclipse-glsp/protocol": "next",
|
|
63
63
|
"@types/uuid": "8.3.1",
|
|
64
64
|
"commander": "^8.3.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "86e89a196104c33a8121ecbb17390c0e3520a9bd"
|
|
82
82
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { GModelRoot, GNode } from '@eclipse-glsp/graph';
|
|
17
|
-
import { ChangeBoundsOperation, Dimension, MaybePromise, Point } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { GModelRoot, GNode, isGBoundsAware } from '@eclipse-glsp/graph';
|
|
17
|
+
import { ChangeBoundsOperation, Dimension, ElementAndBounds, MaybePromise, Point } from '@eclipse-glsp/protocol';
|
|
18
18
|
import { injectable } from 'inversify';
|
|
19
19
|
import { Command } from '../command/command';
|
|
20
20
|
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
@@ -27,7 +27,23 @@ export class GModelChangeBoundsOperationHandler extends GModelOperationHandler {
|
|
|
27
27
|
operationType = ChangeBoundsOperation.KIND;
|
|
28
28
|
|
|
29
29
|
createCommand(operation: ChangeBoundsOperation): MaybePromise<Command | undefined> {
|
|
30
|
-
|
|
30
|
+
const newBounds = operation.newBounds.filter(element => this.hasChanged(element));
|
|
31
|
+
if (newBounds.length === 0) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
return this.commandOf(() => this.executeChangeBounds({ ...operation, newBounds }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected hasChanged(element: ElementAndBounds): boolean {
|
|
38
|
+
const knownElement = this.modelState.index.find(element.elementId);
|
|
39
|
+
if (!knownElement || !isGBoundsAware(knownElement)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
const sizeChanged = knownElement.size ? !Dimension.equals(knownElement.size, element.newSize) : true;
|
|
43
|
+
if (sizeChanged) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return knownElement.position && element.newPosition ? !Point.equals(knownElement.position, element.newPosition) : true;
|
|
31
47
|
}
|
|
32
48
|
|
|
33
49
|
protected executeChangeBounds(operation: ChangeBoundsOperation): void {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { GEdge } from '@eclipse-glsp/graph';
|
|
18
|
+
import { ChangeRoutingPointsOperation, ElementAndRoutingPoints, MaybePromise, Point } from '@eclipse-glsp/protocol';
|
|
18
19
|
import { injectable } from 'inversify';
|
|
19
20
|
import { Command } from '../command/command';
|
|
20
|
-
import { GLSPServerError } from '../utils/glsp-server-error';
|
|
21
21
|
import { applyRoutingPoints } from '../utils/layout-util';
|
|
22
22
|
import { GModelOperationHandler } from './gmodel-operation-handler';
|
|
23
23
|
|
|
@@ -26,14 +26,27 @@ export class GModelChangeRoutingPointsOperationHandler extends GModelOperationHa
|
|
|
26
26
|
operationType = ChangeRoutingPointsOperation.KIND;
|
|
27
27
|
|
|
28
28
|
createCommand(operation: ChangeRoutingPointsOperation): MaybePromise<Command | undefined> {
|
|
29
|
-
|
|
29
|
+
const newRoutingPoints = operation.newRoutingPoints.filter(newRoutingPoints => this.hasChanged(newRoutingPoints));
|
|
30
|
+
if (newRoutingPoints.length === 0) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return this.commandOf(() => this.executeChangeRoutingPoints({ ...operation, newRoutingPoints }));
|
|
30
34
|
}
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
protected hasChanged(element: ElementAndRoutingPoints): boolean {
|
|
37
|
+
const knownElement = this.modelState.index.findByClass(element.elementId, GEdge);
|
|
38
|
+
if (!knownElement || knownElement.routingPoints.length !== element.newRoutingPoints?.length) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
for (let i = 0; i < knownElement.routingPoints.length; i++) {
|
|
42
|
+
if (!Point.equals(knownElement.routingPoints[i], element.newRoutingPoints[i])) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
35
45
|
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
36
48
|
|
|
49
|
+
executeChangeRoutingPoints(operation: ChangeRoutingPointsOperation): MaybePromise<void> {
|
|
37
50
|
const index = this.modelState.index;
|
|
38
51
|
operation.newRoutingPoints.forEach(routingPoints => applyRoutingPoints(routingPoints, index));
|
|
39
52
|
}
|
|
@@ -67,8 +67,9 @@ export class OperationActionHandler implements ActionHandler {
|
|
|
67
67
|
const command = await handler.execute(operation);
|
|
68
68
|
if (command) {
|
|
69
69
|
await this.executeCommand(command);
|
|
70
|
+
return this.submitModel();
|
|
70
71
|
}
|
|
71
|
-
return
|
|
72
|
+
return [];
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
protected async executeCommand(command: Command): Promise<void> {
|