-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Theia to 1.43.1 and GLSP to 2.0.0 (#34)
Upgrade Theia to 1.43.1: - Use Node webpack configuration for Electron for smaller package - Adapt start script to use the new backend entry point Upgrade GLSP to 2.0.0: - Re-use Json-based command/operation API in GLSP server - Adapt to new diagram configuration in GLSP client - Remove unused CrossModelUpdateClientOperationHandler Bonus: Fix issue with wrong updates in model service and undo/redo
- Loading branch information
1 parent
ce0fa56
commit 021aa09
Showing
39 changed files
with
907 additions
and
887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 19 additions & 20 deletions
39
extensions/crossmodel-lang/src/glsp-server/handler/change-bounds-operation-handler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 CrossBreeze. | ||
********************************************************************************/ | ||
import { ChangeBoundsOperation, Command, OperationHandler } from '@eclipse-glsp/server'; | ||
import { ChangeBoundsOperation, Command, JsonOperationHandler, ModelState } from '@eclipse-glsp/server'; | ||
import { inject, injectable } from 'inversify'; | ||
import { CrossModelState } from '../model/cross-model-state'; | ||
import { CrossModelCommand } from './cross-model-command'; | ||
|
||
@injectable() | ||
export class CrossModelChangeBoundsOperationHandler extends OperationHandler { | ||
operationType = ChangeBoundsOperation.KIND; | ||
export class CrossModelChangeBoundsOperationHandler extends JsonOperationHandler { | ||
operationType = ChangeBoundsOperation.KIND; | ||
@inject(ModelState) protected override modelState: CrossModelState; | ||
|
||
@inject(CrossModelState) protected state: CrossModelState; | ||
createCommand(operation: ChangeBoundsOperation): Command { | ||
return new CrossModelCommand(this.modelState, () => this.changeBounds(operation)); | ||
} | ||
|
||
createCommand(operation: ChangeBoundsOperation): Command { | ||
return new CrossModelCommand(this.state, () => this.changeBounds(operation)); | ||
} | ||
|
||
protected changeBounds(operation: ChangeBoundsOperation): void { | ||
operation.newBounds.forEach(elementAndBounds => { | ||
const node = this.state.index.findDiagramNode(elementAndBounds.elementId); | ||
if (node) { | ||
// we store the given bounds directly in our diagram node | ||
node.x = elementAndBounds.newPosition?.x || node.x; | ||
node.y = elementAndBounds.newPosition?.y || node.y; | ||
node.width = elementAndBounds.newSize.width; | ||
node.height = elementAndBounds.newSize.height; | ||
} | ||
}); | ||
} | ||
protected changeBounds(operation: ChangeBoundsOperation): void { | ||
operation.newBounds.forEach(elementAndBounds => { | ||
const node = this.modelState.index.findDiagramNode(elementAndBounds.elementId); | ||
if (node) { | ||
// we store the given bounds directly in our diagram node | ||
node.x = elementAndBounds.newPosition?.x || node.x; | ||
node.y = elementAndBounds.newPosition?.y || node.y; | ||
node.width = elementAndBounds.newSize.width; | ||
node.height = elementAndBounds.newSize.height; | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.