From 68e01162bf50406113349f1475a2e7d1c1331fa3 Mon Sep 17 00:00:00 2001
From: jerray <jawher.jerray@eurecom.fr>
Date: Wed, 5 Jun 2024 10:14:35 +0200
Subject: [PATCH] Solve conflict

---
 src/main/java/ui/GTURTLEModeling.java | 35 ++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java
index 161df90236..23bc7528ac 100644
--- a/src/main/java/ui/GTURTLEModeling.java
+++ b/src/main/java/ui/GTURTLEModeling.java
@@ -9652,6 +9652,8 @@ public class GTURTLEModeling {
         }
         //TraceManager.addDev("Check done. " + checkingErrors.size() + " errors found\nAvatar Spec:\n" + avspec.toString());
 
+        //TraceManager.addDev("Avspec to be drawn:" + avspec.toStringRecursive(false));
+
 
         // Go for drawing!
         hasCrypto = false;
@@ -9759,6 +9761,9 @@ public class GTURTLEModeling {
             }
         }
 
+        // Data types
+        // Put them on the lower part
+
 
         for (AvatarRelation ar : avspec.getRelations()) {
             String bl1 = ar.block1.getName();
@@ -9822,7 +9827,35 @@ public class GTURTLEModeling {
             }
         }
 
-        ypos += 100;
+        xpos = 50;
+        ypos = 500;
+
+        for (AvatarDataType adt : avspec.getDataTypes()) {
+            AvatarBDDataType abdType = new AvatarBDDataType(xpos, ypos, abd.getMinX(), abd.getMaxX(), abd.getMinY(), abd.getMaxY(), false,
+                    null, abd);
+            // Adding attributes
+            for (AvatarAttribute attr : adt.getAttributes()) {
+                int type = 4;
+                if (attr.getType() == AvatarType.INTEGER) {
+                    type = 0;
+                }
+                if (attr.getType() == AvatarType.TIMER) {
+                    type = 9;
+                }
+                abdType.addAttribute(new TAttribute(0, attr.getName(), attr.getType().getDefaultInitialValue(), type));
+            }
+
+
+            // Drawing
+            if ((adt.getReferenceObject() != null) && (adt.getReferenceObject() instanceof CDElement)) {
+                CDElement cd = ((CDElement) (adt.getReferenceObject()));
+                abdType.setUserResize(cd.getX(), cd.getY(), cd.getWidth(), cd.getHeight());
+                abd.addComponent(abdType, cd.getX(), cd.getY(), false, true);
+            } else {
+                abd.addComponent(abdType, xpos, ypos, false, true);
+            }
+
+        }
 
 
         //Add Pragmas
-- 
GitLab