diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 8941a7e1ec43cc7b8c0baea7883de2d373276e43..da1358f1ac2215d9072906ae58025b7cd527d66f 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -255,6 +255,7 @@ import ui.avatarbd.AvatarBDPortConnector; import ui.avatarbd.AvatarBDPragma; import ui.avatarbd.AvatarBDStateMachineOwner; import ui.avatarcd.AvatarCDPanel; +import ui.avatarbd.AvatarBDDataType; // AVATAR // AVATAR // AVATAR @@ -7793,7 +7794,7 @@ public class GTURTLEModeling { father = blockMap.get(ab.getFather().getName().split("__")[1]); } AvatarBDBlock bl = new AvatarBDBlock(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, father, abd); - bl.addCryptoElements(); + for (avatartranslator.AvatarSignal sig:ab.getSignals()){ String name=sig.getName().split("__")[sig.getName().split("__").length-1]; sig.setName(name); @@ -7824,7 +7825,7 @@ public class GTURTLEModeling { else { bl.addAttribute(new TAttribute(0, attr.getName(), attr.getType().getDefaultInitialValue(), type)); } - if (attr.getName().equals("key")){ + if (attr.getName().contains("key_")){ bl.addCryptoElements(); } } @@ -7981,6 +7982,20 @@ public class GTURTLEModeling { pragma.setValue(s); pragma.makeValue(); abd.addComponent(pragma, xpos, ypos, false,true); + //Add message and key datatype + xpos=100; + ypos+=200; + AvatarBDDataType message = new AvatarBDDataType(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, null,abd); + message.setValue("Message"); + + abd.addComponent(message, xpos, ypos, false,true); + + AvatarBDDataType key = new AvatarBDDataType(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, null,abd); + key.setValue("Key"); + TAttribute attr = new TAttribute(2, "data", "0", 8); + message.addAttribute(attr); + key.addAttribute(attr); + abd.addComponent(key, xpos, ypos, false,true); } // Generates for all observers, a TURTLE modeling for checking it diff --git a/src/ui/avatarbd/AvatarBDDataType.java b/src/ui/avatarbd/AvatarBDDataType.java index a6334684b55f8d4adace1d17b58c1c740988f52b..7b9fdf506f89c2a5e0e021529d6785d2fb0fdfa0 100644 --- a/src/ui/avatarbd/AvatarBDDataType.java +++ b/src/ui/avatarbd/AvatarBDDataType.java @@ -453,5 +453,8 @@ public class AvatarBDDataType extends TGCScalableWithInternalComponent { public LinkedList<TAttribute> getAttributeList() { return myAttributes; } + public void addAttribute(TAttribute ta){ + myAttributes.add(ta); + } } diff --git a/src/ui/window/JDialogSafetyPragma.java b/src/ui/window/JDialogSafetyPragma.java index 9416db38a09604b2ecc99059f26dd18c0644a103..f6a12d9c16f20548d2057a018b3d3d4a1f6194c7 100644 --- a/src/ui/window/JDialogSafetyPragma.java +++ b/src/ui/window/JDialogSafetyPragma.java @@ -232,6 +232,7 @@ public class JDialogSafetyPragma extends javax.swing.JDialog implements ActionLi helpPopup = new JPopupMenu(); //JTextArea jft = new JTextArea("UPPAAL pragmas"); //helpPopup.add(jft); + helpPopup.add(new JLabel("UPPAAL safety query format")); helpPopup.add(new JLabel(new ImageIcon("src/ui/images/A1.gif"))); helpPopup.add(new JLabel(new ImageIcon("src/ui/images/A2.gif"))); helpPopup.add(new JLabel(new ImageIcon("src/ui/images/E1.gif")));