From fcde16e27e4138b0728f67f522ce315eb2ddbbe5 Mon Sep 17 00:00:00 2001
From: Tiziano Munaro <munaro@fortiss.org>
Date: Wed, 22 Jan 2020 12:04:06 +0100
Subject: [PATCH] Fix initialization of handles for Bezier curves

Issue-Ref: 3873
Issue-Url: https://af3-developer.fortiss.org/issues/3873

Signed-off-by: Tiziano Munaro <munaro@fortiss.org>
---
 .../fortiss/tooling/base/ui/editor/fx/controller/.ratings | 4 ++--
 .../fx/controller/LayoutedContentAnchorageController.java | 3 +--
 .../controller/LayoutedCurveLinkBendPointController.java  | 8 --------
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings
index f2371cea6..6c8379b82 100644
--- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings
+++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/.ratings
@@ -5,8 +5,8 @@ EObjectModelChangeProvider.java f4b60cebb088a5c81ca92a41614e1a5d40030502 GREEN
 EObjectRectangularResizableContentControllerBase.java 787a540213f29e8daaecd9afe98af8b3f4088db7 GREEN
 KernelServiceBasedModelChangeProviderBase.java 18e48f17ea8dfba90de024a8959fc5a4b0d05d45 GREEN
 LayoutModelChangeProvider.java b5449d02eaf39086909720c43e21bd061005fc9e GREEN
-LayoutedContentAnchorageController.java 3794b41d76e9ce14ead0bd812cde5c1a6d348d5c GREEN
-LayoutedCurveLinkBendPointController.java e47215864706953fac8e7059376d5898684f1816 RED
+LayoutedContentAnchorageController.java 851a957839af8a22ea41d312e21b7a4a29b882e5 YELLOW
+LayoutedCurveLinkBendPointController.java 76e510cbaa39538ac3314cd909a62885b625486d RED
 LayoutedDiagramAnchorageController.java 1e1ac7c5fa26c632736f5023e90f05d09bc0710d GREEN
 LayoutedEllipticResizableContentController.java b2c9c48190b9ff69a175bbe5f89761c1b08621ab YELLOW
 LayoutedLineLinkBendPointController.java e2dac36334191c39d54b4f95fa8482a6392ce82c RED
diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedContentAnchorageController.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedContentAnchorageController.java
index 3794b41d7..851a95783 100644
--- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedContentAnchorageController.java
+++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedContentAnchorageController.java
@@ -30,8 +30,7 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
 import org.fortiss.tooling.kernel.service.IElementCompositorService;
 
 /**
- * {@link DelegatingContentAnchorageController} for
- * {@link org.fortiss.tooling.base.model.layout.ILayoutedModelElement}s.
+ * {@link DelegatingContentAnchorageController} for {@link ILayoutedModelElement}s.
  * 
  * @author hoelzl
  */
diff --git a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedCurveLinkBendPointController.java b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedCurveLinkBendPointController.java
index e47215864..76e510cba 100644
--- a/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedCurveLinkBendPointController.java
+++ b/org.fortiss.tooling.base.ui/src/org/fortiss/tooling/base/ui/editor/fx/controller/LayoutedCurveLinkBendPointController.java
@@ -18,7 +18,6 @@ package org.fortiss.tooling.base.ui.editor.fx.controller;
 import static java.util.Arrays.asList;
 import static java.util.Objects.requireNonNull;
 import static org.eclipse.systemfocus.kernel.common.ui.javafx.lwfxef.FeedbackChange.locationFeedbackChange;
-import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.addConnectionPoint;
 import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.getConnectionPoints;
 import static org.fortiss.tooling.base.ui.utils.LayoutDataUIUtils.removeConnectionPoint;
 import static org.fortiss.tooling.base.utils.LayoutModelElementFactory.createPoint;
@@ -65,13 +64,6 @@ public class LayoutedCurveLinkBendPointController<T extends ILayoutedModelElemen
 
 		ILayoutedModelElement lme = (ILayoutedModelElement)mvcb.getModel();
 		this.layoutModelChangeProvider = new LayoutModelChangeProvider(lme);
-
-		DiagramCoordinate start = mvcb.getVisual().getStartAnchorPoint();
-		DiagramCoordinate end = mvcb.getVisual().getEndAnchorPoint();
-		DiagramCoordinate middle = new DiagramCoordinate((start.getX() + end.getX()) / 2,
-				(start.getY() + end.getY()) / 2);
-		addConnectionPoint(getModelElement(), 0, (int)middle.getX(), (int)middle.getY());
-		addConnectionPoint(getModelElement(), 1, (int)middle.getX(), (int)middle.getY());
 	}
 
 	/** Returns the model element. */
-- 
GitLab