@@ -18,7 +18,7 @@ import { SavedDiagram } from "./save";
1818import { LabelType , LabelTypeRegistry } from "../labels/labelTypeRegistry" ;
1919import { LayoutModelAction } from "../autoLayout/command" ;
2020import { EditorMode , EditorModeController } from "../editorMode/editorModeController" ;
21- import { ConstraintRegistry } from "../constraintMenu/constraintRegistry" ;
21+ import { Constraint , ConstraintRegistry } from "../constraintMenu/constraintRegistry" ;
2222import { LoadingIndicator } from "../../common/loadingIndicator" ;
2323
2424export interface LoadDiagramAction extends Action {
@@ -84,8 +84,8 @@ export class LoadDiagramCommand extends Command {
8484 private newEditorMode : EditorMode | undefined ;
8585 private oldFileName : string | undefined ;
8686 private newFileName : string | undefined ;
87- private oldConstrains : string | undefined ;
88- private newConstrains : string | undefined ;
87+ private oldConstrains : Constraint [ ] | undefined ;
88+ private newConstrains : Constraint [ ] | undefined ;
8989
9090 /**
9191 * 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 {
213213
214214 if ( this . constraintRegistry ) {
215215 // Load label types
216- this . oldConstrains = this . constraintRegistry . getConstraints ( ) ;
216+ this . oldConstrains = this . constraintRegistry . getConstraintList ( ) ;
217217 this . newConstrains = newDiagram ?. constraints ;
218218 this . constraintRegistry . clearConstraints ( ) ;
219219 if ( newDiagram ?. constraints ) {
220- this . constraintRegistry . setConstraints ( newDiagram . constraints ) ;
220+ this . constraintRegistry . setConstraintsFromArray ( newDiagram . constraints ) ;
221221
222222 this . logger . info ( this , "Constraints loaded successfully" ) ;
223223 }
@@ -281,7 +281,7 @@ export class LoadDiagramCommand extends Command {
281281 }
282282 this . constraintRegistry ?. clearConstraints ( ) ;
283283 if ( this . oldConstrains ) {
284- this . constraintRegistry ?. setConstraints ( this . oldConstrains ) ;
284+ this . constraintRegistry ?. setConstraintsFromArray ( this . oldConstrains ) ;
285285 }
286286 setFileNameInPageTitle ( this . oldFileName ) ;
287287
@@ -302,7 +302,7 @@ export class LoadDiagramCommand extends Command {
302302 }
303303 this . constraintRegistry ?. clearConstraints ( ) ;
304304 if ( this . newConstrains ) {
305- this . constraintRegistry ?. setConstraints ( this . newConstrains ) ;
305+ this . constraintRegistry ?. setConstraintsFromArray ( this . newConstrains ) ;
306306 }
307307 setFileNameInPageTitle ( this . newFileName ) ;
308308
0 commit comments