diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java index 161df90236695514f53e81ef9542118b917066a8..23bc7528ace342195c3a9bade03e3d1d0b3f5be1 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