From 2e4beb417c1bf7eda93679b665f78e1fc2883520 Mon Sep 17 00:00:00 2001 From: Minh Hiep Pham <minh.pham@telecom-paristech.fr> Date: Wed, 27 Mar 2019 18:22:08 +0100 Subject: [PATCH] updated addSwallowedTGComponent method in TMLCCompositeComponent in case that tgc is a primitive port --- .../ui/tmlcompd/TMLCCompositeComponent.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java b/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java index c4b1c8cbf9..da5ed0ccc8 100755 --- a/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java +++ b/src/main/java/ui/tmlcompd/TMLCCompositeComponent.java @@ -290,6 +290,24 @@ public class TMLCCompositeComponent extends TGCScalableWithInternalComponent imp } } } + + //issue 188 : attach primitive port into primitive component starting at the third level + if ((!swallowed) && (tgc instanceof TMLCPrimitivePort)) { + List<TMLCPrimitiveComponent> pcList = getAllPrimitiveComponents(); + for(TMLCPrimitiveComponent tmlpc : pcList) { + if(((SwallowTGComponent)tmlpc).acceptSwallowedTGComponent(tgc)) { + if(tmlpc.isOnMe(x,y) != null) { + swallowed = true; + ((SwallowTGComponent)tmlpc).addSwallowedTGComponent(tgc, x, y); + break; + } + } + } + if (swallowed) { + return true; + } + } + //------------ if (swallowed) { return true; -- GitLab