@finos/legend-extension-dsl-diagram 1.0.28 → 1.0.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/lib/DiagramRenderer.d.ts +4 -1
  2. package/lib/DiagramRenderer.d.ts.map +1 -1
  3. package/lib/DiagramRenderer.js +59 -60
  4. package/lib/DiagramRenderer.js.map +1 -1
  5. package/lib/components/studio/ClassDiagramPreview.d.ts.map +1 -1
  6. package/lib/components/studio/ClassDiagramPreview.js +3 -1
  7. package/lib/components/studio/ClassDiagramPreview.js.map +1 -1
  8. package/lib/components/studio/DiagramEditor.d.ts.map +1 -1
  9. package/lib/components/studio/DiagramEditor.js +11 -7
  10. package/lib/components/studio/DiagramEditor.js.map +1 -1
  11. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts +2 -1
  12. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.d.ts.map +1 -1
  13. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js +11 -0
  14. package/lib/graphManager/DSLDiagram_PureGraphManagerPlugin.js.map +1 -1
  15. package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts +34 -0
  16. package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.d.ts.map +1 -0
  17. package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js +94 -0
  18. package/lib/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.js.map +1 -0
  19. package/lib/helpers/DiagramHelper.d.ts +16 -1
  20. package/lib/helpers/DiagramHelper.d.ts.map +1 -1
  21. package/lib/helpers/DiagramHelper.js +90 -3
  22. package/lib/helpers/DiagramHelper.js.map +1 -1
  23. package/lib/index.css +1 -1
  24. package/lib/index.d.ts +1 -1
  25. package/lib/index.d.ts.map +1 -1
  26. package/lib/index.js +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.d.ts.map +1 -1
  29. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js +0 -4
  30. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.js.map +1 -1
  31. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts +0 -3
  32. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.d.ts.map +1 -1
  33. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js +0 -20
  34. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.js.map +1 -1
  35. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts +0 -1
  36. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.d.ts.map +1 -1
  37. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.js +0 -9
  38. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.js.map +1 -1
  39. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.d.ts +0 -12
  40. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.d.ts.map +1 -1
  41. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js +1 -56
  42. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.js.map +1 -1
  43. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts +0 -3
  44. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.d.ts.map +1 -1
  45. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js +0 -7
  46. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.js.map +1 -1
  47. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts +0 -4
  48. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.d.ts.map +1 -1
  49. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js +0 -7
  50. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.js.map +1 -1
  51. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts +6 -3
  52. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.d.ts.map +1 -1
  53. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js +6 -14
  54. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.js.map +1 -1
  55. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts +24 -23
  56. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.d.ts.map +1 -1
  57. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js +57 -129
  58. package/lib/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.js.map +1 -1
  59. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.d.ts +0 -8
  60. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.d.ts.map +1 -1
  61. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js +0 -19
  62. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.js.map +1 -1
  63. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts +3 -3
  64. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.d.ts.map +1 -1
  65. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js +1 -1
  66. package/lib/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.js.map +1 -1
  67. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.d.ts.map +1 -1
  68. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js +3 -3
  69. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.js.map +1 -1
  70. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js +2 -2
  71. package/lib/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.js.map +1 -1
  72. package/lib/package.json +5 -5
  73. package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts +57 -0
  74. package/lib/stores/studio/DSLDiagram_GraphModifierHelper.d.ts.map +1 -0
  75. package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js +94 -0
  76. package/lib/stores/studio/DSLDiagram_GraphModifierHelper.js.map +1 -0
  77. package/lib/stores/studio/DiagramEditorState.d.ts.map +1 -1
  78. package/lib/stores/studio/DiagramEditorState.js +10 -7
  79. package/lib/stores/studio/DiagramEditorState.js.map +1 -1
  80. package/package.json +12 -12
  81. package/src/DiagramRenderer.ts +133 -68
  82. package/src/components/studio/ClassDiagramPreview.tsx +3 -1
  83. package/src/components/studio/DiagramEditor.tsx +17 -6
  84. package/src/graphManager/DSLDiagram_PureGraphManagerPlugin.ts +17 -0
  85. package/src/graphManager/action/changeDetection/DSLDiagram_ObserverHelper.ts +153 -0
  86. package/src/helpers/DiagramHelper.ts +126 -4
  87. package/src/index.ts +1 -4
  88. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView.ts +0 -6
  89. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView.ts +0 -23
  90. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassViewReference.ts +0 -12
  91. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_Diagram.ts +1 -64
  92. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView.ts +0 -11
  93. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView.ts +0 -17
  94. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipEdgeView.ts +6 -16
  95. package/src/models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView.ts +71 -169
  96. package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle.ts +0 -21
  97. package/src/models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Vector.ts +3 -3
  98. package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_GraphBuilderHelper.ts +6 -3
  99. package/src/models/protocols/pure/v1/transformation/pureGraph/V1_DSLDiagram_TransformerHelper.ts +4 -4
  100. package/src/stores/studio/DSLDiagram_GraphModifierHelper.ts +164 -0
  101. package/src/stores/studio/DiagramEditorState.ts +26 -7
  102. package/tsconfig.json +2 -0
@@ -21,7 +21,7 @@ import { PositionedRectangle } from './models/metamodels/pure/packageableElement
21
21
  import { ClassView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
22
22
  import type { PropertyHolderView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyHolderView';
23
23
  import { GeneralizationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
24
- import { type RelationshipView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
24
+ import { RelationshipView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
25
25
  export declare enum DIAGRAM_INTERACTION_MODE {
26
26
  LAYOUT = 0,
27
27
  PAN = 1,
@@ -219,6 +219,9 @@ export declare class DiagramRenderer {
219
219
  * This will bring it to front.
220
220
  */
221
221
  private reorderDiagramDomain;
222
+ /**
223
+ * Shift relationship views if both ends' classviews are moved.
224
+ */
222
225
  private potentiallyShiftRelationships;
223
226
  keydown(e: KeyboardEvent): void;
224
227
  mouseup(e: MouseEvent): void;
@@ -1 +1 @@
1
- {"version":3,"file":"DiagramRenderer.d.ts","sourceRoot":"","sources":["../src/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AI;IAKf,OAAO,CAAC,cAAc;IA0KtB,OAAO,CAAC,cAAc;IAyJtB,OAAO,CAAC,qBAAqB;IA0D7B,OAAO,CAAC,qBAAqB;IAU7B,gCAAgC,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAqE5D,OAAO,CAAC,aAAa;IAiLrB,OAAO,CAAC,mCAAmC;IA8C3C,OAAO,CAAC,oBAAoB;IAiH5B,OAAO,CAAC,yBAAyB;IAyFjC,OAAO,CAAC,eAAe;IAqIvB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAsBrC,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAkS/B,OAAO,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA0J5B,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAuElC,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA2O9B,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAO/B,SAAS,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAkW9B,kBAAkB,CAChB,UAAU,EAAE,SAAS,EAAE,EACvB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,GACtB,SAAS,EAAE,EAAE;IAoChB,cAAc,CACZ,eAAe,EAAE,SAAS,EAAE,EAAE,EAC9B,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,OAAO,EAC7B,SAAS,EAAE,OAAO,GACjB,CAAC,SAAS,EAAE,EAAE,kBAAkB,EAAE,CAAC;CAmGvC"}
@@ -21,11 +21,12 @@ import { Point } from './models/metamodels/pure/packageableElements/diagram/geom
21
21
  import { PositionedRectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_PositionedRectangle';
22
22
  import { ClassView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_ClassView';
23
23
  import { GeneralizationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_GeneralizationView';
24
- import { manageInsidePointsDynamically, } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
24
+ import { RelationshipView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_RelationshipView';
25
25
  import { PropertyView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_PropertyView';
26
26
  import { getElementPosition } from './helpers/DiagramHelper';
27
27
  import { AssociationView } from './models/metamodels/pure/packageableElements/diagram/DSLDiagram_AssociationView';
28
28
  import { class_addProperty, class_addSuperType } from '@finos/legend-studio';
29
+ import { classView_setHideProperties, classView_setHideStereotypes, classView_setHideTaggedValues, diagram_addClassView, diagram_addGeneralizationView, diagram_addPropertyView, diagram_deleteAssociationView, diagram_deleteClassView, diagram_deleteGeneralizationView, diagram_deletePropertyView, diagram_setAssociationViews, diagram_setClassViews, diagram_setGeneralizationViews, diagram_setPropertyViews, findOrBuildPoint, positionedRectangle_forceRefreshHash, positionedRectangle_setPosition, positionedRectangle_setRectangle, relationshipEdgeView_setOffsetX, relationshipEdgeView_setOffsetY, relationshipView_changePoint, relationshipView_simplifyPath, relationshipView_setPath, } from './stores/studio/DSLDiagram_GraphModifierHelper';
29
30
  export var DIAGRAM_INTERACTION_MODE;
30
31
  (function (DIAGRAM_INTERACTION_MODE) {
31
32
  DIAGRAM_INTERACTION_MODE[DIAGRAM_INTERACTION_MODE["LAYOUT"] = 0] = "LAYOUT";
@@ -431,7 +432,7 @@ export class DiagramRenderer {
431
432
  // has already had the target class as its supertype
432
433
  if (startClassView.class.value.generalizations.find((generalization) => generalization.value.rawType === targetClassView.class.value)) {
433
434
  const gview = new GeneralizationView(this.diagram, startClassView, targetClassView);
434
- this.diagram.addGeneralizationView(gview);
435
+ diagram_addGeneralizationView(this.diagram, gview);
435
436
  return gview;
436
437
  }
437
438
  return undefined;
@@ -447,7 +448,7 @@ export class DiagramRenderer {
447
448
  // is not targetable
448
449
  if (startClassView !== targetClassView) {
449
450
  const pView = new PropertyView(this.diagram, PropertyExplicitReference.create(property), startClassView, targetClassView);
450
- this.diagram.addPropertyView(pView);
451
+ diagram_addPropertyView(this.diagram, pView);
451
452
  return pView;
452
453
  }
453
454
  return undefined;
@@ -506,8 +507,7 @@ export class DiagramRenderer {
506
507
  .concat(this.diagram.generalizationViews)
507
508
  .concat(this.diagram.propertyViews);
508
509
  for (const relationshipView of relationshipViews) {
509
- let fullPath = relationshipView.buildFullPath();
510
- fullPath = manageInsidePointsDynamically(fullPath, relationshipView.from.classView.value, relationshipView.to.classView.value);
510
+ const fullPath = RelationshipView.pruneUnnecessaryInsidePoints(relationshipView.buildFullPath(), relationshipView.from.classView.value, relationshipView.to.classView.value);
511
511
  if (relationshipView instanceof PropertyView) {
512
512
  const box = this.drawLinePropertyText(
513
513
  // NOTE: by the way we compute the full path, it would guarantee
@@ -596,14 +596,14 @@ export class DiagramRenderer {
596
596
  id = uuid();
597
597
  }
598
598
  const newClassView = new ClassView(this.diagram, id, PackageableElementExplicitReference.create(addedClass));
599
- newClassView.setPosition(classViewModelCoordinate ??
599
+ positionedRectangle_setPosition(newClassView, classViewModelCoordinate ??
600
600
  this.canvasCoordinateToModelCoordinate(new Point(this.virtualScreen.position.x +
601
601
  this.virtualScreen.rectangle.width / 2, this.virtualScreen.position.y +
602
602
  this.virtualScreen.rectangle.height / 2)));
603
- this.diagram.addClassView(newClassView);
603
+ diagram_addClassView(this.diagram, newClassView);
604
604
  // Refresh hash since ClassView position is not observable
605
605
  // NOTE: here we refresh after adding the class view to the diagram, that way the diagram hash is refreshed
606
- newClassView.forceRefreshHash();
606
+ positionedRectangle_forceRefreshHash(newClassView);
607
607
  this.diagram.classViews
608
608
  .filter((classView) => classView.class.value !== addedClass)
609
609
  .forEach((classView) => {
@@ -612,22 +612,22 @@ export class DiagramRenderer {
612
612
  if (addedClass.generalizations
613
613
  .map((generalization) => generalization.value.rawType)
614
614
  .includes(_class)) {
615
- this.diagram.addGeneralizationView(new GeneralizationView(this.diagram, newClassView, classView));
615
+ diagram_addGeneralizationView(this.diagram, new GeneralizationView(this.diagram, newClassView, classView));
616
616
  }
617
617
  if (_class.generalizations
618
618
  .map((generalization) => generalization.value.rawType)
619
619
  .includes(addedClass)) {
620
- this.diagram.addGeneralizationView(new GeneralizationView(this.diagram, classView, newClassView));
620
+ diagram_addGeneralizationView(this.diagram, new GeneralizationView(this.diagram, classView, newClassView));
621
621
  }
622
622
  // Add property view
623
623
  addedClass.getAllOwnedProperties().forEach((property) => {
624
624
  if (property.genericType.value.rawType === _class) {
625
- this.diagram.addPropertyView(new PropertyView(this.diagram, PropertyExplicitReference.create(property), newClassView, classView));
625
+ diagram_addPropertyView(this.diagram, new PropertyView(this.diagram, PropertyExplicitReference.create(property), newClassView, classView));
626
626
  }
627
627
  });
628
628
  _class.getAllOwnedProperties().forEach((property) => {
629
629
  if (property.genericType.value.rawType === addedClass) {
630
- this.diagram.addPropertyView(new PropertyView(this.diagram, PropertyExplicitReference.create(property), classView, newClassView));
630
+ diagram_addPropertyView(this.diagram, new PropertyView(this.diagram, PropertyExplicitReference.create(property), classView, newClassView));
631
631
  }
632
632
  });
633
633
  });
@@ -941,7 +941,7 @@ export class DiagramRenderer {
941
941
  classView.rectangle.height > classMinHeight
942
942
  ? classView.rectangle.height
943
943
  : classMinHeight;
944
- classView.setRectangle(new Rectangle(width, height));
944
+ positionedRectangle_setRectangle(classView, new Rectangle(width, height));
945
945
  }
946
946
  }
947
947
  drawClassView(classView) {
@@ -1072,7 +1072,7 @@ export class DiagramRenderer {
1072
1072
  // NOTE: force hash reload when we redraw class view; this would help with cases where
1073
1073
  // we auto add new properties to the class view, causing the box to expand, hence we need
1074
1074
  // to recompute hash
1075
- classView.forceRefreshHash();
1075
+ positionedRectangle_forceRefreshHash(classView);
1076
1076
  }
1077
1077
  drawLinePropertyNameAndMultiplicity(property, textPositionX, textPositionY, multiplicityPositionX, multiplicityPositionY, measureOnly) {
1078
1078
  this.ctx.font = `${this.fontSize}px ${this.fontFamily}`;
@@ -1157,8 +1157,7 @@ export class DiagramRenderer {
1157
1157
  return new PositionedRectangle(new Point(0, 0), new Rectangle(0, 0));
1158
1158
  }
1159
1159
  drawPropertyOrAssociation(propertyView) {
1160
- let fullPath = propertyView.buildFullPath();
1161
- fullPath = manageInsidePointsDynamically(fullPath, propertyView.from.classView.value, propertyView.to.classView.value);
1160
+ const fullPath = RelationshipView.pruneUnnecessaryInsidePoints(propertyView.buildFullPath(), propertyView.from.classView.value, propertyView.to.classView.value);
1162
1161
  // const toProperty = asso instanceof.property ? asso.property : asso.association.properties[1];
1163
1162
  const toProperty = propertyView.property.value;
1164
1163
  this.drawLinePropertyText(
@@ -1239,8 +1238,7 @@ export class DiagramRenderer {
1239
1238
  }
1240
1239
  drawInheritance(inheritance) {
1241
1240
  const rect = inheritance.to.classView.value.rectangle;
1242
- let fullPath = inheritance.buildFullPath();
1243
- fullPath = manageInsidePointsDynamically(fullPath, inheritance.from.classView.value, inheritance.to.classView.value);
1241
+ const fullPath = RelationshipView.pruneUnnecessaryInsidePoints(inheritance.buildFullPath(), inheritance.from.classView.value, inheritance.to.classView.value);
1244
1242
  // NOTE: by the way we compute the full path, it would guarantee
1245
1243
  // to always have at least 2 points
1246
1244
  const startX = fullPath[fullPath.length - 2].x;
@@ -1354,12 +1352,14 @@ export class DiagramRenderer {
1354
1352
  newClasses.push(firstClass);
1355
1353
  return newClasses;
1356
1354
  }
1357
- // TODO: add doc
1358
- potentiallyShiftRelationships(assoViews, selectedClasses, newMovingDeltaX, newMovingDeltaY) {
1359
- assoViews.forEach((assoView) => {
1360
- if (selectedClasses.indexOf(assoView.from.classView.value) !== -1 &&
1361
- selectedClasses.indexOf(assoView.to.classView.value) !== -1) {
1362
- assoView.setPath(assoView.path.map((point) => new Point(point.x - newMovingDeltaX, point.y - newMovingDeltaY)));
1355
+ /**
1356
+ * Shift relationship views if both ends' classviews are moved.
1357
+ */
1358
+ potentiallyShiftRelationships(relationshipViews, selectedClasses, newMovingDeltaX, newMovingDeltaY) {
1359
+ relationshipViews.forEach((view) => {
1360
+ if (selectedClasses.indexOf(view.from.classView.value) !== -1 &&
1361
+ selectedClasses.indexOf(view.to.classView.value) !== -1) {
1362
+ relationshipView_setPath(view, view.path.map((point) => new Point(point.x - newMovingDeltaX, point.y - newMovingDeltaY)));
1363
1363
  }
1364
1364
  });
1365
1365
  }
@@ -1368,23 +1368,23 @@ export class DiagramRenderer {
1368
1368
  if ('Delete' === e.key) {
1369
1369
  if (!this.isReadOnly) {
1370
1370
  this.selectedClasses.forEach((classView) => {
1371
- this.diagram.deleteClassView(classView);
1372
- this.diagram.setAssociationViews(this.diagram.associationViews.filter((associationView) => !(associationView.from.classView.value === classView ||
1371
+ diagram_deleteClassView(this.diagram, classView);
1372
+ diagram_setAssociationViews(this.diagram, this.diagram.associationViews.filter((associationView) => !(associationView.from.classView.value === classView ||
1373
1373
  associationView.to.classView.value === classView)));
1374
- this.diagram.setGeneralizationViews(this.diagram.generalizationViews.filter((generalizationView) => !(generalizationView.from.classView.value === classView ||
1374
+ diagram_setGeneralizationViews(this.diagram, this.diagram.generalizationViews.filter((generalizationView) => !(generalizationView.from.classView.value === classView ||
1375
1375
  generalizationView.to.classView.value === classView)));
1376
- this.diagram.setPropertyViews(this.diagram.propertyViews.filter((propertyView) => !(propertyView.from.classView.value === classView ||
1376
+ diagram_setPropertyViews(this.diagram, this.diagram.propertyViews.filter((propertyView) => !(propertyView.from.classView.value === classView ||
1377
1377
  propertyView.to.classView.value === classView)));
1378
1378
  });
1379
1379
  if (this.selectedPropertyOrAssociation instanceof AssociationView) {
1380
- this.diagram.deleteAssociationView(this.selectedPropertyOrAssociation);
1380
+ diagram_deleteAssociationView(this.diagram, this.selectedPropertyOrAssociation);
1381
1381
  }
1382
1382
  else if (this.selectedPropertyOrAssociation instanceof PropertyView) {
1383
- this.diagram.deletePropertyView(this.selectedPropertyOrAssociation);
1383
+ diagram_deletePropertyView(this.diagram, this.selectedPropertyOrAssociation);
1384
1384
  }
1385
1385
  if (this.selectedInheritance) {
1386
1386
  if (this.diagram.generalizationViews.find((generalizationView) => generalizationView === this.selectedInheritance)) {
1387
- this.diagram.deleteGeneralizationView(this.selectedInheritance);
1387
+ diagram_deleteGeneralizationView(this.diagram, this.selectedInheritance);
1388
1388
  }
1389
1389
  }
1390
1390
  this.selectedClasses = [];
@@ -1462,7 +1462,7 @@ export class DiagramRenderer {
1462
1462
  if (!this.isReadOnly) {
1463
1463
  if (this.selectedClasses.length !== 0) {
1464
1464
  this.selectedClasses.forEach((classView) => {
1465
- classView.setHideProperties(!classView.hideProperties);
1465
+ classView_setHideProperties(classView, !classView.hideProperties);
1466
1466
  });
1467
1467
  this.drawScreen();
1468
1468
  }
@@ -1473,7 +1473,7 @@ export class DiagramRenderer {
1473
1473
  if (!this.isReadOnly) {
1474
1474
  if (this.selectedClasses.length !== 0) {
1475
1475
  this.selectedClasses.forEach((classView) => {
1476
- classView.setHideStereotypes(!classView.hideStereotypes);
1476
+ classView_setHideStereotypes(classView, !classView.hideStereotypes);
1477
1477
  });
1478
1478
  this.drawScreen();
1479
1479
  }
@@ -1484,7 +1484,7 @@ export class DiagramRenderer {
1484
1484
  if (!this.isReadOnly) {
1485
1485
  if (this.selectedClasses.length !== 0) {
1486
1486
  this.selectedClasses.forEach((classView) => {
1487
- classView.setHideTaggedValues(!classView.hideTaggedValues);
1487
+ classView_setHideTaggedValues(classView, !classView.hideTaggedValues);
1488
1488
  });
1489
1489
  this.drawScreen();
1490
1490
  }
@@ -1518,8 +1518,8 @@ export class DiagramRenderer {
1518
1518
  else if ('ArrowUp' === e.key) {
1519
1519
  const views = this.getSuperTypeLevels(this.selectedClasses, this.diagram, 0, 1);
1520
1520
  const res = this.layoutTaxonomy(views, this.diagram, false, true);
1521
- res[0].forEach((cv) => this.diagram.addClassView(cv));
1522
- res[1].forEach((gv) => this.diagram.addGeneralizationView(gv));
1521
+ res[0].forEach((cv) => diagram_addClassView(this.diagram, cv));
1522
+ res[1].forEach((gv) => diagram_addGeneralizationView(this.diagram, gv));
1523
1523
  this.drawScreen();
1524
1524
  }
1525
1525
  // Add subtypes of selected classes to the diagram
@@ -1528,8 +1528,8 @@ export class DiagramRenderer {
1528
1528
  if (views.length > 0) {
1529
1529
  views.forEach((classView) => this.ensureClassViewMeetMinDimensions(classView));
1530
1530
  const res = this.layoutTaxonomy([views, this.selectedClasses], this.diagram, false, false);
1531
- res[0].forEach((cv) => this.diagram.addClassView(cv));
1532
- res[1].forEach((gv) => this.diagram.addGeneralizationView(gv));
1531
+ res[0].forEach((cv) => diagram_addClassView(this.diagram, cv));
1532
+ res[1].forEach((gv) => diagram_addGeneralizationView(this.diagram, gv));
1533
1533
  }
1534
1534
  this.drawScreen();
1535
1535
  }
@@ -1538,9 +1538,9 @@ export class DiagramRenderer {
1538
1538
  if (!this.isReadOnly) {
1539
1539
  switch (this.interactionMode) {
1540
1540
  case DIAGRAM_INTERACTION_MODE.LAYOUT: {
1541
- this.diagram.generalizationViews.forEach((generalizationView) => generalizationView.possiblyFlattenPath());
1542
- this.diagram.associationViews.forEach((associationView) => associationView.possiblyFlattenPath());
1543
- this.diagram.propertyViews.forEach((propertyView) => propertyView.possiblyFlattenPath());
1541
+ this.diagram.generalizationViews.forEach((generalizationView) => relationshipView_simplifyPath(generalizationView));
1542
+ this.diagram.associationViews.forEach((associationView) => relationshipView_simplifyPath(associationView));
1543
+ this.diagram.propertyViews.forEach((propertyView) => relationshipView_simplifyPath(propertyView));
1544
1544
  break;
1545
1545
  }
1546
1546
  case DIAGRAM_INTERACTION_MODE.ADD_CLASS: {
@@ -1597,16 +1597,16 @@ export class DiagramRenderer {
1597
1597
  if (targetClassView.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
1598
1598
  const gview = this.handleAddRelationship(this.startClassView, targetClassView);
1599
1599
  if (gview) {
1600
- gview.from.setOffsetX(-(this.startClassView.position.x +
1600
+ relationshipEdgeView_setOffsetX(gview.from, -(this.startClassView.position.x +
1601
1601
  this.startClassView.rectangle.width / 2 -
1602
1602
  this.selectionStart.x));
1603
- gview.from.setOffsetY(-(this.startClassView.position.y +
1603
+ relationshipEdgeView_setOffsetY(gview.from, -(this.startClassView.position.y +
1604
1604
  this.startClassView.rectangle.height / 2 -
1605
1605
  this.selectionStart.y));
1606
- gview.to.setOffsetX(-(targetClassView.position.x +
1606
+ relationshipEdgeView_setOffsetX(gview.to, -(targetClassView.position.x +
1607
1607
  targetClassView.rectangle.width / 2 -
1608
1608
  eventPointInModelCoordinate.x));
1609
- gview.to.setOffsetY(-(targetClassView.position.y +
1609
+ relationshipEdgeView_setOffsetY(gview.to, -(targetClassView.position.y +
1610
1610
  targetClassView.rectangle.height / 2 -
1611
1611
  eventPointInModelCoordinate.y));
1612
1612
  }
@@ -1703,7 +1703,7 @@ export class DiagramRenderer {
1703
1703
  this.setSelectedClassCorner(this.diagram.classViews[i]);
1704
1704
  if (!this.isReadOnly) {
1705
1705
  // Bring the class view to front
1706
- this.diagram.setClassViews(this.reorderDiagramDomain(guaranteeNonNullable(this.selectedClassCorner), this.diagram));
1706
+ diagram_setClassViews(this.diagram, this.reorderDiagramDomain(guaranteeNonNullable(this.selectedClassCorner), this.diagram));
1707
1707
  }
1708
1708
  break;
1709
1709
  }
@@ -1730,7 +1730,7 @@ export class DiagramRenderer {
1730
1730
  }
1731
1731
  if (!this.isReadOnly) {
1732
1732
  // Bring the class view to front
1733
- this.diagram.setClassViews(this.reorderDiagramDomain(this.selectedClasses[0], this.diagram));
1733
+ diagram_setClassViews(this.diagram, this.reorderDiagramDomain(this.selectedClasses[0], this.diagram));
1734
1734
  }
1735
1735
  this.clickX =
1736
1736
  eventPointInCanvasCoordinate.x / this.zoom -
@@ -1761,7 +1761,7 @@ export class DiagramRenderer {
1761
1761
  // check for selection of inheritance view
1762
1762
  for (const generalizationView of this.diagram
1763
1763
  .generalizationViews) {
1764
- const val = generalizationView.findOrBuildPoint(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1764
+ const val = findOrBuildPoint(generalizationView, eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1765
1765
  if (val) {
1766
1766
  this.selectedPoint = val;
1767
1767
  this.setSelectedInheritance(generalizationView);
@@ -1771,7 +1771,7 @@ export class DiagramRenderer {
1771
1771
  // check for selection of association view
1772
1772
  if (!this.selectedPoint) {
1773
1773
  for (const associationView of this.diagram.associationViews) {
1774
- const val = associationView.findOrBuildPoint(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1774
+ const val = findOrBuildPoint(associationView, eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1775
1775
  if (val) {
1776
1776
  this.selectedPoint = val;
1777
1777
  this.setSelectedPropertyOrAssociation(associationView);
@@ -1782,7 +1782,7 @@ export class DiagramRenderer {
1782
1782
  // check for selection of property view
1783
1783
  if (!this.selectedPoint) {
1784
1784
  for (const propertyView of this.diagram.propertyViews) {
1785
- const val = propertyView.findOrBuildPoint(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1785
+ const val = findOrBuildPoint(propertyView, eventPointInModelCoordinate.x, eventPointInModelCoordinate.y, this.zoom, !this.isReadOnly);
1786
1786
  if (val) {
1787
1787
  this.selectedPoint = val;
1788
1788
  this.setSelectedPropertyOrAssociation(propertyView);
@@ -1863,11 +1863,11 @@ export class DiagramRenderer {
1863
1863
  // Resize class view
1864
1864
  if (this.selectedClassCorner) {
1865
1865
  // Make sure width and height are in range!
1866
- this.selectedClassCorner.setRectangle(new Rectangle(eventPointInModelCoordinate.x -
1866
+ positionedRectangle_setRectangle(this.selectedClassCorner, new Rectangle(eventPointInModelCoordinate.x -
1867
1867
  this.selectedClassCorner.position.x, eventPointInModelCoordinate.y -
1868
1868
  this.selectedClassCorner.position.y));
1869
1869
  // Refresh hash since ClassView rectangle is not observable
1870
- this.selectedClassCorner.forceRefreshHash();
1870
+ positionedRectangle_forceRefreshHash(this.selectedClassCorner);
1871
1871
  this.drawClassView(this.selectedClassCorner);
1872
1872
  this.drawScreen();
1873
1873
  }
@@ -1889,9 +1889,9 @@ export class DiagramRenderer {
1889
1889
  (this.clickY - selectedClassOldPosition.oldPos.y);
1890
1890
  newMovingDeltaX = selectedClass.position.x - newMovingX;
1891
1891
  newMovingDeltaY = selectedClass.position.y - newMovingY;
1892
- selectedClass.setPosition(new Point(newMovingX, newMovingY));
1892
+ positionedRectangle_setPosition(selectedClass, new Point(newMovingX, newMovingY));
1893
1893
  // Refresh hash since ClassView position is not observable
1894
- selectedClass.forceRefreshHash();
1894
+ positionedRectangle_forceRefreshHash(selectedClass);
1895
1895
  }
1896
1896
  });
1897
1897
  this.potentiallyShiftRelationships(this.diagram.associationViews, this.selectedClasses, newMovingDeltaX, newMovingDeltaY);
@@ -1903,10 +1903,10 @@ export class DiagramRenderer {
1903
1903
  // Change line (add a new point to the line)
1904
1904
  if (this.selectedPoint) {
1905
1905
  if (this.selectedPropertyOrAssociation) {
1906
- this.selectedPropertyOrAssociation.changePoint(this.selectedPoint, eventPointInModelCoordinate);
1906
+ relationshipView_changePoint(this.selectedPropertyOrAssociation, this.selectedPoint, eventPointInModelCoordinate);
1907
1907
  }
1908
1908
  else if (this.selectedInheritance) {
1909
- this.selectedInheritance.changePoint(this.selectedPoint, eventPointInModelCoordinate);
1909
+ relationshipView_changePoint(this.selectedInheritance, this.selectedPoint, eventPointInModelCoordinate);
1910
1910
  }
1911
1911
  this.selectedPoint = eventPointInModelCoordinate;
1912
1912
  this.drawScreen();
@@ -2028,8 +2028,7 @@ export class DiagramRenderer {
2028
2028
  ...this.diagram.associationViews,
2029
2029
  ];
2030
2030
  for (const propertyHolderView of propertyHolderViews) {
2031
- let fullPath = propertyHolderView.buildFullPath();
2032
- fullPath = manageInsidePointsDynamically(fullPath, propertyHolderView.from.classView.value, propertyHolderView.to.classView.value);
2031
+ const fullPath = RelationshipView.pruneUnnecessaryInsidePoints(propertyHolderView.buildFullPath(), propertyHolderView.from.classView.value, propertyHolderView.to.classView.value);
2033
2032
  const propertyInfoBox = this.drawLinePropertyText(
2034
2033
  // NOTE: by the way we compute the full path, it would guarantee
2035
2034
  // to always have at least 2 points
@@ -2101,11 +2100,11 @@ export class DiagramRenderer {
2101
2100
  : precedentY + precedentTotalHeight + spaceY;
2102
2101
  // Set layout of current level
2103
2102
  if (positionInitialClass || currentLevelIndex > 0) {
2104
- levels[0].setPosition(new Point(startX, currentLevelY));
2103
+ positionedRectangle_setPosition(levels[0], new Point(startX, currentLevelY));
2105
2104
  levels.forEach((view, idx) => {
2106
2105
  if (idx > 0) {
2107
2106
  const precedent = levels[idx - 1];
2108
- view.setPosition(new Point(precedent.position.x + precedent.rectangle.width + spaceX, currentLevelY));
2107
+ positionedRectangle_setPosition(view, new Point(precedent.position.x + precedent.rectangle.width + spaceX, currentLevelY));
2109
2108
  }
2110
2109
  });
2111
2110
  }