@@ -18,7 +18,7 @@ import { SavedDiagram } from "./save";
18
18
import { LabelType , LabelTypeRegistry } from "../labels/labelTypeRegistry" ;
19
19
import { LayoutModelAction } from "../autoLayout/command" ;
20
20
import { EditorMode , EditorModeController } from "../editorMode/editorModeController" ;
21
- import { ConstraintRegistry } from "../constraintMenu/constraintRegistry" ;
21
+ import { Constraint , ConstraintRegistry } from "../constraintMenu/constraintRegistry" ;
22
22
import { LoadingIndicator } from "../../common/loadingIndicator" ;
23
23
24
24
export interface LoadDiagramAction extends Action {
@@ -84,8 +84,8 @@ export class LoadDiagramCommand extends Command {
84
84
private newEditorMode : EditorMode | undefined ;
85
85
private oldFileName : string | undefined ;
86
86
private newFileName : string | undefined ;
87
- private oldConstrains : string | undefined ;
88
- private newConstrains : string | undefined ;
87
+ private oldConstrains : Constraint [ ] | undefined ;
88
+ private newConstrains : Constraint [ ] | undefined ;
89
89
90
90
/**
91
91
* Gets the model file from the action or opens a file picker dialog if no file is provided.
@@ -213,11 +213,11 @@ export class LoadDiagramCommand extends Command {
213
213
214
214
if ( this . constraintRegistry ) {
215
215
// Load label types
216
- this . oldConstrains = this . constraintRegistry . getConstraints ( ) ;
216
+ this . oldConstrains = this . constraintRegistry . getConstraintList ( ) ;
217
217
this . newConstrains = newDiagram ?. constraints ;
218
218
this . constraintRegistry . clearConstraints ( ) ;
219
219
if ( newDiagram ?. constraints ) {
220
- this . constraintRegistry . setConstraints ( newDiagram . constraints ) ;
220
+ this . constraintRegistry . setConstraintsFromArray ( newDiagram . constraints ) ;
221
221
222
222
this . logger . info ( this , "Constraints loaded successfully" ) ;
223
223
}
@@ -281,7 +281,7 @@ export class LoadDiagramCommand extends Command {
281
281
}
282
282
this . constraintRegistry ?. clearConstraints ( ) ;
283
283
if ( this . oldConstrains ) {
284
- this . constraintRegistry ?. setConstraints ( this . oldConstrains ) ;
284
+ this . constraintRegistry ?. setConstraintsFromArray ( this . oldConstrains ) ;
285
285
}
286
286
setFileNameInPageTitle ( this . oldFileName ) ;
287
287
@@ -302,7 +302,7 @@ export class LoadDiagramCommand extends Command {
302
302
}
303
303
this . constraintRegistry ?. clearConstraints ( ) ;
304
304
if ( this . newConstrains ) {
305
- this . constraintRegistry ?. setConstraints ( this . newConstrains ) ;
305
+ this . constraintRegistry ?. setConstraintsFromArray ( this . newConstrains ) ;
306
306
}
307
307
setFileNameInPageTitle ( this . newFileName ) ;
308
308
0 commit comments