From 933d6ffdd1cd988068c0596df8ada29c45640a4f Mon Sep 17 00:00:00 2001
From: Letitia Li <leli@enst.fr>
Date: Fri, 26 Aug 2016 15:20:30 +0000
Subject: [PATCH] date paper

---
 src/ui/GTMLModeling.java              |  2 +-
 src/ui/tmlad/TMLADDecrypt.java        | 19 ++++++++----
 src/ui/tmlad/TMLADReadChannel.java    |  2 +-
 src/ui/tmlad/TMLADWriteChannel.java   |  2 +-
 src/ui/window/JDialogDSE.java         | 43 ++++++++++++++++++---------
 src/ui/window/JDialogMultiString.java |  2 +-
 6 files changed, 47 insertions(+), 23 deletions(-)

diff --git a/src/ui/GTMLModeling.java b/src/ui/GTMLModeling.java
index 033384d4e4..4a000ac5cc 100755
--- a/src/ui/GTMLModeling.java
+++ b/src/ui/GTMLModeling.java
@@ -1522,7 +1522,7 @@ public class GTMLModeling  {
                 listE.addCor(tmlexecc, tgc);
 
             } else if (tgc instanceof TMLADDecrypt) {
-                tmlexecc = new TMLExecC("decrypt", tgc);
+                tmlexecc = new TMLExecC("decrypt_"+((TMLADDecrypt)tgc).securityContext, tgc);
                 activity.addElement(tmlexecc);
 		SecurityPattern sp = securityPatterns.get(((TMLADDecrypt)tgc).securityContext);
 		if (sp ==null && !((TMLADDecrypt)tgc).securityContext.isEmpty()){
diff --git a/src/ui/tmlad/TMLADDecrypt.java b/src/ui/tmlad/TMLADDecrypt.java
index a1ca510855..9e968843c8 100755
--- a/src/ui/tmlad/TMLADDecrypt.java
+++ b/src/ui/tmlad/TMLADDecrypt.java
@@ -61,6 +61,7 @@ public class TMLADDecrypt extends TGCWithoutInternalComponent implements Embedde
     private int lineLength = 5;
     private int textX, textY;
     private int ilength = 10;
+    private int ex=5;
     private int lineLength1 = 2;
     public String securityContext="";	
     protected int stateOfError = 0; // Not yet checked
@@ -68,7 +69,7 @@ public class TMLADDecrypt extends TGCWithoutInternalComponent implements Embedde
     public TMLADDecrypt(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp)  {
         super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
         
-        width = 10;
+        width = 15;
         height = 30;
         textX = width + 5;
         textY = height/2 + 5;
@@ -101,10 +102,18 @@ public class TMLADDecrypt extends TGCWithoutInternalComponent implements Embedde
 			g.fillRect(x, y, width, height);
 			g.setColor(c);
 		}
-        g.drawRect(x, y, width, height);
+	g.drawLine(x, y, x+width, y);
+        g.drawLine(x, y, x, y+height);
+	g.drawLine(x+width, y, x+width, y+height);
+        g.drawLine(x, y+height, x+width/2, y+height+ex);
+        g.drawLine(x+width/2, y+height+ex, x+width, y+height);
         g.drawLine(x+(width/2), y, x+(width/2), y - lineLength);
-        g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height);
+        g.drawLine(x+(width/2), y+height+ex, x+(width/2), y + lineLength + height+ex);
+
+
         g.drawLine(x + (width/2) - lineLength1, y+(height-ilength)/2,  x + (width/2) + lineLength1, y+(height-ilength)/2);
+
+
         g.drawLine(x + (width/2) - lineLength1, y+(height-ilength)/2 + ilength,  x + (width/2) + lineLength1, y+(height-ilength)/2 + ilength);
         g.drawLine(x + (width/2)- lineLength1, y+(height-ilength)/2, x + (width/2)- lineLength1, y+(height+ilength)/2);
         g.drawLine(x + (width/2)+ lineLength1, y+(height-ilength)/2, x + (width/2)+ lineLength1, y+(height+ilength)/2);
@@ -120,8 +129,8 @@ public boolean editOndoubleClick(JFrame frame) {
 	ArrayList<String []> help = new ArrayList<String []>();
 	help.add(tdp.getMGUI().getCurrentCryptoConfig());
         //JDialogTwoString jdts = new JDialogTwoString(frame, "Setting channel's properties", "Channel name", channelName, "Nb of samples", nbOfSamples);
-	JDialogMultiString jdms = new JDialogMultiString(frame, "Setting channel's properties", 1, labels, values,help);
-        jdms.setSize(450, 300);
+	JDialogMultiString jdms = new JDialogMultiString(frame, "Setting Decryption", 1, labels, values,help);
+        jdms.setSize(600, 300);
         GraphicLib.centerOnParent(jdms);
         jdms.show(); // blocked until dialog has been closed
 
diff --git a/src/ui/tmlad/TMLADReadChannel.java b/src/ui/tmlad/TMLADReadChannel.java
index 9f8a03bc75..59ed46ddb9 100755
--- a/src/ui/tmlad/TMLADReadChannel.java
+++ b/src/ui/tmlad/TMLADReadChannel.java
@@ -232,7 +232,7 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che
        // JDialogTwoString jdts = new JDialogTwoString(frame, "Setting channel's properties", "Channel name", channelName, "Nb of samples", nbOfSamples);
 
 	JDialogMultiString jdms = new JDialogMultiString(frame, "Setting channel's properties", 3, labels, values, help);
-        jdms.setSize(450, 300);
+        jdms.setSize(600, 300);
         GraphicLib.centerOnParent(jdms);
         jdms.show(); // blocked until dialog has been closed
 
diff --git a/src/ui/tmlad/TMLADWriteChannel.java b/src/ui/tmlad/TMLADWriteChannel.java
index 81a3dcf105..0228f71a3b 100755
--- a/src/ui/tmlad/TMLADWriteChannel.java
+++ b/src/ui/tmlad/TMLADWriteChannel.java
@@ -236,7 +236,7 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch
 
         //JDialogTwoString jdts = new JDialogTwoString(frame, "Setting channel's properties", "Channel name", channelName, "Nb of samples", nbOfSamples);
 	JDialogMultiString jdms = new JDialogMultiString(frame, "Setting channel's properties", 3, labels, values, help);
-        jdms.setSize(450, 300);
+        jdms.setSize(600, 300);
         GraphicLib.centerOnParent(jdms);
         jdms.show(); // blocked until dialog has been closed
 
diff --git a/src/ui/window/JDialogDSE.java b/src/ui/window/JDialogDSE.java
index 51a79205e4..e835b0bf58 100644
--- a/src/ui/window/JDialogDSE.java
+++ b/src/ui/window/JDialogDSE.java
@@ -79,7 +79,9 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R
     protected final static int STOPPED = 3;
     int mode;
   
-
+    JRadioButton dseButton;
+    JRadioButton simButton;
+    ButtonGroup group;
     //components
     
     protected JButton start;
@@ -133,7 +135,6 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R
         initComponents();
         myInitComponents();
         pack();
-
         //getGlassPane().addMouseListener( new MouseAdapter() {});
         getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
     }
@@ -257,8 +258,17 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R
 
 	jp03.add(new JLabel("Data Overhead (bits)"),c03);
 	secOverhead2 = new JTextField(secOv);
+
 	jp03.add(secOverhead2,c03);
 
+	group = new ButtonGroup();
+	dseButton = new JRadioButton("Run Design Space Exploration");
+	jp03.add(dseButton,c03);
+	simButton = new JRadioButton("Run Lots of Simulations");
+	jp03.add(simButton,c03);
+	group.add(dseButton);
+	group.add(simButton);
+
 	jp1.add("Mapping Exploration", jp03);
 
 	JPanel jp04 = new JPanel();
@@ -274,6 +284,7 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R
         c04.gridheight = 1;
 
 
+
         jp04.setBorder(new javax.swing.border.TitledBorder("DSE Output"));
 	jp04.add(new JLabel("Design Space Exploration Output"), c04);
 
@@ -477,20 +488,24 @@ public class JDialogDSE extends javax.swing.JDialog implements ActionListener, R
 	   // config.setOutputVCD("true");
 	   // config.setOutputXML("true");
 	    config.setRecordResults("true");
-	    if (config.runParallelSimulation(Nbsim, true, true) != 0) {
-		output+="Simulation Failed";
-		outputText.setText(output);
-		checkMode();
-		return;
-	    }
-	    else {
-		output+="Simulation Succeeded";
-		outputText.setText(output);
+	    if (simButton.isSelected()){
+		if (config.runParallelSimulation(Nbsim, true, true) != 0) {
+		    output+="Simulation Failed";
+		    outputText.setText(output);
+		    checkMode();
+		    return;
+	    	}
+	    	else {
+		    output+="Simulation Succeeded";
+		    outputText.setText(output);
+		}
 	    }
-	    if (config.runDSE("", false, false)!=0){
-		TraceManager.addDev("Can't run DSE");
+	    else if (dseButton.isSelected()){
+	    	if (config.runDSE("", false, false)!=0){
+		    TraceManager.addDev("Can't run DSE");
+	   	}
+	        System.out.println("DSE run");
 	    }
-	    System.out.println("DSE run");
 	    if (config.printAllResults("", true, true)!=0){
 		TraceManager.addDev("Can't print all results");
 	    }
diff --git a/src/ui/window/JDialogMultiString.java b/src/ui/window/JDialogMultiString.java
index c34da96146..9413c01bd5 100755
--- a/src/ui/window/JDialogMultiString.java
+++ b/src/ui/window/JDialogMultiString.java
@@ -135,7 +135,7 @@ public class JDialogMultiString extends javax.swing.JDialog implements ActionLis
 
         panel1.setBorder(new javax.swing.border.TitledBorder("Properties"));
 
-        panel1.setPreferredSize(new Dimension(400, 200));
+        panel1.setPreferredSize(new Dimension(600, 300));
 
         // first line panel1
         c1.weighty = 1.0;
-- 
GitLab