From bdaf4bb5bd28d149523af15c7942da15908cd9aa Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paris.fr> Date: Tue, 22 Mar 2022 14:45:01 +0100 Subject: [PATCH] Support notified event TML drawing --- src/main/java/ui/DrawerTMLModeling.java | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main/java/ui/DrawerTMLModeling.java b/src/main/java/ui/DrawerTMLModeling.java index ebf6b4e062..b263de453b 100644 --- a/src/main/java/ui/DrawerTMLModeling.java +++ b/src/main/java/ui/DrawerTMLModeling.java @@ -344,7 +344,8 @@ public class DrawerTMLModeling { comp.setPortName(name); // Extra correct name, depending on whether it is the sender or the receiver - String[] splitName = name.split("__"); + comp.setCommName(getSplitName(name, isOrigin)); + /*String[] splitName = name.split("__"); if (splitName.length > 3) { if (isOrigin) { comp.setCommName(splitName[1]); @@ -355,7 +356,7 @@ public class DrawerTMLModeling { comp.setCommName(splitName[1]); } else { comp.setCommName(name); - } + }*/ comp.setPortType(portType); comp.setIsOrigin(isOrigin); @@ -553,7 +554,7 @@ public class DrawerTMLModeling { TMLADNotifiedEvent notified = new TMLADNotifiedEvent(firstGUI.getX(), firstGUI.getY()+getYDep(), activityPanel.getMinX(), activityPanel.getMaxX(), activityPanel.getMinY(), activityPanel.getMaxY(), true, null, activityPanel); - notified.setEventName(notifiedT.getEvent().getName()); + notified.setEventName(getSplitName(notifiedT.getEvent().getName(), false)); notified.setResult(notifiedT.getVariable()); return notified; } @@ -594,6 +595,20 @@ public class DrawerTMLModeling { } + private String getSplitName(String compoundName, boolean isOrigin) { + String[] splitName = compoundName.split("__"); + if (splitName.length > 3) { + if (isOrigin) { + return splitName[1]; + } else { + return splitName[3]; + } + } else if (splitName.length > 1){ + return splitName[1]; + } + return compoundName; + } + -- GitLab