|
1 | | -import { Command, CommandExecutionContext, CommandReturn, EMPTY_ROOT, ILogger, SModelRootImpl } from "sprotty"; |
| 1 | +import { ActionDispatcher, Command, CommandExecutionContext, CommandReturn, EMPTY_ROOT, ILogger, SModelRootImpl } from "sprotty"; |
2 | 2 | import { SavedDiagram } from "./SavedDiagram"; |
3 | 3 | import { Action, SModelElement, SModelRoot } from "sprotty-protocol"; |
4 | 4 | import { LabelTypeRegistry } from "../labels/LabelTypeRegistry"; |
5 | 5 | import { EditorModeController } from "../editorMode/EditorModeController"; |
6 | 6 | import { Constraint } from "../constraint/Constraint"; |
7 | 7 | import { EditorMode } from "../editorMode/EditorMode"; |
8 | 8 | import { LabelType } from "../labels/LabelType"; |
| 9 | +import { DefaultFitToScreenAction } from "../fitToScreen/action"; |
9 | 10 |
|
10 | 11 | export interface FileData<T> { |
11 | 12 | fileName: string; |
@@ -33,6 +34,7 @@ export abstract class LoadJsonCommand extends Command { |
33 | 34 | private readonly logger: ILogger, |
34 | 35 | private readonly labelTypeRegistry: LabelTypeRegistry, |
35 | 36 | private editorModeController: EditorModeController, |
| 37 | + private actionDispatcher: ActionDispatcher |
36 | 38 | ) { |
37 | 39 | super(); |
38 | 40 | } |
@@ -75,6 +77,7 @@ export abstract class LoadJsonCommand extends Command { |
75 | 77 | // TODO: load constraints |
76 | 78 |
|
77 | 79 | // TODO: post load actions like layout |
| 80 | + this.actionDispatcher.dispatch(DefaultFitToScreenAction.create(this.newRoot)) |
78 | 81 |
|
79 | 82 | // TODO: load file name |
80 | 83 | //this.oldFileName = currentFileName; |
|
0 commit comments