@finos/legend-extension-dsl-diagram 1.0.27 → 1.0.30

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 +63 -63
  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 +10 -9
  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 +1 -10
  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 +4 -4
  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 +13 -10
  79. package/lib/stores/studio/DiagramEditorState.js.map +1 -1
  80. package/package.json +11 -11
  81. package/src/DiagramRenderer.ts +136 -72
  82. package/src/components/studio/ClassDiagramPreview.tsx +3 -1
  83. package/src/components/studio/DiagramEditor.tsx +17 -11
  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 -13
  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 +28 -9
  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"}
@@ -14,17 +14,19 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { uuid, noop, getNullableFirstElement, UnsupportedOperationError, IllegalStateError, guaranteeNonNullable, findLast, uniqBy, } from '@finos/legend-shared';
17
- import { Class, Enumeration, PrimitiveType, DerivedProperty, PackageableElementExplicitReference, PropertyExplicitReference, GenericTypeExplicitReference, GenericType, Property, Multiplicity, addClassProperty, addClassSuperType, } from '@finos/legend-graph';
17
+ import { Class, Enumeration, PrimitiveType, DerivedProperty, PackageableElementExplicitReference, PropertyExplicitReference, GenericTypeExplicitReference, GenericType, Property, Multiplicity, } from '@finos/legend-graph';
18
18
  import { action, makeObservable, observable } from 'mobx';
19
19
  import { Rectangle } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Rectangle';
20
20
  import { Point } from './models/metamodels/pure/packageableElements/diagram/geometry/DSLDiagram_Point';
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
+ 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';
28
30
  export var DIAGRAM_INTERACTION_MODE;
29
31
  (function (DIAGRAM_INTERACTION_MODE) {
30
32
  DIAGRAM_INTERACTION_MODE[DIAGRAM_INTERACTION_MODE["LAYOUT"] = 0] = "LAYOUT";
@@ -424,13 +426,13 @@ export class DiagramRenderer {
424
426
  !startClassView.class.value.allSuperclasses.includes(targetClassView.class.value) &&
425
427
  // Avoid loop (might be expensive)
426
428
  !targetClassView.class.value.allSuperclasses.includes(startClassView.class.value)) {
427
- addClassSuperType(startClassView.class.value, GenericTypeExplicitReference.create(new GenericType(targetClassView.class.value)));
429
+ class_addSuperType(startClassView.class.value, GenericTypeExplicitReference.create(new GenericType(targetClassView.class.value)));
428
430
  }
429
431
  // only add an inheritance relationship view if the start class
430
432
  // has already had the target class as its supertype
431
433
  if (startClassView.class.value.generalizations.find((generalization) => generalization.value.rawType === targetClassView.class.value)) {
432
434
  const gview = new GeneralizationView(this.diagram, startClassView, targetClassView);
433
- this.diagram.addGeneralizationView(gview);
435
+ diagram_addGeneralizationView(this.diagram, gview);
434
436
  return gview;
435
437
  }
436
438
  return undefined;
@@ -440,13 +442,13 @@ export class DiagramRenderer {
440
442
  case DIAGRAM_RELATIONSHIP_EDIT_MODE.PROPERTY: {
441
443
  this.handleAddRelationship = (startClassView, targetClassView) => {
442
444
  const property = new Property(`property_${startClassView.class.value.properties.length + 1}`, new Multiplicity(1, 1), GenericTypeExplicitReference.create(new GenericType(targetClassView.class.value)), startClassView.class.value);
443
- addClassProperty(startClassView.class.value, property);
445
+ class_addProperty(startClassView.class.value, property);
444
446
  // only create property view if the classviews are different
445
447
  // else we end up with a weird rendering where the property view
446
448
  // is not targetable
447
449
  if (startClassView !== targetClassView) {
448
450
  const pView = new PropertyView(this.diagram, PropertyExplicitReference.create(property), startClassView, targetClassView);
449
- this.diagram.addPropertyView(pView);
451
+ diagram_addPropertyView(this.diagram, pView);
450
452
  return pView;
451
453
  }
452
454
  return undefined;
@@ -505,8 +507,7 @@ export class DiagramRenderer {
505
507
  .concat(this.diagram.generalizationViews)
506
508
  .concat(this.diagram.propertyViews);
507
509
  for (const relationshipView of relationshipViews) {
508
- let fullPath = relationshipView.buildFullPath();
509
- 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);
510
511
  if (relationshipView instanceof PropertyView) {
511
512
  const box = this.drawLinePropertyText(
512
513
  // NOTE: by the way we compute the full path, it would guarantee
@@ -595,14 +596,14 @@ export class DiagramRenderer {
595
596
  id = uuid();
596
597
  }
597
598
  const newClassView = new ClassView(this.diagram, id, PackageableElementExplicitReference.create(addedClass));
598
- newClassView.setPosition(classViewModelCoordinate ??
599
+ positionedRectangle_setPosition(newClassView, classViewModelCoordinate ??
599
600
  this.canvasCoordinateToModelCoordinate(new Point(this.virtualScreen.position.x +
600
601
  this.virtualScreen.rectangle.width / 2, this.virtualScreen.position.y +
601
602
  this.virtualScreen.rectangle.height / 2)));
602
- this.diagram.addClassView(newClassView);
603
+ diagram_addClassView(this.diagram, newClassView);
603
604
  // Refresh hash since ClassView position is not observable
604
605
  // NOTE: here we refresh after adding the class view to the diagram, that way the diagram hash is refreshed
605
- newClassView.forceRefreshHash();
606
+ positionedRectangle_forceRefreshHash(newClassView);
606
607
  this.diagram.classViews
607
608
  .filter((classView) => classView.class.value !== addedClass)
608
609
  .forEach((classView) => {
@@ -611,22 +612,22 @@ export class DiagramRenderer {
611
612
  if (addedClass.generalizations
612
613
  .map((generalization) => generalization.value.rawType)
613
614
  .includes(_class)) {
614
- this.diagram.addGeneralizationView(new GeneralizationView(this.diagram, newClassView, classView));
615
+ diagram_addGeneralizationView(this.diagram, new GeneralizationView(this.diagram, newClassView, classView));
615
616
  }
616
617
  if (_class.generalizations
617
618
  .map((generalization) => generalization.value.rawType)
618
619
  .includes(addedClass)) {
619
- this.diagram.addGeneralizationView(new GeneralizationView(this.diagram, classView, newClassView));
620
+ diagram_addGeneralizationView(this.diagram, new GeneralizationView(this.diagram, classView, newClassView));
620
621
  }
621
622
  // Add property view
622
623
  addedClass.getAllOwnedProperties().forEach((property) => {
623
624
  if (property.genericType.value.rawType === _class) {
624
- 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));
625
626
  }
626
627
  });
627
628
  _class.getAllOwnedProperties().forEach((property) => {
628
629
  if (property.genericType.value.rawType === addedClass) {
629
- 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));
630
631
  }
631
632
  });
632
633
  });
@@ -940,7 +941,7 @@ export class DiagramRenderer {
940
941
  classView.rectangle.height > classMinHeight
941
942
  ? classView.rectangle.height
942
943
  : classMinHeight;
943
- classView.setRectangle(new Rectangle(width, height));
944
+ positionedRectangle_setRectangle(classView, new Rectangle(width, height));
944
945
  }
945
946
  }
946
947
  drawClassView(classView) {
@@ -1071,7 +1072,7 @@ export class DiagramRenderer {
1071
1072
  // NOTE: force hash reload when we redraw class view; this would help with cases where
1072
1073
  // we auto add new properties to the class view, causing the box to expand, hence we need
1073
1074
  // to recompute hash
1074
- classView.forceRefreshHash();
1075
+ positionedRectangle_forceRefreshHash(classView);
1075
1076
  }
1076
1077
  drawLinePropertyNameAndMultiplicity(property, textPositionX, textPositionY, multiplicityPositionX, multiplicityPositionY, measureOnly) {
1077
1078
  this.ctx.font = `${this.fontSize}px ${this.fontFamily}`;
@@ -1156,8 +1157,7 @@ export class DiagramRenderer {
1156
1157
  return new PositionedRectangle(new Point(0, 0), new Rectangle(0, 0));
1157
1158
  }
1158
1159
  drawPropertyOrAssociation(propertyView) {
1159
- let fullPath = propertyView.buildFullPath();
1160
- 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);
1161
1161
  // const toProperty = asso instanceof.property ? asso.property : asso.association.properties[1];
1162
1162
  const toProperty = propertyView.property.value;
1163
1163
  this.drawLinePropertyText(
@@ -1238,8 +1238,7 @@ export class DiagramRenderer {
1238
1238
  }
1239
1239
  drawInheritance(inheritance) {
1240
1240
  const rect = inheritance.to.classView.value.rectangle;
1241
- let fullPath = inheritance.buildFullPath();
1242
- 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);
1243
1242
  // NOTE: by the way we compute the full path, it would guarantee
1244
1243
  // to always have at least 2 points
1245
1244
  const startX = fullPath[fullPath.length - 2].x;
@@ -1353,12 +1352,14 @@ export class DiagramRenderer {
1353
1352
  newClasses.push(firstClass);
1354
1353
  return newClasses;
1355
1354
  }
1356
- // TODO: add doc
1357
- potentiallyShiftRelationships(assoViews, selectedClasses, newMovingDeltaX, newMovingDeltaY) {
1358
- assoViews.forEach((assoView) => {
1359
- if (selectedClasses.indexOf(assoView.from.classView.value) !== -1 &&
1360
- selectedClasses.indexOf(assoView.to.classView.value) !== -1) {
1361
- 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)));
1362
1363
  }
1363
1364
  });
1364
1365
  }
@@ -1367,23 +1368,23 @@ export class DiagramRenderer {
1367
1368
  if ('Delete' === e.key) {
1368
1369
  if (!this.isReadOnly) {
1369
1370
  this.selectedClasses.forEach((classView) => {
1370
- this.diagram.deleteClassView(classView);
1371
- 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 ||
1372
1373
  associationView.to.classView.value === classView)));
1373
- 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 ||
1374
1375
  generalizationView.to.classView.value === classView)));
1375
- 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 ||
1376
1377
  propertyView.to.classView.value === classView)));
1377
1378
  });
1378
1379
  if (this.selectedPropertyOrAssociation instanceof AssociationView) {
1379
- this.diagram.deleteAssociationView(this.selectedPropertyOrAssociation);
1380
+ diagram_deleteAssociationView(this.diagram, this.selectedPropertyOrAssociation);
1380
1381
  }
1381
1382
  else if (this.selectedPropertyOrAssociation instanceof PropertyView) {
1382
- this.diagram.deletePropertyView(this.selectedPropertyOrAssociation);
1383
+ diagram_deletePropertyView(this.diagram, this.selectedPropertyOrAssociation);
1383
1384
  }
1384
1385
  if (this.selectedInheritance) {
1385
1386
  if (this.diagram.generalizationViews.find((generalizationView) => generalizationView === this.selectedInheritance)) {
1386
- this.diagram.deleteGeneralizationView(this.selectedInheritance);
1387
+ diagram_deleteGeneralizationView(this.diagram, this.selectedInheritance);
1387
1388
  }
1388
1389
  }
1389
1390
  this.selectedClasses = [];
@@ -1461,7 +1462,7 @@ export class DiagramRenderer {
1461
1462
  if (!this.isReadOnly) {
1462
1463
  if (this.selectedClasses.length !== 0) {
1463
1464
  this.selectedClasses.forEach((classView) => {
1464
- classView.setHideProperties(!classView.hideProperties);
1465
+ classView_setHideProperties(classView, !classView.hideProperties);
1465
1466
  });
1466
1467
  this.drawScreen();
1467
1468
  }
@@ -1472,7 +1473,7 @@ export class DiagramRenderer {
1472
1473
  if (!this.isReadOnly) {
1473
1474
  if (this.selectedClasses.length !== 0) {
1474
1475
  this.selectedClasses.forEach((classView) => {
1475
- classView.setHideStereotypes(!classView.hideStereotypes);
1476
+ classView_setHideStereotypes(classView, !classView.hideStereotypes);
1476
1477
  });
1477
1478
  this.drawScreen();
1478
1479
  }
@@ -1483,7 +1484,7 @@ export class DiagramRenderer {
1483
1484
  if (!this.isReadOnly) {
1484
1485
  if (this.selectedClasses.length !== 0) {
1485
1486
  this.selectedClasses.forEach((classView) => {
1486
- classView.setHideTaggedValues(!classView.hideTaggedValues);
1487
+ classView_setHideTaggedValues(classView, !classView.hideTaggedValues);
1487
1488
  });
1488
1489
  this.drawScreen();
1489
1490
  }
@@ -1517,8 +1518,8 @@ export class DiagramRenderer {
1517
1518
  else if ('ArrowUp' === e.key) {
1518
1519
  const views = this.getSuperTypeLevels(this.selectedClasses, this.diagram, 0, 1);
1519
1520
  const res = this.layoutTaxonomy(views, this.diagram, false, true);
1520
- res[0].forEach((cv) => this.diagram.addClassView(cv));
1521
- 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));
1522
1523
  this.drawScreen();
1523
1524
  }
1524
1525
  // Add subtypes of selected classes to the diagram
@@ -1527,8 +1528,8 @@ export class DiagramRenderer {
1527
1528
  if (views.length > 0) {
1528
1529
  views.forEach((classView) => this.ensureClassViewMeetMinDimensions(classView));
1529
1530
  const res = this.layoutTaxonomy([views, this.selectedClasses], this.diagram, false, false);
1530
- res[0].forEach((cv) => this.diagram.addClassView(cv));
1531
- 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));
1532
1533
  }
1533
1534
  this.drawScreen();
1534
1535
  }
@@ -1537,9 +1538,9 @@ export class DiagramRenderer {
1537
1538
  if (!this.isReadOnly) {
1538
1539
  switch (this.interactionMode) {
1539
1540
  case DIAGRAM_INTERACTION_MODE.LAYOUT: {
1540
- this.diagram.generalizationViews.forEach((generalizationView) => generalizationView.possiblyFlattenPath());
1541
- this.diagram.associationViews.forEach((associationView) => associationView.possiblyFlattenPath());
1542
- 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));
1543
1544
  break;
1544
1545
  }
1545
1546
  case DIAGRAM_INTERACTION_MODE.ADD_CLASS: {
@@ -1596,16 +1597,16 @@ export class DiagramRenderer {
1596
1597
  if (targetClassView.contains(eventPointInModelCoordinate.x, eventPointInModelCoordinate.y)) {
1597
1598
  const gview = this.handleAddRelationship(this.startClassView, targetClassView);
1598
1599
  if (gview) {
1599
- gview.from.setOffsetX(-(this.startClassView.position.x +
1600
+ relationshipEdgeView_setOffsetX(gview.from, -(this.startClassView.position.x +
1600
1601
  this.startClassView.rectangle.width / 2 -
1601
1602
  this.selectionStart.x));
1602
- gview.from.setOffsetY(-(this.startClassView.position.y +
1603
+ relationshipEdgeView_setOffsetY(gview.from, -(this.startClassView.position.y +
1603
1604
  this.startClassView.rectangle.height / 2 -
1604
1605
  this.selectionStart.y));
1605
- gview.to.setOffsetX(-(targetClassView.position.x +
1606
+ relationshipEdgeView_setOffsetX(gview.to, -(targetClassView.position.x +
1606
1607
  targetClassView.rectangle.width / 2 -
1607
1608
  eventPointInModelCoordinate.x));
1608
- gview.to.setOffsetY(-(targetClassView.position.y +
1609
+ relationshipEdgeView_setOffsetY(gview.to, -(targetClassView.position.y +
1609
1610
  targetClassView.rectangle.height / 2 -
1610
1611
  eventPointInModelCoordinate.y));
1611
1612
  }
@@ -1702,7 +1703,7 @@ export class DiagramRenderer {
1702
1703
  this.setSelectedClassCorner(this.diagram.classViews[i]);
1703
1704
  if (!this.isReadOnly) {
1704
1705
  // Bring the class view to front
1705
- this.diagram.setClassViews(this.reorderDiagramDomain(guaranteeNonNullable(this.selectedClassCorner), this.diagram));
1706
+ diagram_setClassViews(this.diagram, this.reorderDiagramDomain(guaranteeNonNullable(this.selectedClassCorner), this.diagram));
1706
1707
  }
1707
1708
  break;
1708
1709
  }
@@ -1729,7 +1730,7 @@ export class DiagramRenderer {
1729
1730
  }
1730
1731
  if (!this.isReadOnly) {
1731
1732
  // Bring the class view to front
1732
- this.diagram.setClassViews(this.reorderDiagramDomain(this.selectedClasses[0], this.diagram));
1733
+ diagram_setClassViews(this.diagram, this.reorderDiagramDomain(this.selectedClasses[0], this.diagram));
1733
1734
  }
1734
1735
  this.clickX =
1735
1736
  eventPointInCanvasCoordinate.x / this.zoom -
@@ -1760,7 +1761,7 @@ export class DiagramRenderer {
1760
1761
  // check for selection of inheritance view
1761
1762
  for (const generalizationView of this.diagram
1762
1763
  .generalizationViews) {
1763
- 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);
1764
1765
  if (val) {
1765
1766
  this.selectedPoint = val;
1766
1767
  this.setSelectedInheritance(generalizationView);
@@ -1770,7 +1771,7 @@ export class DiagramRenderer {
1770
1771
  // check for selection of association view
1771
1772
  if (!this.selectedPoint) {
1772
1773
  for (const associationView of this.diagram.associationViews) {
1773
- 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);
1774
1775
  if (val) {
1775
1776
  this.selectedPoint = val;
1776
1777
  this.setSelectedPropertyOrAssociation(associationView);
@@ -1781,7 +1782,7 @@ export class DiagramRenderer {
1781
1782
  // check for selection of property view
1782
1783
  if (!this.selectedPoint) {
1783
1784
  for (const propertyView of this.diagram.propertyViews) {
1784
- 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);
1785
1786
  if (val) {
1786
1787
  this.selectedPoint = val;
1787
1788
  this.setSelectedPropertyOrAssociation(propertyView);
@@ -1862,11 +1863,11 @@ export class DiagramRenderer {
1862
1863
  // Resize class view
1863
1864
  if (this.selectedClassCorner) {
1864
1865
  // Make sure width and height are in range!
1865
- this.selectedClassCorner.setRectangle(new Rectangle(eventPointInModelCoordinate.x -
1866
+ positionedRectangle_setRectangle(this.selectedClassCorner, new Rectangle(eventPointInModelCoordinate.x -
1866
1867
  this.selectedClassCorner.position.x, eventPointInModelCoordinate.y -
1867
1868
  this.selectedClassCorner.position.y));
1868
1869
  // Refresh hash since ClassView rectangle is not observable
1869
- this.selectedClassCorner.forceRefreshHash();
1870
+ positionedRectangle_forceRefreshHash(this.selectedClassCorner);
1870
1871
  this.drawClassView(this.selectedClassCorner);
1871
1872
  this.drawScreen();
1872
1873
  }
@@ -1888,9 +1889,9 @@ export class DiagramRenderer {
1888
1889
  (this.clickY - selectedClassOldPosition.oldPos.y);
1889
1890
  newMovingDeltaX = selectedClass.position.x - newMovingX;
1890
1891
  newMovingDeltaY = selectedClass.position.y - newMovingY;
1891
- selectedClass.setPosition(new Point(newMovingX, newMovingY));
1892
+ positionedRectangle_setPosition(selectedClass, new Point(newMovingX, newMovingY));
1892
1893
  // Refresh hash since ClassView position is not observable
1893
- selectedClass.forceRefreshHash();
1894
+ positionedRectangle_forceRefreshHash(selectedClass);
1894
1895
  }
1895
1896
  });
1896
1897
  this.potentiallyShiftRelationships(this.diagram.associationViews, this.selectedClasses, newMovingDeltaX, newMovingDeltaY);
@@ -1902,10 +1903,10 @@ export class DiagramRenderer {
1902
1903
  // Change line (add a new point to the line)
1903
1904
  if (this.selectedPoint) {
1904
1905
  if (this.selectedPropertyOrAssociation) {
1905
- this.selectedPropertyOrAssociation.changePoint(this.selectedPoint, eventPointInModelCoordinate);
1906
+ relationshipView_changePoint(this.selectedPropertyOrAssociation, this.selectedPoint, eventPointInModelCoordinate);
1906
1907
  }
1907
1908
  else if (this.selectedInheritance) {
1908
- this.selectedInheritance.changePoint(this.selectedPoint, eventPointInModelCoordinate);
1909
+ relationshipView_changePoint(this.selectedInheritance, this.selectedPoint, eventPointInModelCoordinate);
1909
1910
  }
1910
1911
  this.selectedPoint = eventPointInModelCoordinate;
1911
1912
  this.drawScreen();
@@ -2027,8 +2028,7 @@ export class DiagramRenderer {
2027
2028
  ...this.diagram.associationViews,
2028
2029
  ];
2029
2030
  for (const propertyHolderView of propertyHolderViews) {
2030
- let fullPath = propertyHolderView.buildFullPath();
2031
- 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);
2032
2032
  const propertyInfoBox = this.drawLinePropertyText(
2033
2033
  // NOTE: by the way we compute the full path, it would guarantee
2034
2034
  // to always have at least 2 points
@@ -2100,11 +2100,11 @@ export class DiagramRenderer {
2100
2100
  : precedentY + precedentTotalHeight + spaceY;
2101
2101
  // Set layout of current level
2102
2102
  if (positionInitialClass || currentLevelIndex > 0) {
2103
- levels[0].setPosition(new Point(startX, currentLevelY));
2103
+ positionedRectangle_setPosition(levels[0], new Point(startX, currentLevelY));
2104
2104
  levels.forEach((view, idx) => {
2105
2105
  if (idx > 0) {
2106
2106
  const precedent = levels[idx - 1];
2107
- 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));
2108
2108
  }
2109
2109
  });
2110
2110
  }