diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java
index 4315ca9bab513ae70ac31fe19c363af242cd9fb8..923ef4279402d302b786a3ef07ab4cbfedbd3a1b 100755
--- a/src/main/java/ui/GTURTLEModeling.java
+++ b/src/main/java/ui/GTURTLEModeling.java
@@ -38,7 +38,6 @@
 
 package ui;
 
-import ui.tree.*;
 import avatartranslator.*;
 import avatartranslator.toproverif.AVATAR2ProVerif;
 import avatartranslator.totpn.AVATAR2TPN;
@@ -86,7 +85,6 @@ import translator.touppaal.RelationTIFUPPAAL;
 import translator.touppaal.TURTLE2UPPAAL;
 import ui.ad.TActivityDiagramPanel;
 import ui.atd.AttackTreeDiagramPanel;
-import ui.ftd.FaultTreeDiagramPanel;
 import ui.avatarad.AvatarADPanel;
 import ui.avatarbd.*;
 import ui.avatarcd.AvatarCDPanel;
@@ -104,7 +102,9 @@ import ui.dd.TDDNode;
 import ui.dd.TDeploymentDiagramPanel;
 import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel;
 import ui.ebrdd.EBRDDPanel;
+import ui.ftd.FaultTreeDiagramPanel;
 import ui.graph.RG;
+import ui.het.CAMSBlockDiagramPanel;
 import ui.iod.InteractionOverviewDiagramPanel;
 import ui.ncdd.NCDiagramPanel;
 import ui.osad.TURTLEOSActivityDiagramPanel;
@@ -123,11 +123,7 @@ import ui.tmlcompd.*;
 import ui.tmlcp.TMLCPPanel;
 import ui.tmldd.*;
 import ui.tmlsd.TMLSDPanel;
-import ui.het.*;
-import ui.tree.GraphTree;
-import ui.tree.InvariantDataTree;
-import ui.tree.SearchTree;
-import ui.tree.SyntaxAnalysisTree;
+import ui.tree.*;
 import ui.ucd.UseCaseDiagramPanel;
 import ui.util.DefaultText;
 import ui.util.IconManager;
@@ -135,6 +131,7 @@ import ui.window.JFrameSimulationTrace;
 import uppaaldesc.UPPAALSpec;
 
 import javax.swing.*;
+import javax.swing.tree.TreePath;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -142,7 +139,6 @@ import java.awt.*;
 import java.io.*;
 import java.util.*;
 import java.util.List;
-import javax.swing.tree.*;
 
 // AVATAR
 // AVATAR
@@ -154,6 +150,7 @@ import javax.swing.tree.*;
  * Class GTURTLEModeling
  * Creation: 09/12/2003
  * Version: 1.1 02/06/2014
+ *
  * @author Ludovic APVRILLE
  */
 public class GTURTLEModeling {
@@ -253,8 +250,7 @@ public class GTURTLEModeling {
     private boolean undoRunning = false;
 
 
-
-    boolean hasCrypto=false;
+    boolean hasCrypto = false;
     //private Charset chset1, chset2;
 
     public GTURTLEModeling(MainGUI _mgui, Vector<TURTLEPanel> _panels) {
@@ -292,7 +288,7 @@ public class GTURTLEModeling {
     }
 
     public boolean isRegularTM() {
-        if (tm == null ){
+        if (tm == null) {
             return false;
         }
         return tm.isARegularTIFSpec();
@@ -318,7 +314,6 @@ public class GTURTLEModeling {
     }
 
 
-
     public void addInvariant(Invariant _inv) {
         invariants.add(_inv);
         TraceManager.addDev("Adding invariant: " + _inv.toString());
@@ -329,7 +324,6 @@ public class GTURTLEModeling {
     }
 
 
-
     public String saveTIF() {
         if (tm == null) {
             TraceManager.addDev("NO TIF to save");
@@ -339,7 +333,7 @@ public class GTURTLEModeling {
         TIFExchange tif = new TIFExchange();
         tif.setTURTLEModeling(tm);
         String ret = tif.saveInXMLTIF();
-        TraceManager.addDev("TIF=\n" +  ret);
+        TraceManager.addDev("TIF=\n" + ret);
         return ret;
     }
 
@@ -393,7 +387,7 @@ public class GTURTLEModeling {
         TURTLETranslator tt = new TURTLETranslator(tm);
         rtlotos = tt.generateRTLOTOS();
         warnings = tt.getWarnings();
-        nbRTLOTOS ++;
+        nbRTLOTOS++;
         if (f != null) {
             saveInFile(f, rtlotos);
         }
@@ -420,8 +414,7 @@ public class GTURTLEModeling {
         TraceManager.addDev("Lotos generated");
 
 
-
-        nbRTLOTOS ++;
+        nbRTLOTOS++;
         if (f != null) {
             saveInFile(f, rtlotos);
         }
@@ -459,7 +452,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public boolean generateCCode( String directory ) {
+    public boolean generateCCode(String directory) {
 
         //CheckingError ce;
         //int type;
@@ -467,65 +460,62 @@ public class GTURTLEModeling {
         String applicationName;
         TMLModelCompiler CCode;
 
-        if( tmap == null )        {
-            JOptionPane.showMessageDialog( mgui.frame, "C code is only generated from an architecture diagram with mapping information", "Control code generation failed", JOptionPane.INFORMATION_MESSAGE );
+        if (tmap == null) {
+            JOptionPane.showMessageDialog(mgui.frame, "C code is only generated from an architecture diagram with mapping information", "Control code generation failed", JOptionPane.INFORMATION_MESSAGE);
             return true;
         }
         // Get the file from DiplodocusPECPragma
         //List<TGComponent> components = mgui.getCurrentArchiPanel().tmlap.getComponentList();
         // Parse the PEC file and the library of code snippets for each DIPLODOCUS unit
         applicationName = tmap.getMappedTasks().get(0).getName().split("__")[0];        // Remember that it works only for one application
-        CCode = new TMLModelCompiler( directory, applicationName, mgui.frame, mgui.getAllTMLCP(), tmap );
-        
+        CCode = new TMLModelCompiler(directory, applicationName, mgui.frame, mgui.getAllTMLCP(), tmap);
+
         // Issue #98: Use the passed directory
         File dir = new File(directory /*ConfigurationTTool.CCodeDirectory*/ + File.separator);
-    	
-        if ( !dir.exists() ) {
-    		dir.mkdirs();
+
+        if (!dir.exists()) {
+            dir.mkdirs();
         }
-        
+
         CCode.toTextFormat();
-        
+
         try {
-            if( directory.equals("") )  {
+            if (directory.equals("")) {
 
-                JOptionPane.showMessageDialog(  mgui.frame,
-                                                "No directory for C code generation found in config.xml. The C code cannot be generated.",
-                                                "Control code generation failed", JOptionPane.INFORMATION_MESSAGE );
+                JOptionPane.showMessageDialog(mgui.frame,
+                        "No directory for C code generation found in config.xml. The C code cannot be generated.",
+                        "Control code generation failed", JOptionPane.INFORMATION_MESSAGE);
                 return true;
+            } else {
+                SpecConfigTTool.checkAndCreateCCodeDir(directory);
+                CCode.saveFile(directory + File.separator, applicationName);
             }
-            else {
-            	SpecConfigTTool.checkAndCreateCCodeDir(directory);
-                CCode.saveFile( directory + File.separator, applicationName );
-            }
-        }
-        catch( Exception e ) {
-            JOptionPane.showMessageDialog(  mgui.frame, "The application C files could not be saved: " + e.getMessage(), "Control code generation failed", JOptionPane.INFORMATION_MESSAGE );
+        } catch (Exception e) {
+            JOptionPane.showMessageDialog(mgui.frame, "The application C files could not be saved: " + e.getMessage(), "Control code generation failed", JOptionPane.INFORMATION_MESSAGE);
             return true;
         }
         return false;
     }
 
-    public boolean generateTMLTxt( String _title ) {
-    	
+    public boolean generateTMLTxt(String _title) {
+
         //This branch is activated if doing the syntax check from the architecture panel.
         //It generates the text TML for the architecture and the application + mapping information
         if (tmap != null) {
-            TMLMappingTextSpecification<TGComponent> spec = new TMLMappingTextSpecification<>( _title );
-            spec.toTextFormat( tmap );    //TMLMapping
+            TMLMappingTextSpecification<TGComponent> spec = new TMLMappingTextSpecification<>(_title);
+            spec.toTextFormat(tmap);    //TMLMapping
             try {
                 //TraceManager.addDev( "*** " + ConfigurationTTool.TMLCodeDirectory + File.separator );
-                spec.saveFile( SpecConfigTTool.TMLCodeDirectory, "spec" );
-            }
-            catch( Exception e ) {
-                TraceManager.addError( "Files could not be saved: " + e.getMessage() );
+                spec.saveFile(SpecConfigTTool.TMLCodeDirectory, "spec");
+            } catch (Exception e) {
+                TraceManager.addError("Files could not be saved: " + e.getMessage());
                 return false;
             }
         }
 
-        if( tmlcp != null )      {         //Use the data structure filled by translateToTML... and pass it to the appropriate toTextFormat()
-            TraceManager.addError( "About to generate the TMLText for CPs" );
-            TMLCPTextSpecification specCP = new TMLCPTextSpecification( _title );
+        if (tmlcp != null) {         //Use the data structure filled by translateToTML... and pass it to the appropriate toTextFormat()
+            TraceManager.addError("About to generate the TMLText for CPs");
+            TMLCPTextSpecification specCP = new TMLCPTextSpecification(_title);
 
             //get the architecture panel and the nodes
             TMLArchiDiagramPanel tmlap = mgui.getTMLArchiDiagramPanels().get(0).tmlap;
@@ -533,49 +523,47 @@ public class GTURTLEModeling {
             Iterator<TGComponent> iterator = components.listIterator();
             TGComponent tgc;
 
-            while(iterator.hasNext()) {
+            while (iterator.hasNext()) {
                 tgc = iterator.next();
 
                 if (tgc instanceof TMLArchiCPNode) {
                     TMLArchiCPNode node = (TMLArchiCPNode) tgc;
-                    TraceManager.addDev( "Found CP node: " + node.getName() );
-                    TraceManager.addDev( "with mapping info: " + node.getMappedUnits() );
+                    TraceManager.addDev("Found CP node: " + node.getName());
+                    TraceManager.addDev("with mapping info: " + node.getMappedUnits());
                 }
             }
 
             List<TMLCommunicationPatternPanel> tmlcpPanelsList = new ArrayList<TMLCommunicationPatternPanel>();
             //get the TMLCommunicationPatternPanels :)
-            for( int i = 0; i < mgui.tabs.size(); i++ ) {
+            for (int i = 0; i < mgui.tabs.size(); i++) {
                 TURTLEPanel panel = mgui.tabs.get(i);
 
-                if( panel instanceof TMLCommunicationPatternPanel )      {
-                    tmlcpPanelsList.add( (TMLCommunicationPatternPanel) panel );
-                    TraceManager.addDev( "Found TMLCommunicationPatternPanel: " + panel.toString() );
+                if (panel instanceof TMLCommunicationPatternPanel) {
+                    tmlcpPanelsList.add((TMLCommunicationPatternPanel) panel);
+                    TraceManager.addDev("Found TMLCommunicationPatternPanel: " + panel.toString());
                 }
             }
 
-            specCP.toTextFormat( tmlcp );          // the data structure tmlcp is filled with the info concerning the CP panel
+            specCP.toTextFormat(tmlcp);          // the data structure tmlcp is filled with the info concerning the CP panel
             // from which the button is pressed. If there are multiple CP panels this operation must be repeated for each panel. It
             // should be no difficult to implement.
             try {
-                specCP.saveFile( SpecConfigTTool.TMLCodeDirectory, "spec.tmlcp" );
-            }
-            catch( Exception e ) {
-                TraceManager.addError( "Writing TMLText for CPs, file could not be saved: " + e.getMessage() );
+                specCP.saveFile(SpecConfigTTool.TMLCodeDirectory, "spec.tmlcp");
+            } catch (Exception e) {
+                TraceManager.addError("Writing TMLText for CPs, file could not be saved: " + e.getMessage());
                 return false;
             }
 
         } else if (tmap == null) {
             //This branch is activated if doing the syntax check from the application panel.
             //It only generates the application TML text
-            if( tmap == null ) {
-                TMLTextSpecification<TGComponent> spec = new TMLTextSpecification<>( _title );
-                spec.toTextFormat( tmlm );        //TMLModeling
+            if (tmap == null) {
+                TMLTextSpecification<TGComponent> spec = new TMLTextSpecification<>(_title);
+                spec.toTextFormat(tmlm);        //TMLModeling
                 try {
-                    spec.saveFile( SpecConfigTTool.TMLCodeDirectory, "spec.tml" );
-                }
-                catch( Exception e ) {
-                    TraceManager.addError( "File could not be saved: " + e.getMessage() );
+                    spec.saveFile(SpecConfigTTool.TMLCodeDirectory, "spec.tml");
+                } catch (Exception e) {
+                    TraceManager.addError("File could not be saved: " + e.getMessage());
                     return false;
                 }
             }
@@ -600,10 +588,10 @@ public class GTURTLEModeling {
 
         try {
             TraceManager.addDev("Saving specification in " + path + "\n");
-            
+
             // DB: Moved from TURTLE2UPPAAL (introduced for project management)
-    		SpecConfigTTool.checkAndCreateUPPAALDir(path);
-    		
+            SpecConfigTTool.checkAndCreateUPPAALDir(path);
+
             turtle2uppaal.saveInFile(path);
             TraceManager.addDev("UPPAAL specification has been generated in " + path + "\n");
             return true;
@@ -661,35 +649,35 @@ public class GTURTLEModeling {
         return avatarspec;
     }
 
-    public AVATAR2UPPAAL getAvatar2Uppaal(){
+    public AVATAR2UPPAAL getAvatar2Uppaal() {
         return avatar2uppaal;
     }
 
-    public ProVerifOutputAnalyzer getProVerifOutputAnalyzer () {
-        return this.avatar2proverif.getOutputAnalyzer ();
+    public ProVerifOutputAnalyzer getProVerifOutputAnalyzer() {
+        return this.avatar2proverif.getOutputAnalyzer();
     }
 
-    public boolean generateProVerifFromAVATAR(String _path, int _stateReachability, boolean _typed, boolean allowPrivateChannelDuplication){
+    public boolean generateProVerifFromAVATAR(String _path, int _stateReachability, boolean _typed, boolean allowPrivateChannelDuplication) {
         return generateProVerifFromAVATAR(_path, _stateReachability, _typed, allowPrivateChannelDuplication, "1");
     }
 
-    public int calcSec(){
-        int overhead=0;
+    public int calcSec() {
+        int overhead = 0;
         //count # of insecure channels?
         return overhead;
     }
 
-    public boolean channelAllowed(TMLMapping<TGComponent> map, TMLChannel chan){
+    public boolean channelAllowed(TMLMapping<TGComponent> map, TMLChannel chan) {
         TMLTask orig = chan.getOriginTask();
         TMLTask dest = chan.getDestinationTask();
-        List<HwNode> path = getPath(map,orig, dest);
-        for (HwNode node:path){
-            if (node instanceof HwBridge){
-                for (String rule:((HwBridge) node).firewallRules){
+        List<HwNode> path = getPath(map, orig, dest);
+        for (HwNode node : path) {
+            if (node instanceof HwBridge) {
+                for (String rule : ((HwBridge) node).firewallRules) {
                     String t1 = rule.split("->")[0];
                     String t2 = rule.split("->")[1];
-                    if (t1.equals(orig.getName().replaceAll("__","::")) || t1.equals("*")){
-                        if (t2.equals(dest.getName().replaceAll("__","::")) || t2.equals("*")){
+                    if (t1.equals(orig.getName().replaceAll("__", "::")) || t1.equals("*")) {
+                        if (t2.equals(dest.getName().replaceAll("__", "::")) || t2.equals("*")) {
                             return false;
                         }
                     }
@@ -699,22 +687,22 @@ public class GTURTLEModeling {
         return true;
     }
 
-    public List<HwNode> getPath(TMLMapping<TGComponent> map, TMLTask t1, TMLTask t2){
+    public List<HwNode> getPath(TMLMapping<TGComponent> map, TMLTask t1, TMLTask t2) {
         HwNode node1 = map.getHwNodeOf(t1);
         HwNode node2 = map.getHwNodeOf(t2);
         List<HwNode> path = new ArrayList<HwNode>();
-        if (node1==node2){
+        if (node1 == node2) {
             return path;
         }
-        if (node1!=node2){
+        if (node1 != node2) {
             //Navigate architecture for node
             List<HwLink> links = map.getTMLArchitecture().getHwLinks();
             //  HwNode last = node1;
             List<HwNode> found = new ArrayList<HwNode>();
             List<HwNode> done = new ArrayList<HwNode>();
             Map<HwNode, List<HwNode>> pathMap = new HashMap<HwNode, List<HwNode>>();
-            for (HwLink link: links){
-                if (link.hwnode == node1){
+            for (HwLink link : links) {
+                if (link.hwnode == node1) {
                     found.add(link.bus);
                     List<HwNode> tmp = new ArrayList<HwNode>();
                     tmp.add(link.bus);
@@ -722,23 +710,22 @@ public class GTURTLEModeling {
                 }
             }
             outerloop:
-            while (found.size()>0){
+            while (found.size() > 0) {
                 HwNode curr = found.remove(0);
-                for (HwLink link: links){
-                    if (curr == link.bus){
-                        if (link.hwnode == node2){
+                for (HwLink link : links) {
+                    if (curr == link.bus) {
+                        if (link.hwnode == node2) {
                             path = pathMap.get(curr);
                             break outerloop;
                         }
-                        if (!done.contains(link.hwnode) && !found.contains(link.hwnode) && link.hwnode instanceof HwBridge){
+                        if (!done.contains(link.hwnode) && !found.contains(link.hwnode) && link.hwnode instanceof HwBridge) {
                             found.add(link.hwnode);
                             List<HwNode> tmp = new ArrayList<HwNode>(pathMap.get(curr));
                             tmp.add(link.hwnode);
                             pathMap.put(link.hwnode, tmp);
                         }
-                    }
-                    else if (curr == link.hwnode){
-                        if (!done.contains(link.bus) && !found.contains(link.bus)){
+                    } else if (curr == link.hwnode) {
+                        if (!done.contains(link.bus) && !found.contains(link.bus)) {
                             found.add(link.bus);
                             List<HwNode> tmp = new ArrayList<HwNode>(pathMap.get(curr));
                             tmp.add(link.bus);
@@ -751,214 +738,211 @@ public class GTURTLEModeling {
         }
         return path;
     }
-    public TMLMapping<TGComponent> drawFirewall(TMLMapping<TGComponent> map){
+
+    public TMLMapping<TGComponent> drawFirewall(TMLMapping<TGComponent> map) {
         System.out.println("DRAWING FIREWALL");
-		TGComponent comp= map.getTMLModeling().getTGComponent();
-		TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) comp.getTDiagramPanel().tp;
-       // TMLComponentDesignPanel tmlcdp = map.getTMLCDesignPanel();
+        TGComponent comp = map.getTMLModeling().getTGComponent();
+        TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) comp.getTDiagramPanel().tp;
+        // TMLComponentDesignPanel tmlcdp = map.getTMLCDesignPanel();
         TMLModeling<TGComponent> tmlm = map.getTMLModeling();
-		TMLArchitecture archi = map.getArch();
-		TURTLEPanel tmlap = map.getCorrespondanceList().getTG(archi.getFirstCPU()).getTDiagramPanel().tp;
+        TMLArchitecture archi = map.getArch();
+        TURTLEPanel tmlap = map.getCorrespondanceList().getTG(archi.getFirstCPU()).getTDiagramPanel().tp;
         TMLActivityDiagramPanel firewallADP = null;
         TMLComponentTaskDiagramPanel tcdp = tmlcdp.tmlctdp;
-        if (TraceManager.devPolicy == TraceManager.TO_CONSOLE){
+        if (TraceManager.devPolicy == TraceManager.TO_CONSOLE) {
             MainGUI gui = tmlcdp.getMainGUI();
 
             int arch = mgui.tabs.indexOf(tmlap);
-            gui.cloneRenameTab(arch,"firewallArch");
-            TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size()-1);
+            gui.cloneRenameTab(arch, "firewallArch");
+            TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size() - 1);
             int ind = gui.tabs.indexOf(tmlcdp);
             String tabName = gui.getTitleAt(tmlcdp);
             gui.cloneRenameTab(ind, "firewallDesign");
             //  TMLComponentDesignPanel tcp = (TMLComponentDesignPanel) gui.tabs.get(gui.tabs.size()-1);
-            newarch.renameMapping(tabName, tabName+"_firewallDesign");
+            newarch.renameMapping(tabName, tabName + "_firewallDesign");
 
         }
-        for (HwBridge firewallNode:map.getTMLArchitecture().getFirewalls()){
+        for (HwBridge firewallNode : map.getTMLArchitecture().getFirewalls()) {
             TraceManager.addDev("Found firewall " + firewallNode.getName());
             TMLCPrimitiveComponent firewallComp = null;
-            TMLADStartState adStart=null;
+            TMLADStartState adStart = null;
             TMLADForEverLoop adLoop = null;
-            TMLADChoice adChoice =null;
-            TMLADReadChannel adRC=null;
-            TMLADExecI exec=null;
-            TMLADWriteChannel adWC=null;
-            TMLADStopState adStop =null;
-
+            TMLADChoice adChoice = null;
+            TMLADReadChannel adRC = null;
+            TMLADExecI exec = null;
+            TMLADWriteChannel adWC = null;
+            TMLADStopState adStop = null;
 
 
             int links = map.getArch().getLinkByHwNode(firewallNode).size();
             TraceManager.addDev("Links " + links);
 
             HwCPU cpu = new HwCPU(firewallNode.getName());
-            map.getTMLArchitecture().replaceFirewall(firewallNode,cpu);
-            for (int link =0; link< links/2; link++){
+            map.getTMLArchitecture().replaceFirewall(firewallNode, cpu);
+            for (int link = 0; link < links / 2; link++) {
                 HashMap<TMLChannel, TMLChannel> inChans = new HashMap<TMLChannel, TMLChannel>();
                 HashMap<TMLChannel, TMLChannel> outChans = new HashMap<TMLChannel, TMLChannel>();
-                if (TraceManager.devPolicy == TraceManager.TO_CONSOLE){
+                if (TraceManager.devPolicy == TraceManager.TO_CONSOLE) {
                     firewallComp = new TMLCPrimitiveComponent(0, 0, tmlcdp.tmlctdp.getMinX(), tmlcdp.tmlctdp.getMaxX(), tmlcdp.tmlctdp.getMinY(), tmlcdp.tmlctdp.getMaxY(), false, null, tmlcdp.tmlctdp);
-                    tmlcdp.tmlctdp.addComponent(firewallComp,0,0,false,true);
-                    firewallComp.setValueWithChange(firewallNode.getName()+link);
-                    firewallADP = tmlcdp.getTMLActivityDiagramPanel(firewallNode.getName()+link);
+                    tmlcdp.tmlctdp.addComponent(firewallComp, 0, 0, false, true);
+                    firewallComp.setValueWithChange(firewallNode.getName() + link);
+                    firewallADP = tmlcdp.getTMLActivityDiagramPanel(firewallNode.getName() + link);
                 }
 
                 List<TMLChannel> channelsCopy = tmlm.getChannels();
                 List<TMLChannel> toAdd = new ArrayList<TMLChannel>();
 
-                TMLTask firewall = new TMLTask("TASK__"+firewallNode.getName()+"_"+link, firewallComp,firewallADP);
+                TMLTask firewall = new TMLTask("TASK__" + firewallNode.getName() + "_" + link, firewallComp, firewallADP);
 
 
                 tmlm.addTask(firewall);
-                map.addTaskToHwExecutionNode(firewall,cpu);
+                map.addTaskToHwExecutionNode(firewall, cpu);
                 TMLActivity act = firewall.getActivityDiagram();
 
                 TraceManager.addDev("FirewallADP " + firewallADP);
-                for (TMLChannel chan: channelsCopy){
+                for (TMLChannel chan : channelsCopy) {
                     TMLTask orig = chan.getOriginTask();
                     TMLTask dest = chan.getDestinationTask();
                     TMLPort origPort = chan.getOriginPort();
                     TMLPort destPort = chan.getDestinationPort();
-                    TMLChannel wr = new TMLChannel(chan.getName()+"_firewallIn"+link,chan.getReferenceObject());
+                    TMLChannel wr = new TMLChannel(chan.getName() + "_firewallIn" + link, chan.getReferenceObject());
                     //Specify new channel attributes
                     wr.setSize(chan.getSize());
                     wr.setMax(chan.getMax());
-                    wr.setPorts(origPort,destPort);
+                    wr.setPorts(origPort, destPort);
                     wr.setType(TMLChannel.BRBW);
                     wr.setPriority(chan.getPriority());
                     wr.setTasks(orig, firewall);
-                    TMLChannel rd = new TMLChannel(chan.getName()+"_firewallOut"+link, chan.getReferenceObject());
-                    rd.setTasks(firewall,dest);
+                    TMLChannel rd = new TMLChannel(chan.getName() + "_firewallOut" + link, chan.getReferenceObject());
+                    rd.setTasks(firewall, dest);
                     rd.setSize(chan.getSize());
                     rd.setMax(chan.getMax());
-                    rd.setPorts(origPort,destPort);
+                    rd.setPorts(origPort, destPort);
                     rd.setType(TMLChannel.BRBW);
                     rd.setPriority(chan.getPriority());
-                    inChans.put(chan,wr);
-                    outChans.put(chan,rd);
+                    inChans.put(chan, wr);
+                    outChans.put(chan, rd);
                     toAdd.add(rd);
                     toAdd.add(wr);
                     map.getCorrespondanceList().addCor(rd, (TGComponent) rd.getReferenceObject());
                     map.getCorrespondanceList().addCor(wr, (TGComponent) wr.getReferenceObject());
                 }
                 tmlm.removeAllChannels();
-                for (TMLChannel c:toAdd){
+                for (TMLChannel c : toAdd) {
                     tmlm.addChannel(c);
                 }
 
 
-                if (TraceManager.devPolicy == TraceManager.TO_CONSOLE){
+                if (TraceManager.devPolicy == TraceManager.TO_CONSOLE) {
                     //Build activity diagram
                     //Get start state
                     adStart = (TMLADStartState) firewallADP.getComponentList().get(0);
                     //add loop
-                    adLoop = new TMLADForEverLoop(400,150,firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
-                    firewallADP.addComponent(adLoop,400,150,false,true);
-                    TGConnector tmp =new TGConnectorTMLAD(adLoop.getX(), adLoop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,adStart.getTGConnectingPointAtIndex(0),adLoop.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                    firewallADP.addComponent(tmp, adLoop.getX(),adLoop.getY(),false,true);
+                    adLoop = new TMLADForEverLoop(400, 150, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
+                    firewallADP.addComponent(adLoop, 400, 150, false, true);
+                    TGConnector tmp = new TGConnectorTMLAD(adLoop.getX(), adLoop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, adStart.getTGConnectingPointAtIndex(0), adLoop.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                    firewallADP.addComponent(tmp, adLoop.getX(), adLoop.getY(), false, true);
                     //add choice
-                    adChoice = new TMLADChoice(400,300, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
-                    firewallADP.addComponent(adChoice, 400,300,false,true);
+                    adChoice = new TMLADChoice(400, 300, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
+                    firewallADP.addComponent(adChoice, 400, 300, false, true);
 
-                    tmp =new TGConnectorTMLAD(adChoice.getX(), adChoice.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,adLoop.getTGConnectingPointAtIndex(1), adChoice.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                    firewallADP.addComponent(tmp, adChoice.getX(),adChoice.getY(),false,true);
-                    for (TMLChannel chan: inChans.keySet()){
+                    tmp = new TGConnectorTMLAD(adChoice.getX(), adChoice.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, adLoop.getTGConnectingPointAtIndex(1), adChoice.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                    firewallADP.addComponent(tmp, adChoice.getX(), adChoice.getY(), false, true);
+                    for (TMLChannel chan : inChans.keySet()) {
                         TMLChannel newChan = inChans.get(chan);
                         TMLCChannelOutPort originPort = new TMLCChannelOutPort(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp);
                         TMLCChannelOutPort destPort = new TMLCChannelOutPort(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp);
-                        for (TGComponent tg: tcdp.getComponentList()){
-                            if (tg instanceof TMLCPrimitiveComponent){
-                                if (tg.getValue().equals(newChan.getOriginTask().getName().split("__")[1])){
+                        for (TGComponent tg : tcdp.getComponentList()) {
+                            if (tg instanceof TMLCPrimitiveComponent) {
+                                if (tg.getValue().equals(newChan.getOriginTask().getName().split("__")[1])) {
                                     originPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                    originPort.commName=newChan.getName();
-                                    tcdp.addComponent(originPort,tg.getX(), tg.getY(),true,true);
-                                }
-                                else if (tg.getValue().equals(firewallNode.getName())){
+                                    originPort.commName = newChan.getName();
+                                    tcdp.addComponent(originPort, tg.getX(), tg.getY(), true, true);
+                                } else if (tg.getValue().equals(firewallNode.getName())) {
                                     destPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                    destPort.isOrigin=false;
-                                    destPort.commName=newChan.getName();
-                                    tcdp.addComponent(destPort,tg.getX(), tg.getY(),true,true);
+                                    destPort.isOrigin = false;
+                                    destPort.commName = newChan.getName();
+                                    tcdp.addComponent(destPort, tg.getX(), tg.getY(), true, true);
                                 }
                             }
                         }
                         TMLCPortConnector conn = new TMLCPortConnector(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp, originPort.getTGConnectingPointAtIndex(0), destPort.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        tcdp.addComponent(conn, 0,0,false,true);
+                        tcdp.addComponent(conn, 0, 0, false, true);
 
                         TMLChannel wrChan = outChans.get(chan);
-                        for (TGComponent tg: tcdp.getComponentList()){
-                            if (tg instanceof TMLCPrimitiveComponent){
-                                if (tg.getValue().equals(firewallNode.getName())){
+                        for (TGComponent tg : tcdp.getComponentList()) {
+                            if (tg instanceof TMLCPrimitiveComponent) {
+                                if (tg.getValue().equals(firewallNode.getName())) {
                                     originPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                    originPort.commName=wrChan.getName();
-                                    tcdp.addComponent(originPort,tg.getX(), tg.getY(),true,true);
-                                }
-                                else if (tg.getValue().equals(wrChan.getDestinationTask().getName().split("__")[1])){
+                                    originPort.commName = wrChan.getName();
+                                    tcdp.addComponent(originPort, tg.getX(), tg.getY(), true, true);
+                                } else if (tg.getValue().equals(wrChan.getDestinationTask().getName().split("__")[1])) {
                                     destPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                    destPort.isOrigin=false;
-                                    destPort.commName=wrChan.getName();
-                                    tcdp.addComponent(destPort,tg.getX(), tg.getY(),true,true);
+                                    destPort.isOrigin = false;
+                                    destPort.commName = wrChan.getName();
+                                    tcdp.addComponent(destPort, tg.getX(), tg.getY(), true, true);
                                 }
                             }
                         }
                         conn = new TMLCPortConnector(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp, originPort.getTGConnectingPointAtIndex(0), destPort.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        tcdp.addComponent(conn, 0,0,false,true);
+                        tcdp.addComponent(conn, 0, 0, false, true);
                     }
-                    int xpos=200;
-                    int i=1;
-                    for (TMLChannel chan: inChans.keySet()){
+                    int xpos = 200;
+                    int i = 1;
+                    for (TMLChannel chan : inChans.keySet()) {
                         TMLChannel newChan = inChans.get(chan);
-                        adRC = new TMLADReadChannel(xpos,350, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
+                        adRC = new TMLADReadChannel(xpos, 350, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
                         adRC.setChannelName(newChan.getName());
                         adRC.setSamples("1");
 
-                        tmp =new TGConnectorTMLAD(adRC.getX(), adRC.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,adChoice.getTGConnectingPointAtIndex(i), adRC.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        firewallADP.addComponent(tmp, adRC.getX(),adRC.getY(),false,true);
+                        tmp = new TGConnectorTMLAD(adRC.getX(), adRC.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, adChoice.getTGConnectingPointAtIndex(i), adRC.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                        firewallADP.addComponent(tmp, adRC.getX(), adRC.getY(), false, true);
 
-                        firewallADP.addComponent(adRC,xpos,350,false,true);
+                        firewallADP.addComponent(adRC, xpos, 350, false, true);
 
                         //Execute for latency value
-                        exec = new TMLADExecI(xpos,400,firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
+                        exec = new TMLADExecI(xpos, 400, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
 
                         exec.setDelayValue(Integer.toString(firewallNode.latency));
-                        firewallADP.addComponent(exec,400,200,false,true);
+                        firewallADP.addComponent(exec, 400, 200, false, true);
 
-                        tmp =new TGConnectorTMLAD(exec.getX(), exec.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,adRC.getTGConnectingPointAtIndex(1), exec.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        firewallADP.addComponent(tmp, exec.getX(),exec.getY(),false,true);
+                        tmp = new TGConnectorTMLAD(exec.getX(), exec.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, adRC.getTGConnectingPointAtIndex(1), exec.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                        firewallADP.addComponent(tmp, exec.getX(), exec.getY(), false, true);
 
-                        if (channelAllowed(map,chan)){
+                        if (channelAllowed(map, chan)) {
                             TMLChannel wrChan = outChans.get(chan);
 
-                            adWC = new TMLADWriteChannel(xpos,400, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
+                            adWC = new TMLADWriteChannel(xpos, 400, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
                             adWC.setChannelName(wrChan.getName());
                             adWC.setSamples("1");
-                            firewallADP.addComponent(adWC, xpos,400, false,true);
+                            firewallADP.addComponent(adWC, xpos, 400, false, true);
 
-                            tmp =new TGConnectorTMLAD(exec.getX(), exec.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,exec.getTGConnectingPointAtIndex(1), adWC.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                            firewallADP.addComponent(tmp, exec.getX(),exec.getY(),false,true);
+                            tmp = new TGConnectorTMLAD(exec.getX(), exec.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, exec.getTGConnectingPointAtIndex(1), adWC.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                            firewallADP.addComponent(tmp, exec.getX(), exec.getY(), false, true);
 
-                            adStop = new TMLADStopState(xpos,500, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
-                            firewallADP.addComponent(adStop, xpos,500, false,true);
-                            tmp =new TGConnectorTMLAD(adStop.getX(), adStop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,adWC.getTGConnectingPointAtIndex(1), adStop.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                            firewallADP.addComponent(tmp, adStop.getX(),adStop.getY(),false,true);
-                        }
-                        else {
-                            adStop = new TMLADStopState(xpos,500, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false,null, firewallADP);
-                            firewallADP.addComponent(adStop, xpos,500, false,true);
+                            adStop = new TMLADStopState(xpos, 500, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
+                            firewallADP.addComponent(adStop, xpos, 500, false, true);
+                            tmp = new TGConnectorTMLAD(adStop.getX(), adStop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, adWC.getTGConnectingPointAtIndex(1), adStop.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                            firewallADP.addComponent(tmp, adStop.getX(), adStop.getY(), false, true);
+                        } else {
+                            adStop = new TMLADStopState(xpos, 500, firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP);
+                            firewallADP.addComponent(adStop, xpos, 500, false, true);
 
-                            tmp =new TGConnectorTMLAD(adStop.getX(), adStop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null,firewallADP,exec.getTGConnectingPointAtIndex(1), adStop.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                            firewallADP.addComponent(tmp, adStop.getX(),adStop.getY(),false,true);
+                            tmp = new TGConnectorTMLAD(adStop.getX(), adStop.getY(), firewallADP.getMinX(), firewallADP.getMaxX(), firewallADP.getMinY(), firewallADP.getMaxY(), false, null, firewallADP, exec.getTGConnectingPointAtIndex(1), adStop.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                            firewallADP.addComponent(tmp, adStop.getX(), adStop.getY(), false, true);
                         }
-                        xpos+=100;
+                        xpos += 100;
                         i++;
                     }
                 }
 
                 TMLStartState start = new TMLStartState("start", adStart);
                 act.setFirst(start);
-                map.getCorrespondanceList().addCor(start,adStart);
+                map.getCorrespondanceList().addCor(start, adStart);
 
                 //Add infinite loop
 
-                TMLForLoop loop = new TMLForLoop("infiniteloop",adLoop);
+                TMLForLoop loop = new TMLForLoop("infiniteloop", adLoop);
                 loop.setInit("");
                 loop.setCondition("");
                 loop.setIncrement("");
@@ -970,12 +954,10 @@ public class GTURTLEModeling {
                 TMLChoice choice = new TMLChoice("chooseChannel", adChoice);
                 act.addElement(choice);
                 loop.addNext(choice);
-                map.getCorrespondanceList().addCor(choice,adChoice);
-
+                map.getCorrespondanceList().addCor(choice, adChoice);
 
 
-
-                for (TMLChannel chan: inChans.keySet()){
+                for (TMLChannel chan : inChans.keySet()) {
                     TMLChannel newChan = inChans.get(chan);
                     TMLChannel wrChan = outChans.get(chan);
                     //Add channels into firewall activity diagram
@@ -994,7 +976,7 @@ public class GTURTLEModeling {
                     act.addElement(ex);
                     rd.addNext(ex);
 
-                    if (channelAllowed(map,chan)){
+                    if (channelAllowed(map, chan)) {
 
                         TMLWriteChannel wr = new TMLWriteChannel(wrChan.getName(), adWC);
                         wr.setNbOfSamples("1");
@@ -1006,15 +988,14 @@ public class GTURTLEModeling {
                         wr.addNext(stop);
                         act.addElement(stop);
 
-                    }
-                    else {
+                    } else {
                         TMLStopState stop = new TMLStopState("stop", adStop);
                         ex.addNext(stop);
                         act.addElement(stop);
                     }
-                    for (TMLTask t:tmlm.getTasks()){
+                    for (TMLTask t : tmlm.getTasks()) {
                         TMLActivity actd = t.getActivityDiagram();
-                        actd.replaceWriteChannelWith(chan,newChan);
+                        actd.replaceWriteChannelWith(chan, newChan);
                         actd.replaceReadChannelWith(chan, outChans.get(chan));
                     }
                 }
@@ -1032,40 +1013,43 @@ public class GTURTLEModeling {
         public String name;
         public boolean isOrigin;
         public boolean isChan;
-        public ChannelData(String n, boolean orig, boolean isCh){
-            name=n;
-            isOrigin=orig;
-            isChan=isCh;
+
+        public ChannelData(String n, boolean orig, boolean isCh) {
+            name = n;
+            isOrigin = orig;
+            isChan = isCh;
         }
 
     }
+
     class HSMChannel {
         public String name;
-        public static final int SENC=0;
-        public static final int NONCE_ENC=1;
-        public static final int MAC=2;
-        public static final int DEC=3;
-        public static final int AENC=4;
-        public static final int NONCE=5;
+        public static final int SENC = 0;
+        public static final int NONCE_ENC = 1;
+        public static final int MAC = 2;
+        public static final int DEC = 3;
+        public static final int AENC = 4;
+        public static final int NONCE = 5;
         public String task;
-        public String securityContext="";
+        public String securityContext = "";
         public int secType;
-        public String nonceName="";
-        public HSMChannel (String n, String t, int type){
-            name=n;
-            task=t;
-            secType=type;
+        public String nonceName = "";
+
+        public HSMChannel(String n, String t, int type) {
+            name = n;
+            task = t;
+            secType = type;
         }
     }
 
-    public HashMap<String, HashSet<String>> getCPUTaskMap(){
+    public HashMap<String, HashSet<String>> getCPUTaskMap() {
         HashMap<String, HashSet<String>> cpuTaskMap = new HashMap<String, HashSet<String>>();
-        if (tmap ==null){
+        if (tmap == null) {
             return cpuTaskMap;
         }
 
-        for (HwNode node: tmap.getArch().getCPUs()){
-            if (tmap.getMappedTasks(node).size()>0){
+        for (HwNode node : tmap.getArch().getCPUs()) {
+            if (tmap.getMappedTasks(node).size() > 0) {
                 cpuTaskMap.put(node.getName(), tmap.getMappedTasks(node));
             }
         }
@@ -1073,32 +1057,32 @@ public class GTURTLEModeling {
         return cpuTaskMap;
     }
 
-    public void addHSM(MainGUI gui, Map<String, List<String>> selectedCpuTasks){
+    public void addHSM(MainGUI gui, Map<String, List<String>> selectedCpuTasks) {
         System.out.println("Adding HSM");
-        String encComp="100";
-        String decComp="100";
-        String overhead ="0";
-        String name="hsm";
-        if (tmap==null){
+        String encComp = "100";
+        String decComp = "100";
+        String overhead = "0";
+        String name = "hsm";
+        if (tmap == null) {
             return;
         }
         //Clone diagrams
-		TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
+        TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
         int arch = gui.tabs.indexOf(tmlap);
-        gui.cloneRenameTab(arch,"hsm");
-        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size()-1);
+        gui.cloneRenameTab(arch, "hsm");
+        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size() - 1);
 
-		TGComponent tgcomp= tmap.getTMLModeling().getTGComponent();
-		TMLComponentDesignPanel tmlcdp= (TMLComponentDesignPanel) tgcomp.getTDiagramPanel().tp;
+        TGComponent tgcomp = tmap.getTMLModeling().getTGComponent();
+        TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) tgcomp.getTDiagramPanel().tp;
 
 //        TMLComponentDesignPanel tmlcdp = tmap.getTMLCDesignPanel();
         int ind = gui.tabs.indexOf(tmlcdp);
         String tabName = gui.getTitleAt(tmlcdp);
         gui.cloneRenameTab(ind, name);
-        TMLComponentDesignPanel t = (TMLComponentDesignPanel) gui.tabs.get(gui.tabs.size()-1);
+        TMLComponentDesignPanel t = (TMLComponentDesignPanel) gui.tabs.get(gui.tabs.size() - 1);
         TMLComponentTaskDiagramPanel tcdp = t.tmlctdp;
         //Create clone of architecture panel and map tasks to it
-        newarch.renameMapping(tabName, tabName+"_"+name);
+        newarch.renameMapping(tabName, tabName + "_" + name);
 
 
         //ProVerif analysis
@@ -1110,32 +1094,31 @@ public class GTURTLEModeling {
         TGConnector fromStart;
         Map<String, HSMChannel> secChannels = new HashMap<String, HSMChannel>();
         //Add a HSM for each selected CPU on the component diagram
-        for (String cpuName: selectedCpuTasks.keySet()){
+        for (String cpuName : selectedCpuTasks.keySet()) {
             Map<String, HSMChannel> hsmChannels = new HashMap<String, HSMChannel>();
             TMLCPrimitiveComponent hsm = new TMLCPrimitiveComponent(0, 500, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxY(), false, null, tcdp);
             TAttribute isEnc = new TAttribute(2, "isEnc", "true", 4);
             hsm.getAttributes().add(isEnc);
-            tcdp.addComponent(hsm, 0,500,false,true);
-            hsm.setValueWithChange("HSM_"+cpuName);
+            tcdp.addComponent(hsm, 0, 500, false, true);
+            hsm.setValueWithChange("HSM_" + cpuName);
             //Find all associated components
             List<TMLCPrimitiveComponent> comps = new ArrayList<TMLCPrimitiveComponent>();
             //Find the component to add a HSM to
 
-            for (TGComponent tg: tcdp.getComponentList()){
-                if (tg instanceof TMLCPrimitiveComponent){
-                    for (String compName: selectedCpuTasks.get(cpuName)){
-                        if (tg.getValue().equals(compName)){
+            for (TGComponent tg : tcdp.getComponentList()) {
+                if (tg instanceof TMLCPrimitiveComponent) {
+                    for (String compName : selectedCpuTasks.get(cpuName)) {
+                        if (tg.getValue().equals(compName)) {
                             comps.add((TMLCPrimitiveComponent) tg);
                             break;
                         }
                     }
-                }
-                else if (tg instanceof TMLCCompositeComponent){
+                } else if (tg instanceof TMLCCompositeComponent) {
                     TMLCCompositeComponent cc = (TMLCCompositeComponent) tg;
-                    List<TMLCPrimitiveComponent> pcomps =cc.getAllPrimitiveComponents();
-                    for (TMLCPrimitiveComponent pc: pcomps){
-                        for (String compName: selectedCpuTasks.get(cpuName)){
-                            if (pc.getValue().equals(compName)){
+                    List<TMLCPrimitiveComponent> pcomps = cc.getAllPrimitiveComponents();
+                    for (TMLCPrimitiveComponent pc : pcomps) {
+                        for (String compName : selectedCpuTasks.get(cpuName)) {
+                            if (pc.getValue().equals(compName)) {
                                 comps.add(pc);
                                 break;
                             }
@@ -1143,16 +1126,16 @@ public class GTURTLEModeling {
                     }
                 }
             }
-            if (comps.size()==0){
+            if (comps.size() == 0) {
                 //System.out.println("No Components found");
                 continue;
             }
             //  System.out.println("nonAuthChans " + nonAuthChans);
             //System.out.println("nonSecChans "+ nonSecChans);
-            for (TMLCPrimitiveComponent comp: comps){
+            for (TMLCPrimitiveComponent comp : comps) {
 
                 Map<String, HSMChannel> compChannels = new HashMap<String, HSMChannel>();
-                String compName=comp.getValue();
+                String compName = comp.getValue();
                 TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel(compName);
                 Set<TGComponent> channelInstances = new HashSet<TGComponent>();
                 Set<TGComponent> secOperators = new HashSet<TGComponent>();
@@ -1161,90 +1144,84 @@ public class GTURTLEModeling {
                 //Find all unsecured channels
                 //For previously secured channels, relocate encryption to the hsm
 
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADWriteChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADWriteChannel) {
                         TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg;
-                        if (writeChannel.getSecurityContext().equals("")){
-                            String nonceName="";
-                            int type=-1;
-                            if (nonSecChans.contains(compName+"__"+writeChannel.getChannelName()+"_chData")){
-                                type=HSMChannel.SENC;
-                                if (nonAuthChans.contains(compName+"__"+writeChannel.getChannelName())){
-                                    nonceName="nonce_"+writeChannel.getChannelName();
+                        if (writeChannel.getSecurityContext().equals("")) {
+                            String nonceName = "";
+                            int type = -1;
+                            if (nonSecChans.contains(compName + "__" + writeChannel.getChannelName() + "_chData")) {
+                                type = HSMChannel.SENC;
+                                if (nonAuthChans.contains(compName + "__" + writeChannel.getChannelName())) {
+                                    nonceName = "nonce_" + writeChannel.getChannelName();
                                 }
+                            } else if (nonAuthChans.contains(compName + "__" + writeChannel.getChannelName())) {
+                                type = HSMChannel.MAC;
                             }
-                            else if (nonAuthChans.contains(compName+"__"+writeChannel.getChannelName())){
-                                type=HSMChannel.MAC;
-                            }
-                            HSMChannel ch=new HSMChannel(writeChannel.getChannelName(), compName, type);
-                            ch.securityContext="hsmSec_"+writeChannel.getChannelName();
-                            ch.nonceName=nonceName;
+                            HSMChannel ch = new HSMChannel(writeChannel.getChannelName(), compName, type);
+                            ch.securityContext = "hsmSec_" + writeChannel.getChannelName();
+                            ch.nonceName = nonceName;
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
-                                if (type!=-1){
-                                    compChannels.put(writeChannel.getChannelName(),ch);
+                            if (fromStart != null) {
+                                if (type != -1) {
+                                    compChannels.put(writeChannel.getChannelName(), ch);
                                     channelInstances.add(tg);
                                 }
                             }
-                        }
-                        else {
+                        } else {
                             //System.out.println("security context:"+writeChannel.securityContext);
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                                 SecurityPattern sp = tmap.getSecurityPatternByName(writeChannel.getSecurityContext());
-                                int type=-1;
-                                if (sp.type.equals("Symmetric Encryption")){
-                                    type=HSMChannel.SENC;
-                                }
-                                else if (sp.type.equals("Asymmetric Encryption")){
-                                    type=HSMChannel.AENC;
-                                }
-                                else if (sp.type.equals("MAC")){
-                                    type=HSMChannel.MAC;
-                                }
-                                else if (sp.type.equals("Nonce")){
-                                    type=HSMChannel.NONCE;
+                                int type = -1;
+                                if (sp.type.equals("Symmetric Encryption")) {
+                                    type = HSMChannel.SENC;
+                                } else if (sp.type.equals("Asymmetric Encryption")) {
+                                    type = HSMChannel.AENC;
+                                } else if (sp.type.equals("MAC")) {
+                                    type = HSMChannel.MAC;
+                                } else if (sp.type.equals("Nonce")) {
+                                    type = HSMChannel.NONCE;
                                 }
                                 HSMChannel ch = new HSMChannel(writeChannel.getChannelName(), compName, type);
-                                ch.securityContext=writeChannel.getSecurityContext();
-                                compChannels.put(writeChannel.getChannelName(),ch);
+                                ch.securityContext = writeChannel.getSecurityContext();
+                                compChannels.put(writeChannel.getChannelName(), ch);
                                 //chanNames.add(writeChannel.getChannelName()+compName);
                             }
                         }
                     }
-                    if (tg instanceof TMLADReadChannel){
+                    if (tg instanceof TMLADReadChannel) {
                         TMLADReadChannel readChannel = (TMLADReadChannel) tg;
-                        if (readChannel.getSecurityContext().equals("")){
+                        if (readChannel.getSecurityContext().equals("")) {
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
-                                if(nonSecChans.contains(compName+"__"+readChannel.getChannelName()+"_chData") || nonAuthChans.contains(compName+"__"+readChannel.getChannelName())){
+                            if (fromStart != null) {
+                                if (nonSecChans.contains(compName + "__" + readChannel.getChannelName() + "_chData") || nonAuthChans.contains(compName + "__" + readChannel.getChannelName())) {
                                     channelInstances.add(tg);
                                     HSMChannel ch = new HSMChannel(readChannel.getChannelName(), compName, HSMChannel.DEC);
-                                    ch.securityContext="hsmSec_"+readChannel.getChannelName();
-                                    compChannels.put(readChannel.getChannelName(),ch);
-                                    if (nonSecChans.contains(compName+"__"+readChannel.getChannelName()+"_chData") && nonAuthChans.contains(compName+"__"+readChannel.getChannelName())){
-                                        ch.nonceName="nonce_"+readChannel.getChannelName();
+                                    ch.securityContext = "hsmSec_" + readChannel.getChannelName();
+                                    compChannels.put(readChannel.getChannelName(), ch);
+                                    if (nonSecChans.contains(compName + "__" + readChannel.getChannelName() + "_chData") && nonAuthChans.contains(compName + "__" + readChannel.getChannelName())) {
+                                        ch.nonceName = "nonce_" + readChannel.getChannelName();
                                     }
                                 }
                             }
-                        }
-                        else {
+                        } else {
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                                 HSMChannel ch = new HSMChannel(readChannel.getChannelName(), compName, HSMChannel.DEC);
-                                ch.securityContext=readChannel.getSecurityContext();
-                                compChannels.put(readChannel.getChannelName(),ch);
+                                ch.securityContext = readChannel.getSecurityContext();
+                                compChannels.put(readChannel.getChannelName(), ch);
                             }
                         }
                     }
-                    if (tg instanceof TMLADEncrypt){
+                    if (tg instanceof TMLADEncrypt) {
                         //      TMLADEncrypt enc = (TMLADEncrypt) tg;
                         secOperators.add(tg);
                         //}
                     }
-                    if (tg instanceof TMLADDecrypt){
+                    if (tg instanceof TMLADDecrypt) {
                         //      TMLADDecrypt dec = (TMLADDecrypt) tg;
                         secOperators.add(tg);
                         //}
@@ -1252,59 +1229,59 @@ public class GTURTLEModeling {
                 }
                 //System.out.println("compchannels " +compChannels);
                 List<ChannelData> hsmChans = new ArrayList<ChannelData>();
-                ChannelData chd = new ChannelData("startHSM_"+cpuName,false,false);
+                ChannelData chd = new ChannelData("startHSM_" + cpuName, false, false);
                 hsmChans.add(chd);
-                for (String s: compChannels.keySet()){
-                    hsmChannels.put(s,compChannels.get(s));
-                    chd = new ChannelData("data_"+s+"_"+compChannels.get(s).task,false,true);
+                for (String s : compChannels.keySet()) {
+                    hsmChannels.put(s, compChannels.get(s));
+                    chd = new ChannelData("data_" + s + "_" + compChannels.get(s).task, false, true);
                     hsmChans.add(chd);
-                    chd = new ChannelData("retData_"+s+"_"+compChannels.get(s).task,true,true);
+                    chd = new ChannelData("retData_" + s + "_" + compChannels.get(s).task, true, true);
                     hsmChans.add(chd);
                 }
-                for (ChannelData hsmChan: hsmChans){
-                    TMLCChannelOutPort originPort =new TMLCChannelOutPort(comp.getX(), comp.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, hsm, tcdp);
+                for (ChannelData hsmChan : hsmChans) {
+                    TMLCChannelOutPort originPort = new TMLCChannelOutPort(comp.getX(), comp.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, hsm, tcdp);
                     TMLCChannelOutPort destPort = new TMLCChannelOutPort(comp.getX(), comp.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, comp, tcdp);
-                    originPort.commName=hsmChan.name;
-                    originPort.isOrigin=hsmChan.isOrigin;
-                    tcdp.addComponent(originPort,hsm.getX(), hsm.getY(),true,true);
-                    destPort.commName=hsmChan.name;
-                    if (!hsmChan.isChan){
-                        originPort.typep=2;
-                        destPort.typep=2;
+                    originPort.commName = hsmChan.name;
+                    originPort.isOrigin = hsmChan.isOrigin;
+                    tcdp.addComponent(originPort, hsm.getX(), hsm.getY(), true, true);
+                    destPort.commName = hsmChan.name;
+                    if (!hsmChan.isChan) {
+                        originPort.typep = 2;
+                        destPort.typep = 2;
                         originPort.setParam(0, new TType(2));
                     }
-                    destPort.isOrigin=!hsmChan.isOrigin;
+                    destPort.isOrigin = !hsmChan.isOrigin;
 
-                    tcdp.addComponent(destPort,comp.getX(), comp.getY(),true,true);
+                    tcdp.addComponent(destPort, comp.getX(), comp.getY(), true, true);
 
                     TMLCPortConnector conn = new TMLCPortConnector(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp, originPort.getTGConnectingPointAtIndex(0), destPort.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                    tcdp.addComponent(conn, 0,0,false,true);
+                    tcdp.addComponent(conn, 0, 0, false, true);
                 }
-                int xpos=0;
-                int ypos=0;
+                int xpos = 0;
+                int ypos = 0;
 
                 //Remove existing security elements
-                for (TGComponent op: secOperators){
+                for (TGComponent op : secOperators) {
                     TGConnector prev = tad.findTGConnectorEndingAt(op.getTGConnectingPointAtIndex(0));
                     //TGConnectingPoint point = prev.getTGConnectingPointP1();
                     TGConnector end = tad.findTGConnectorStartingAt(op.getTGConnectingPointAtIndex(1));
                     TGConnectingPoint point2 = end.getTGConnectingPointP2();
                     tad.removeComponent(op);
                     tad.removeComponent(end);
-                    tad.addComponent(prev,0,0,false,true);
+                    tad.addComponent(prev, 0, 0, false, true);
                     prev.setP2(point2);
                 }
 
                 //Modify component activity diagram to add read/write to HSM
 
                 //Add actions before Write Channel
-                for (TGComponent chan: channelInstances){
-                    String chanName="";
-                    if (!(chan instanceof TMLADWriteChannel)){
+                for (TGComponent chan : channelInstances) {
+                    String chanName = "";
+                    if (!(chan instanceof TMLADWriteChannel)) {
                         continue;
                     }
                     TMLADWriteChannel writeChannel = (TMLADWriteChannel) chan;
-                    chanName=writeChannel.getChannelName();
+                    chanName = writeChannel.getChannelName();
                     HSMChannel ch = hsmChannels.get(chanName);
                     writeChannel.setSecurityContext(ch.securityContext);
                     xpos = chan.getX();
@@ -1313,165 +1290,158 @@ public class GTURTLEModeling {
                     TGConnectingPoint point = fromStart.getTGConnectingPointP2();
 
                     //set isEnc to true
-                    int yShift=50;
+                    int yShift = 50;
 
-                    TMLADSendRequest req = new TMLADSendRequest(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    req.setRequestName("startHSM_"+cpuName);
-                    req.setParam(0,"isEnc");
-                    tad.addComponent(req, xpos, ypos+yShift, false,true);
+                    TMLADSendRequest req = new TMLADSendRequest(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    req.setRequestName("startHSM_" + cpuName);
+                    req.setParam(0, "isEnc");
+                    tad.addComponent(req, xpos, ypos + yShift, false, true);
 
                     fromStart.setP2(req.getTGConnectingPointAtIndex(0));
                     tad.addComponent(fromStart, xpos, ypos, false, true);
 
                     //Add connection
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     fromStart.setP1(req.getTGConnectingPointAtIndex(1));
-                    TMLADWriteChannel wr =new TMLADWriteChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    TMLADWriteChannel wr = new TMLADWriteChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
 
-                    yShift+=50;
+                    yShift += 50;
                     //Add write channel operator
-                    wr = new TMLADWriteChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    wr.setChannelName("data_"+chanName+"_"+compName);
+                    wr = new TMLADWriteChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    wr.setChannelName("data_" + chanName + "_" + compName);
                     wr.setSecurityContext(ch.securityContext);
-                    tad.addComponent(wr, xpos, ypos+yShift, false,true);
+                    tad.addComponent(wr, xpos, ypos + yShift, false, true);
 
 
                     fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
                     tad.addComponent(fromStart, xpos, ypos, false, true);
 
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(wr.getTGConnectingPointAtIndex(1));
 
 
-
-
-
-
-
                     //Add read channel operator
 
-                    yShift+=60;
-                    TMLADReadChannel rd = new TMLADReadChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    rd.setChannelName("retData_"+chanName+"_"+compName);
+                    yShift += 60;
+                    TMLADReadChannel rd = new TMLADReadChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    rd.setChannelName("retData_" + chanName + "_" + compName);
                     rd.setSecurityContext(ch.securityContext);
-                    tad.addComponent(rd, xpos, ypos+yShift, false,true);
+                    tad.addComponent(rd, xpos, ypos + yShift, false, true);
 
                     fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
-                    yShift+=50;
+                    yShift += 50;
 
                     //Add connector
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
-                    yShift+=50;
+                    yShift += 50;
 
                     //Direct the last TGConnector back to the start of the write channel operator
 
 
                     fromStart.setP2(point);
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg.getY() >= ypos && tg !=wr && tg!=req && tg!=rd){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg.getY() >= ypos && tg != wr && tg != req && tg != rd) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
 
                 }
                 //Add actions after Read Channel
-                for (TGComponent chan: channelInstances){
-                    String chanName="";
+                for (TGComponent chan : channelInstances) {
+                    String chanName = "";
                     if (!(chan instanceof TMLADReadChannel)) {
                         continue;
                     }
                     TMLADReadChannel readChannel = (TMLADReadChannel) chan;
-                    chanName=readChannel.getChannelName();
-                    HSMChannel ch= hsmChannels.get(chanName);
+                    chanName = readChannel.getChannelName();
+                    HSMChannel ch = hsmChannels.get(chanName);
                     readChannel.setSecurityContext(ch.securityContext);
-                    xpos = chan.getX()+10;
+                    xpos = chan.getX() + 10;
                     ypos = chan.getY();
                     fromStart = tad.findTGConnectorStartingAt(chan.getTGConnectingPointAtIndex(1));
-                    if (fromStart==null){
-                        fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    if (fromStart == null) {
+                        fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(chan.getTGConnectingPointAtIndex(1));
-                        tad.addComponent(fromStart, xpos,ypos,false,true);
+                        tad.addComponent(fromStart, xpos, ypos, false, true);
                     }
                     TGConnectingPoint point = fromStart.getTGConnectingPointP2();
 
                     //Set isEnc to false
-                    int yShift=50;
-                    TMLADActionState act = new TMLADActionState(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    int yShift = 50;
+                    TMLADActionState act = new TMLADActionState(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                     act.setValue("isEnc=false");
-                    tad.addComponent(act, xpos, ypos+yShift, false,true);
+                    tad.addComponent(act, xpos, ypos + yShift, false, true);
                     fromStart.setP2(act.getTGConnectingPointAtIndex(0));
 
 
                     //Add send request operator
 
-                    yShift+=50;
-                    TMLADSendRequest req = new TMLADSendRequest(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    req.setRequestName("startHSM_"+cpuName);
-                    req.setParam(0,"isEnc");
+                    yShift += 50;
+                    TMLADSendRequest req = new TMLADSendRequest(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    req.setRequestName("startHSM_" + cpuName);
+                    req.setParam(0, "isEnc");
                     req.makeValue();
-                    tad.addComponent(req, xpos, ypos+yShift, false,true);
+                    tad.addComponent(req, xpos, ypos + yShift, false, true);
 
 
                     //Add connection
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     fromStart.setP1(act.getTGConnectingPointAtIndex(1));
                     fromStart.setP2(req.getTGConnectingPointAtIndex(0));
                     tad.addComponent(fromStart, xpos, ypos, false, true);
 
 
-
-
-                    yShift+=50;
+                    yShift += 50;
                     //Add write channel operator
-                    TMLADWriteChannel wr = new TMLADWriteChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    wr.setChannelName("data_"+chanName+"_"+compName);
+                    TMLADWriteChannel wr = new TMLADWriteChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    wr.setChannelName("data_" + chanName + "_" + compName);
                     wr.setSecurityContext(ch.securityContext);
-                    tad.addComponent(wr, xpos, ypos+yShift, false,true);
+                    tad.addComponent(wr, xpos, ypos + yShift, false, true);
 
 
                     //Add connection
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     fromStart.setP1(req.getTGConnectingPointAtIndex(1));
                     fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
                     tad.addComponent(fromStart, xpos, ypos, false, true);
 
                     //Add read channel operator
 
-                    yShift+=60;
-                    TMLADReadChannel rd = new TMLADReadChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    rd.setChannelName("retData_"+chanName+"_"+compName);
+                    yShift += 60;
+                    TMLADReadChannel rd = new TMLADReadChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    rd.setChannelName("retData_" + chanName + "_" + compName);
                     rd.setSecurityContext(ch.securityContext);
-                    tad.addComponent(rd, xpos, ypos+yShift, false,true);
+                    tad.addComponent(rd, xpos, ypos + yShift, false, true);
 
-                    fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(wr.getTGConnectingPointAtIndex(1));
                     fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
-                    yShift+=50;
+                    yShift += 50;
 
-                    if (point!=null){
-                        fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    if (point != null) {
+                        fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         //Direct the last TGConnector back to the start of the write channel operator
 
                         fromStart.setP2(point);
                     }
-                    yShift+=50;
+                    yShift += 50;
 
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg.getY() >= ypos && tg !=wr && tg!=req && tg!=rd && tg!=chan && tg!=act){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg.getY() >= ypos && tg != wr && tg != req && tg != rd && tg != chan && tg != act) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
                 }
                 //for (String chan: chanNames){
@@ -1479,208 +1449,197 @@ public class GTURTLEModeling {
                 //}
             }
 
-            int xpos=0;
-            int ypos=0;
-
+            int xpos = 0;
+            int ypos = 0;
 
 
             //Build HSM Activity diagram
 
-            TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel("HSM_"+cpuName);
+            TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel("HSM_" + cpuName);
 
             TMLADStartState start = (TMLADStartState) tad.getComponentList().get(0);
             fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
 
 
             TMLADReadRequestArg req = new TMLADReadRequestArg(300, 100, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-            tad.addComponent(req, 300,100,false,true);
+            tad.addComponent(req, 300, 100, false, true);
             req.setParam(0, "isEnc");
             req.makeValue();
 
             //Connect start and readrequest
             fromStart.setP1(start.getTGConnectingPointAtIndex(0));
             fromStart.setP2(req.getTGConnectingPointAtIndex(0));
-            tad.addComponent(fromStart, 300,200,false,true);
-
+            tad.addComponent(fromStart, 300, 200, false, true);
 
 
             TMLADChoice choice = new TMLADChoice(300, 200, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-            tad.addComponent(choice, 300,200,false,true);
+            tad.addComponent(choice, 300, 200, false, true);
 
 
             //Connect readrequest and choice
             fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
             fromStart.setP1(req.getTGConnectingPointAtIndex(1));
             fromStart.setP2(choice.getTGConnectingPointAtIndex(0));
-            tad.addComponent(fromStart, 300,200,false,true);
+            tad.addComponent(fromStart, 300, 200, false, true);
 
 
             int xc = 150;
             //Allows 9 channels max to simplify the diagram
 
             //If more than 3 channels, build 2 levels of choices
-            TMLADChoice choice2= new TMLADChoice(xc, 400, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-            if (hsmChannels.keySet().size()>3){
-                int i=0;
-                for (String chan: hsmChannels.keySet()){
+            TMLADChoice choice2 = new TMLADChoice(xc, 400, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+            if (hsmChannels.keySet().size() > 3) {
+                int i = 0;
+                for (String chan : hsmChannels.keySet()) {
                     HSMChannel ch = hsmChannels.get(chan);
-                    if (i%3==0){
+                    if (i % 3 == 0) {
                         //Add a new choice every third channel
-                        choice2= new TMLADChoice(xc, 250, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                        tad.addComponent(choice2, xc, 400,false,true);
+                        choice2 = new TMLADChoice(xc, 250, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        tad.addComponent(choice2, xc, 400, false, true);
                         //Connect new choice operator to top choice
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
-                        fromStart.setP1(choice.getTGConnectingPointAtIndex(i/3+1));
+                        fromStart.setP1(choice.getTGConnectingPointAtIndex(i / 3 + 1));
                         fromStart.setP2(choice2.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
                     }
                     TMLADReadChannel rd = new TMLADReadChannel(xc, 300, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    rd.setChannelName("data_"+chan+"_"+hsmChannels.get(chan).task);
+                    rd.setChannelName("data_" + chan + "_" + hsmChannels.get(chan).task);
                     rd.setSecurityContext(ch.securityContext);
-                    tad.addComponent(rd, xc,300,false,true);
+                    tad.addComponent(rd, xc, 300, false, true);
                     //Connect choice and readchannel
                     fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
-                    fromStart.setP1(choice2.getTGConnectingPointAtIndex(i%3+1));
+                    fromStart.setP1(choice2.getTGConnectingPointAtIndex(i % 3 + 1));
                     fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
 
-                    tad.addComponent(fromStart, 300,200,false,true);
+                    tad.addComponent(fromStart, 300, 200, false, true);
                     TMLADWriteChannel wr = new TMLADWriteChannel(xc, 600, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    wr.setChannelName("retData_"+chan+"_"+hsmChannels.get(chan).task);
-                    tad.addComponent(wr, xc, 600,false,true);
+                    wr.setChannelName("retData_" + chan + "_" + hsmChannels.get(chan).task);
+                    tad.addComponent(wr, xc, 600, false, true);
                     wr.setSecurityContext(ch.securityContext);
 
 
-                    if (hsmChannels.get(chan).secType==HSMChannel.DEC){
+                    if (hsmChannels.get(chan).secType == HSMChannel.DEC) {
                         TMLADDecrypt dec = new TMLADDecrypt(xc, 500, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                        dec.securityContext =  ch.securityContext;
-                        tad.addComponent(dec, xc, 500,false,true);
+                        dec.securityContext = ch.securityContext;
+                        tad.addComponent(dec, xc, 500, false, true);
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(dec.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(dec.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                         //Connect encrypt and writechannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(dec.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
-                    }
-                    else {
+                        tad.addComponent(fromStart, 300, 200, false, true);
+                    } else {
                         TMLADEncrypt enc = new TMLADEncrypt(xc, 500, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         enc.securityContext = ch.securityContext;
-                        if (hsmChannels.get(chan).secType==HSMChannel.SENC){
+                        if (hsmChannels.get(chan).secType == HSMChannel.SENC) {
                             enc.type = "Symmetric Encryption";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.AENC){
-                            enc.type="Asymmetric Encryption";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.MAC){
-                            enc.type="MAC";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.NONCE){
-                            enc.type="Nonce";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.AENC) {
+                            enc.type = "Asymmetric Encryption";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.MAC) {
+                            enc.type = "MAC";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.NONCE) {
+                            enc.type = "Nonce";
                         }
 
                         enc.message_overhead = overhead;
-                        enc.encTime= encComp;
-                        enc.decTime=decComp;
-                        enc.nonce=hsmChannels.get(chan).nonceName;
-                        tad.addComponent(enc, xc, 500,false,true);
+                        enc.encTime = encComp;
+                        enc.decTime = decComp;
+                        enc.nonce = hsmChannels.get(chan).nonceName;
+                        tad.addComponent(enc, xc, 500, false, true);
 
                         //Connect encrypt and readchannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(enc.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                         //Connect encrypt and writechannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(enc.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                     }
-                    xc+=300;
+                    xc += 300;
                     i++;
                 }
-            }
-            else {
+            } else {
 
-                int i=1;
+                int i = 1;
 
-                for (String chan: hsmChannels.keySet()){
+                for (String chan : hsmChannels.keySet()) {
                     HSMChannel ch = hsmChannels.get(chan);
                     TMLADReadChannel rd = new TMLADReadChannel(xc, 300, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    rd.setChannelName("data_"+chan+"_"+hsmChannels.get(chan).task);
+                    rd.setChannelName("data_" + chan + "_" + hsmChannels.get(chan).task);
                     rd.setSecurityContext(ch.securityContext);
-                    tad.addComponent(rd, xc,300,false,true);
+                    tad.addComponent(rd, xc, 300, false, true);
                     //Connect choice and readchannel
 
                     fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     fromStart.setP1(choice.getTGConnectingPointAtIndex(i));
                     fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
 
-                    tad.addComponent(fromStart, 300,200,false,true);
+                    tad.addComponent(fromStart, 300, 200, false, true);
 
                     TMLADWriteChannel wr = new TMLADWriteChannel(xc, 600, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    wr.setChannelName("retData_"+chan+"_"+hsmChannels.get(chan).task);
-                    tad.addComponent(wr, xc, 600,false,true);
+                    wr.setChannelName("retData_" + chan + "_" + hsmChannels.get(chan).task);
+                    tad.addComponent(wr, xc, 600, false, true);
                     wr.setSecurityContext(ch.securityContext);
 
 
-                    if (hsmChannels.get(chan).secType==HSMChannel.DEC){
+                    if (hsmChannels.get(chan).secType == HSMChannel.DEC) {
                         TMLADDecrypt dec = new TMLADDecrypt(xc, 500, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         dec.securityContext = ch.securityContext;
-                        tad.addComponent(dec, xc, 500,false,true);
+                        tad.addComponent(dec, xc, 500, false, true);
 
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(dec.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                         //Connect encrypt and writechannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(dec.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
-                    }
-                    else {
+                        tad.addComponent(fromStart, 300, 200, false, true);
+                    } else {
                         TMLADEncrypt enc = new TMLADEncrypt(xc, 500, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         enc.securityContext = ch.securityContext;
-                        if (hsmChannels.get(chan).secType==HSMChannel.SENC){
+                        if (hsmChannels.get(chan).secType == HSMChannel.SENC) {
                             enc.type = "Symmetric Encryption";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.AENC){
-                            enc.type="Asymmetric Encryption";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.MAC){
-                            enc.type="MAC";
-                        }
-                        else if (hsmChannels.get(chan).secType==HSMChannel.NONCE){
-                            enc.type="Nonce";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.AENC) {
+                            enc.type = "Asymmetric Encryption";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.MAC) {
+                            enc.type = "MAC";
+                        } else if (hsmChannels.get(chan).secType == HSMChannel.NONCE) {
+                            enc.type = "Nonce";
                         }
 
                         enc.message_overhead = overhead;
-                        enc.encTime= encComp;
-                        enc.decTime=decComp;
-                        tad.addComponent(enc, xc, 500,false,true);
+                        enc.encTime = encComp;
+                        enc.decTime = decComp;
+                        tad.addComponent(enc, xc, 500, false, true);
 
                         //Connect encrypt and readchannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(enc.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
                         //Connect encrypt and writechannel
                         fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(enc.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(wr.getTGConnectingPointAtIndex(0));
-                        tad.addComponent(fromStart, 300,200,false,true);
+                        tad.addComponent(fromStart, 300, 200, false, true);
 
 
                     }
@@ -1746,7 +1705,7 @@ public class GTURTLEModeling {
                       tad.addComponent(wr2, xc+75, 600,false,true);
 
                     */
-                    xc+=300;
+                    xc += 300;
                     i++;
                 }
 
@@ -1755,47 +1714,47 @@ public class GTURTLEModeling {
             secChannels.putAll(hsmChannels);
         }
         //For all the tasks that receive encrypted data, decrypt it, assuming it has no associated HSM
-        for (TMLTask task: tmap.getTMLModeling().getTasks()){
+        for (TMLTask task : tmap.getTMLModeling().getTasks()) {
             int xpos, ypos;
             //System.out.println("loop 2");
             TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel(task.getName());
             HashSet<TGComponent> channelInstances = new HashSet<TGComponent>();
-            for (String chan: secChannels.keySet()){
+            for (String chan : secChannels.keySet()) {
                 HSMChannel ch = secChannels.get(chan);
                 channelInstances.clear();
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADReadChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADReadChannel) {
                         TMLADReadChannel readChannel = (TMLADReadChannel) tg;
-                        if (readChannel.getChannelName().equals(chan) && readChannel.getSecurityContext().equals("")){
+                        if (readChannel.getChannelName().equals(chan) && readChannel.getSecurityContext().equals("")) {
                             fromStart = tad.findTGConnectorStartingAt(tg.getTGConnectingPointAtIndex(1));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
                     }
                 }
-                for (TGComponent chI: channelInstances){
+                for (TGComponent chI : channelInstances) {
                     TMLADReadChannel readChannel = (TMLADReadChannel) chI;
                     readChannel.setSecurityContext(ch.securityContext);
                     xpos = chI.getX();
-                    ypos = chI.getY()+10;
+                    ypos = chI.getY() + 10;
                     fromStart = tad.findTGConnectorStartingAt(chI.getTGConnectingPointAtIndex(1));
-                    if (fromStart==null){
-                        fromStart=new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    if (fromStart == null) {
+                        fromStart = new TGConnectorTMLAD(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         fromStart.setP1(chI.getTGConnectingPointAtIndex(1));
-                        tad.addComponent(fromStart, xpos,ypos,false,true);
+                        tad.addComponent(fromStart, xpos, ypos, false, true);
                     }
                     TGConnectingPoint point = fromStart.getTGConnectingPointP2();
                     //Add decryption operator
-                    int yShift=100;
-                    TMLADDecrypt dec = new TMLADDecrypt(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    int yShift = 100;
+                    TMLADDecrypt dec = new TMLADDecrypt(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                     dec.securityContext = ch.securityContext;
-                    tad.addComponent(dec, xpos,ypos+yShift, false, true);
+                    tad.addComponent(dec, xpos, ypos + yShift, false, true);
 
 
                     fromStart.setP2(dec.getTGConnectingPointAtIndex(0));
-                    if (point!=null){
-                        fromStart=new TGConnectorTMLAD(dec.getX(), dec.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    if (point != null) {
+                        fromStart = new TGConnectorTMLAD(dec.getX(), dec.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         fromStart.setP1(dec.getTGConnectingPointAtIndex(1));
 
@@ -1804,53 +1763,53 @@ public class GTURTLEModeling {
                         fromStart.setP2(point);
                     }
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg.getY() >= ypos && tg!=dec){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg.getY() >= ypos && tg != dec) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
 
                 }
             }
             //Next find channels that send encrypted data, and add the encryption operator
-            for (String chan: secChannels.keySet()){
+            for (String chan : secChannels.keySet()) {
                 channelInstances.clear();
                 HSMChannel ch = secChannels.get(chan);
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADWriteChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADWriteChannel) {
                         TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg;
-                        if (writeChannel.getChannelName().equals(chan) && writeChannel.getSecurityContext().equals("")){
+                        if (writeChannel.getChannelName().equals(chan) && writeChannel.getSecurityContext().equals("")) {
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
                     }
                 }
-                for (TGComponent chI: channelInstances){
+                for (TGComponent chI : channelInstances) {
                     TMLADWriteChannel writeChannel = (TMLADWriteChannel) chI;
                     writeChannel.setSecurityContext(ch.securityContext);
                     xpos = chI.getX();
-                    ypos = chI.getY()-10;
+                    ypos = chI.getY() - 10;
                     fromStart = tad.findTGConnectorEndingAt(chI.getTGConnectingPointAtIndex(0));
                     TGConnectingPoint point = fromStart.getTGConnectingPointP2();
                     //Add encryption operator
-                    int yShift=100;
+                    int yShift = 100;
 
                     TMLADEncrypt enc = new TMLADEncrypt(xpos, ypos, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    tad.addComponent(enc,xpos, ypos, false,true);
+                    tad.addComponent(enc, xpos, ypos, false, true);
                     enc.securityContext = ch.securityContext;
                     enc.type = "Symmetric Encryption";
                     enc.message_overhead = overhead;
-                    enc.encTime= encComp;
-                    enc.decTime=decComp;
-                    enc.size=overhead;
+                    enc.encTime = encComp;
+                    enc.decTime = decComp;
+                    enc.size = overhead;
 
 
                     fromStart.setP2(enc.getTGConnectingPointAtIndex(0));
-                    fromStart=new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(enc.getTGConnectingPointAtIndex(1));
 
@@ -1858,161 +1817,159 @@ public class GTURTLEModeling {
 
                     fromStart.setP2(point);
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg.getY() >= ypos && tg !=enc){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg.getY() >= ypos && tg != enc) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
 
                 }
             }
 
         }
-        for (String cpuName: selectedCpuTasks.keySet()){
+        for (String cpuName : selectedCpuTasks.keySet()) {
             //Add a private bus to Hardware Accelerator with the task for hsm
 
             //Find the CPU the task is mapped to
             TMLArchiDiagramPanel archPanel = newarch.tmlap;
-            TMLArchiCPUNode cpu=null;
-            String refTask="";
-            for (TGComponent tg: archPanel.getComponentList()){
-                if (tg instanceof TMLArchiCPUNode){
-                    if (tg.getName().equals(cpuName)){
-                        cpu=(TMLArchiCPUNode) tg;
+            TMLArchiCPUNode cpu = null;
+            String refTask = "";
+            for (TGComponent tg : archPanel.getComponentList()) {
+                if (tg instanceof TMLArchiCPUNode) {
+                    if (tg.getName().equals(cpuName)) {
+                        cpu = (TMLArchiCPUNode) tg;
                         TMLArchiArtifact art = cpu.getArtifactList().get(0);
-                        refTask=art.getReferenceTaskName();
+                        refTask = art.getReferenceTaskName();
                         break;
 
                     }
                 }
             }
 
-            if (cpu==null){
+            if (cpu == null) {
                 return;
             }
 
             //Add new memory
-            TMLArchiMemoryNode mem = new TMLArchiMemoryNode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
-            archPanel.addComponent(mem, cpu.getX()+100, cpu.getY()+100, false, true);
-            mem.setName("HSMMemory_"+cpuName);
+            TMLArchiMemoryNode mem = new TMLArchiMemoryNode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
+            archPanel.addComponent(mem, cpu.getX() + 100, cpu.getY() + 100, false, true);
+            mem.setName("HSMMemory_" + cpuName);
             //Add Hardware Accelerator
 
-            TMLArchiHWANode hwa = new TMLArchiHWANode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
-            archPanel.addComponent(hwa, cpu.getX()+100, cpu.getY()+100, false, true);
-            hwa.setName("HSM_"+cpuName);
+            TMLArchiHWANode hwa = new TMLArchiHWANode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
+            archPanel.addComponent(hwa, cpu.getX() + 100, cpu.getY() + 100, false, true);
+            hwa.setName("HSM_" + cpuName);
             //Add hsm task to hwa
 
 
-            TMLArchiArtifact hsmArt = new TMLArchiArtifact(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, hwa, archPanel);
-            archPanel.addComponent(hsmArt, cpu.getX()+100, cpu.getY()+100, true, true);
-            hsmArt.setFullName("HSM_"+cpuName, refTask);
+            TMLArchiArtifact hsmArt = new TMLArchiArtifact(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, hwa, archPanel);
+            archPanel.addComponent(hsmArt, cpu.getX() + 100, cpu.getY() + 100, true, true);
+            hsmArt.setFullName("HSM_" + cpuName, refTask);
             //Add bus connecting the cpu and HWA
 
-            TMLArchiBUSNode bus = new TMLArchiBUSNode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
+            TMLArchiBUSNode bus = new TMLArchiBUSNode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel);
             bus.setPrivacy(1);
-            bus.setName("HSMBus_"+cpuName);
-            archPanel.addComponent(bus, cpu.getX()+200, cpu.getY()+200, false, true);
+            bus.setName("HSMBus_" + cpuName);
+            archPanel.addComponent(bus, cpu.getX() + 200, cpu.getY() + 200, false, true);
 
             //Connect Bus and CPU
-            TMLArchiConnectorNode connect =new  TMLArchiConnectorNode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
-            TGConnectingPoint p1 = bus.findFirstFreeTGConnectingPoint(true,true);
+            TMLArchiConnectorNode connect = new TMLArchiConnectorNode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
+            TGConnectingPoint p1 = bus.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP2(p1);
 
 
-
-            TGConnectingPoint p2 = cpu.findFirstFreeTGConnectingPoint(true,true);
+            TGConnectingPoint p2 = cpu.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP1(p2);
-            archPanel.addComponent(connect, cpu.getX()+100, cpu.getY()+100, false, true);
+            archPanel.addComponent(connect, cpu.getX() + 100, cpu.getY() + 100, false, true);
             //Connect Bus and HWA
 
-            connect = new TMLArchiConnectorNode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
-            p1 = bus.findFirstFreeTGConnectingPoint(true,true);
+            connect = new TMLArchiConnectorNode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
+            p1 = bus.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP2(p1);
 
-            p2 = hwa.findFirstFreeTGConnectingPoint(true,true);
+            p2 = hwa.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP1(p2);
 
-            archPanel.addComponent(connect, cpu.getX()+100, cpu.getY()+100, false, true);
+            archPanel.addComponent(connect, cpu.getX() + 100, cpu.getY() + 100, false, true);
             //Connect Bus and Memory
 
-            connect = new TMLArchiConnectorNode(cpu.getX()+100, cpu.getY()+100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
-            p1 = bus.findFirstFreeTGConnectingPoint(true,true);
+            connect = new TMLArchiConnectorNode(cpu.getX() + 100, cpu.getY() + 100, archPanel.getMinX(), archPanel.getMaxX(), archPanel.getMinY(), archPanel.getMaxY(), true, null, archPanel, null, null, new Vector<Point>());
+            p1 = bus.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP2(p1);
 
-            p2 = mem.findFirstFreeTGConnectingPoint(true,true);
+            p2 = mem.findFirstFreeTGConnectingPoint(true, true);
             p1.setFree(false);
             connect.setP1(p2);
-            archPanel.addComponent(connect, cpu.getX()+100, cpu.getY()+100, false, true);
+            archPanel.addComponent(connect, cpu.getX() + 100, cpu.getY() + 100, false, true);
         }
 
     }
 
 
-
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth){
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth) {
         //TODO add more options
         //
-        if (tmap==null){
+        if (tmap == null) {
             return null;
         }
-		TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
+        TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
         int arch = gui.tabs.indexOf(tmlap);
-        gui.cloneRenameTab(arch,"enc");
-        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size()-1);
-        
-        return autoSecure(gui, "enc", tmap,newarch,autoConf,autoWeakAuth, autoStrongAuth);
+        gui.cloneRenameTab(arch, "enc");
+        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size() - 1);
+
+        return autoSecure(gui, "enc", tmap, newarch, autoConf, autoWeakAuth, autoStrongAuth);
     }
-    
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch){
-        return autoSecure(gui,name,map,newarch,"100","0","100",true,false,false);
+
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch) {
+        return autoSecure(gui, name, map, newarch, "100", "0", "100", true, false, false);
     }
-    
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth){
-        return autoSecure(gui,name,map,newarch,"100","0","100",autoConf,autoWeakAuth, autoStrongAuth);
+
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth) {
+        return autoSecure(gui, name, map, newarch, "100", "0", "100", autoConf, autoWeakAuth, autoStrongAuth);
     }
 
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String encComp, String overhead, String decComp){
-        if (tmap==null){
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String encComp, String overhead, String decComp) {
+        if (tmap == null) {
             return null;
         }
-		TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
+        TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
         int arch = gui.tabs.indexOf(tmlap);
-        gui.cloneRenameTab(arch,"enc");
-        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size()-1);
-        return autoSecure(gui,"enc", tmap,newarch,encComp, overhead,decComp,true,false,false);
+        gui.cloneRenameTab(arch, "enc");
+        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size() - 1);
+        return autoSecure(gui, "enc", tmap, newarch, encComp, overhead, decComp, true, false, false);
     }
 
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String encComp, String overhead, String decComp, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth){
-        if (tmap==null){
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String encComp, String overhead, String decComp, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth) {
+        if (tmap == null) {
             return null;
         }
-		TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
+        TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp;
         int arch = gui.tabs.indexOf(tmlap);
-        gui.cloneRenameTab(arch,"enc");
-        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size()-1);
-        return autoSecure(gui,"enc", tmap,newarch,encComp, overhead,decComp,autoConf,autoWeakAuth, autoStrongAuth);
+        gui.cloneRenameTab(arch, "enc");
+        TMLArchiPanel newarch = (TMLArchiPanel) gui.tabs.get(gui.tabs.size() - 1);
+        return autoSecure(gui, "enc", tmap, newarch, encComp, overhead, decComp, autoConf, autoWeakAuth, autoStrongAuth);
     }
-    
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, String encComp, String overhead, String decComp){
-        return autoSecure(gui,name, tmap,newarch,encComp, overhead,decComp,true,false, false);
+
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, String encComp, String overhead, String decComp) {
+        return autoSecure(gui, name, tmap, newarch, encComp, overhead, decComp, true, false, false);
     }
 
-    public void proverifAnalysis(TMLMapping<TGComponent> map,  List<String> nonAuthChans, List<String> nonSecChans){
-        if (map==null){
+    public void proverifAnalysis(TMLMapping<TGComponent> map, List<String> nonAuthChans, List<String> nonSecChans) {
+        if (map == null) {
             TraceManager.addDev("No mapping");
             return;
         }
         //Perform ProVerif Analysis
-        TML2Avatar t2a = new TML2Avatar(map,false,true);
+        TML2Avatar t2a = new TML2Avatar(map, false, true);
         AvatarSpecification avatarspec = t2a.generateAvatarSpec("1");
-        if (avatarspec == null){
+        if (avatarspec == null) {
             TraceManager.addDev("No avatar spec");
             return;
         }
@@ -2022,7 +1979,7 @@ public class GTURTLEModeling {
             proverif = avatar2proverif.generateProVerif(true, true, 1, true, false);
             warnings = avatar2proverif.getWarnings();
 
-            if (!avatar2proverif.saveInFile("pvspec")){
+            if (!avatar2proverif.saveInFile("pvspec")) {
                 return;
             }
 
@@ -2030,40 +1987,38 @@ public class GTURTLEModeling {
 
             rshc.setCmd(ConfigurationTTool.ProVerifVerifierPath + " -in pitype pvspec");
             rshc.sendExecuteCommandRequest();
-            Reader data  = rshc.getDataReaderFromProcess();
+            Reader data = rshc.getDataReaderFromProcess();
 
-            ProVerifOutputAnalyzer pvoa = getProVerifOutputAnalyzer ();
+            ProVerifOutputAnalyzer pvoa = getProVerifOutputAnalyzer();
             pvoa.analyzeOutput(data, true);
             HashMap<AvatarPragmaSecret, ProVerifQueryResult> confResults = pvoa.getConfidentialityResults();
-            for (AvatarPragmaSecret pragma: confResults.keySet()) {
-                if (confResults.get(pragma).isProved() && !confResults.get(pragma).isSatisfied())
-                    {
-                        nonSecChans.add(pragma.getArg().getBlock().getName() + "__" + pragma.getArg().getName());
-                        TraceManager.addDev(pragma.getArg().getBlock().getName() + "." + pragma.getArg().getName()+ " is not secret");
-                        TMLChannel chan = map.getTMLModeling().getChannelByShortName(pragma.getArg().getName().replaceAll("_chData",""));
-                        for (String block:chan.getTaskNames()){
-                            nonSecChans.add(block+"__"+pragma.getArg().getName());
-                        }
+            for (AvatarPragmaSecret pragma : confResults.keySet()) {
+                if (confResults.get(pragma).isProved() && !confResults.get(pragma).isSatisfied()) {
+                    nonSecChans.add(pragma.getArg().getBlock().getName() + "__" + pragma.getArg().getName());
+                    TraceManager.addDev(pragma.getArg().getBlock().getName() + "." + pragma.getArg().getName() + " is not secret");
+                    TMLChannel chan = map.getTMLModeling().getChannelByShortName(pragma.getArg().getName().replaceAll("_chData", ""));
+                    for (String block : chan.getTaskNames()) {
+                        nonSecChans.add(block + "__" + pragma.getArg().getName());
                     }
+                }
             }
             HashMap<AvatarPragmaAuthenticity, ProVerifQueryAuthResult> authResults = pvoa.getAuthenticityResults();
-            for (AvatarPragmaAuthenticity pragma: authResults.keySet()) {
+            for (AvatarPragmaAuthenticity pragma : authResults.keySet()) {
                 if (authResults.get(pragma).isProved() && !authResults.get(pragma).isSatisfied()) {
                     nonAuthChans.add(pragma.getAttrA().getAttribute().getBlock().getName() + "__" + pragma.getAttrA().getAttribute().getName().replaceAll("_chData", ""));
                     nonAuthChans.add(pragma.getAttrB().getAttribute().getBlock().getName() + "__" + pragma.getAttrB().getAttribute().getName().replaceAll("_chData", ""));
                 }
             }
-			TraceManager.addDev("nonsecchans " + nonSecChans);
-			TraceManager.addDev("nonauthchans " + nonAuthChans);
+            TraceManager.addDev("nonsecchans " + nonSecChans);
+            TraceManager.addDev("nonauthchans " + nonAuthChans);
             TraceManager.addDev("all results displayed");
 
-        }
-        catch (Exception e){
+        } catch (Exception e) {
             System.out.println("ProVerif Analysis Failed " + e);
         }
     }
 
-    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, String encComp, String overhead, String decComp, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth){
+    public TMLMapping<TGComponent> autoSecure(MainGUI gui, String name, TMLMapping<TGComponent> map, TMLArchiPanel newarch, String encComp, String overhead, String decComp, boolean autoConf, boolean autoWeakAuth, boolean autoStrongAuth) {
         Map<TMLTask, List<TMLTask>> toSecure = new HashMap<TMLTask, List<TMLTask>>();
         Map<TMLTask, List<TMLTask>> toSecureRev = new HashMap<TMLTask, List<TMLTask>>();
         Map<TMLTask, List<String>> secOutChannels = new HashMap<TMLTask, List<String>>();
@@ -2082,31 +2037,31 @@ public class GTURTLEModeling {
 
         TMLModeling<TGComponent> tmlmodel = map.getTMLModeling();
         List<TMLChannel> channels = tmlmodel.getChannels();
-        for (TMLChannel channel: channels){
-            for (TMLCPrimitivePort p: channel.ports){
+        for (TMLChannel channel : channels) {
+            for (TMLCPrimitivePort p : channel.ports) {
                 channel.checkConf = channel.checkConf || p.checkConf;
                 channel.checkAuth = channel.checkAuth || p.checkAuth;
             }
         }
 
         //Create clone of Component Diagram + Activity diagrams to secure
-		TGComponent tgcomp= map.getTMLModeling().getTGComponent();
-		TMLComponentDesignPanel tmlcdp= (TMLComponentDesignPanel) tgcomp.getTDiagramPanel().tp;
+        TGComponent tgcomp = map.getTMLModeling().getTGComponent();
+        TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) tgcomp.getTDiagramPanel().tp;
 //        TMLComponentDesignPanel tmlcdp = map.getTMLCDesignPanel();
         int ind = gui.tabs.indexOf(tmlcdp);
-        if (ind==-1){
+        if (ind == -1) {
             TraceManager.addDev("No Component Design Panel");
             return null;
         }
         String tabName = gui.getTitleAt(tmlcdp);
         gui.cloneRenameTab(ind, name);
-        TMLComponentDesignPanel t = (TMLComponentDesignPanel) gui.tabs.get(gui.tabs.size()-1);
+        TMLComponentDesignPanel t = (TMLComponentDesignPanel) gui.tabs.get(gui.tabs.size() - 1);
 
         TMLComponentTaskDiagramPanel tcdp = t.tmlctdp;
         //Create clone of architecture panel and map tasks to it
-        newarch.renameMapping(tabName, tabName+"_"+name);
+        newarch.renameMapping(tabName, tabName + "_" + name);
 
-        for (TMLTask task: map.getTMLModeling().getTasks()){
+        for (TMLTask task : map.getTMLModeling().getTasks()) {
             List<String> tmp = new ArrayList<String>();
             List<String> tmp2 = new ArrayList<String>();
             List<TMLTask> tmp3 = new ArrayList<TMLTask>();
@@ -2119,47 +2074,46 @@ public class GTURTLEModeling {
             List<String> tmp10 = new ArrayList<String>();
             secInChannels.put(task, tmp);
             secOutChannels.put(task, tmp2);
-            toSecure.put(task,tmp3);
-            toSecureRev.put(task,tmp4);
-            nonceInChannels.put(task,tmp5);
-            nonceOutChannels.put(task,tmp6);
-            macInChannels.put(task,tmp7);
-            macOutChannels.put(task,tmp8);
-            macNonceOutChannels.put(task,tmp9);
-            macNonceInChannels.put(task,tmp10);
+            toSecure.put(task, tmp3);
+            toSecureRev.put(task, tmp4);
+            nonceInChannels.put(task, tmp5);
+            nonceOutChannels.put(task, tmp6);
+            macInChannels.put(task, tmp7);
+            macOutChannels.put(task, tmp8);
+            macNonceOutChannels.put(task, tmp9);
+            macNonceInChannels.put(task, tmp10);
         }
         //With the proverif results, check which channels need to be secured
-        for (TMLTask task: map.getTMLModeling().getTasks()){
+        for (TMLTask task : map.getTMLModeling().getTasks()) {
             //Check if all channel operators are secured
             TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel(task.getName());
-            for (TGComponent tg:tad.getComponentList()){
-                if (tg instanceof TMLADWriteChannel){
+            for (TGComponent tg : tad.getComponentList()) {
+                if (tg instanceof TMLADWriteChannel) {
                     TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg;
-                    if (writeChannel.getSecurityContext().equals("")){
+                    if (writeChannel.getSecurityContext().equals("")) {
 
-                        TMLChannel chan = tmlmodel.getChannelByName(tabName+"__"+writeChannel.getChannelName());
+                        TMLChannel chan = tmlmodel.getChannelByName(tabName + "__" + writeChannel.getChannelName());
                         //System.out.println("channel " + chan);
-                        if (chan!=null){
-                            if (chan.checkConf && autoConf){
+                        if (chan != null) {
+                            if (chan.checkConf && autoConf) {
                                 //        System.out.println(chan.getOriginTask().getName().split("__")[1]);
-                                if (nonSecChans.contains(chan.getOriginTask().getName().split("__")[1]+"__"+writeChannel.getChannelName()+"_chData") && !secInChannels.get(chan.getDestinationTask()).contains(writeChannel.getChannelName())){
+                                if (nonSecChans.contains(chan.getOriginTask().getName().split("__")[1] + "__" + writeChannel.getChannelName() + "_chData") && !secInChannels.get(chan.getDestinationTask()).contains(writeChannel.getChannelName())) {
                                     //                                                                                            if (!securePath(map, chan.getOriginTask(), chan.getDestinationTask())){
                                     secOutChannels.get(chan.getOriginTask()).add(writeChannel.getChannelName());
                                     secInChannels.get(chan.getDestinationTask()).add(writeChannel.getChannelName());
                                     toSecure.get(chan.getOriginTask()).add(chan.getDestinationTask());
-                                    if (chan.checkAuth && autoStrongAuth){
+                                    if (chan.checkAuth && autoStrongAuth) {
                                         toSecureRev.get(chan.getDestinationTask()).add(chan.getOriginTask());
                                         nonceOutChannels.get(chan.getOriginTask()).add(writeChannel.getChannelName());
                                         nonceInChannels.get(chan.getDestinationTask()).add(writeChannel.getChannelName());
                                     }
                                 }
-                            }
-                            else if (chan.checkAuth && autoWeakAuth){
-                                if (nonAuthChans.contains(chan.getDestinationTask().getName().split("__")[1]+"__"+writeChannel.getChannelName())){
+                            } else if (chan.checkAuth && autoWeakAuth) {
+                                if (nonAuthChans.contains(chan.getDestinationTask().getName().split("__")[1] + "__" + writeChannel.getChannelName())) {
                                     toSecure.get(chan.getOriginTask()).add(chan.getDestinationTask());
                                     macOutChannels.get(chan.getOriginTask()).add(writeChannel.getChannelName());
                                     macInChannels.get(chan.getDestinationTask()).add(writeChannel.getChannelName());
-                                    if (autoStrongAuth){
+                                    if (autoStrongAuth) {
                                         toSecureRev.get(chan.getDestinationTask()).add(chan.getOriginTask());
                                         macNonceInChannels.get(chan.getDestinationTask()).add(writeChannel.getChannelName());
                                         macNonceOutChannels.get(chan.getOriginTask()).add(writeChannel.getChannelName());
@@ -2172,129 +2126,127 @@ public class GTURTLEModeling {
                 }
             }
         }
-        TraceManager.addDev("macoutchans "+ macOutChannels);
-        TraceManager.addDev("macinchans " +macInChannels);
-        TraceManager.addDev("nonsecin " +secInChannels);
-        TraceManager.addDev("nonsecout " +secOutChannels);
-        TraceManager.addDev("noncein " +nonceInChannels);
-        TraceManager.addDev("nonceout " +nonceOutChannels);
+        TraceManager.addDev("macoutchans " + macOutChannels);
+        TraceManager.addDev("macinchans " + macInChannels);
+        TraceManager.addDev("nonsecin " + secInChannels);
+        TraceManager.addDev("nonsecout " + secOutChannels);
+        TraceManager.addDev("noncein " + nonceInChannels);
+        TraceManager.addDev("nonceout " + nonceOutChannels);
 
         //        System.out.println(secOutChanannels.toString());
         //        int num=0;
         //int nonceNum=0;
         //Create reverse channels on component diagram to send nonces if they don't already exist
 
-        for (TMLTask task: toSecureRev.keySet()){
+        for (TMLTask task : toSecureRev.keySet()) {
             TraceManager.addDev("Adding nonces to " + task.getName());
             List<TMLChannel> chans = tmlmodel.getChannelsFromMe(task);
 
-            for (TMLTask task2: toSecureRev.get(task)){
+            for (TMLTask task2 : toSecureRev.get(task)) {
                 boolean addChan = true;
-                for (TMLChannel chan:chans){
-                    if (chan.getDestinationTask()==task2){
-                        addChan=false;
+                for (TMLChannel chan : chans) {
+                    if (chan.getDestinationTask() == task2) {
+                        addChan = false;
                     }
                 }
 
-                if (addChan){
+                if (addChan) {
                     TMLCChannelOutPort originPort = new TMLCChannelOutPort(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp);
                     TMLCChannelOutPort destPort = new TMLCChannelOutPort(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp);
-                    for (TGComponent tg: tcdp.getComponentList()){
-                        if (tg instanceof TMLCPrimitiveComponent){
-                            if (tg.getValue().equals(task.getName().split("__")[1])){
+                    for (TGComponent tg : tcdp.getComponentList()) {
+                        if (tg instanceof TMLCPrimitiveComponent) {
+                            if (tg.getValue().equals(task.getName().split("__")[1])) {
                                 originPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                originPort.commName="nonceCh"+task.getName().split("__")[1] + "_"+task2.getName().split("__")[1];
-                                tcdp.addComponent(originPort,tg.getX(), tg.getY(),true,true);
-                            }
-                            else if (tg.getValue().equals(task2.getName().split("__")[1])){
+                                originPort.commName = "nonceCh" + task.getName().split("__")[1] + "_" + task2.getName().split("__")[1];
+                                tcdp.addComponent(originPort, tg.getX(), tg.getY(), true, true);
+                            } else if (tg.getValue().equals(task2.getName().split("__")[1])) {
                                 destPort = new TMLCChannelOutPort(tg.getX(), tg.getY(), tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, tg, tcdp);
-                                destPort.isOrigin=false;
-                                destPort.commName="nonceCh"+task.getName().split("__")[1] + "_"+ task2.getName().split("__")[1];
-                                tcdp.addComponent(destPort,tg.getX(), tg.getY(),true,true);
+                                destPort.isOrigin = false;
+                                destPort.commName = "nonceCh" + task.getName().split("__")[1] + "_" + task2.getName().split("__")[1];
+                                tcdp.addComponent(destPort, tg.getX(), tg.getY(), true, true);
                             }
                         }
                     }
-                    tmlmodel.addChannel(new TMLChannel("nonceCh"+task.getName().split("__")[1] + "_"+ task2.getName().split("__")[1], originPort));
+                    tmlmodel.addChannel(new TMLChannel("nonceCh" + task.getName().split("__")[1] + "_" + task2.getName().split("__")[1], originPort));
                     //Add connection
                     TMLCPortConnector conn = new TMLCPortConnector(0, 0, tcdp.getMinX(), tcdp.getMaxX(), tcdp.getMinY(), tcdp.getMaxX(), true, null, tcdp, originPort.getTGConnectingPointAtIndex(0), destPort.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                    tcdp.addComponent(conn, 0,0,false,true);
+                    tcdp.addComponent(conn, 0, 0, false, true);
                 }
             }
         }
         //  }
         //Add encryption/nonces to activity diagram
-        for (TMLTask task:toSecure.keySet()){
+        for (TMLTask task : toSecure.keySet()) {
             String title = task.getName().split("__")[0];
             TraceManager.addDev("Securing task " + task.getName());
             TMLActivityDiagramPanel tad = t.getTMLActivityDiagramPanel(task.getName());
             //Get start state position, shift everything down
-            int xpos=0;
-            int ypos=0;
-            TGConnector fromStart= new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
+            int xpos = 0;
+            int ypos = 0;
+            TGConnector fromStart = new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
             TGConnectingPoint point = new TGConnectingPoint(null, 0, 0, false, false);
             //Find states immediately before the write channel operator
 
             //For each occurence of a write channel operator, add encryption/nonces before it
 
-            for (String channel: secOutChannels.get(task)){
+            for (String channel : secOutChannels.get(task)) {
                 Set<TGComponent> channelInstances = new HashSet<TGComponent>();
-                int yShift=50;
-                TMLChannel tmlc = tmlmodel.getChannelByName(title +"__"+channel);
+                int yShift = 50;
+                TMLChannel tmlc = tmlmodel.getChannelByName(title + "__" + channel);
                 //First, find the connector that points to it. We will add the encryption, nonce operators directly before the write channel operator
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADWriteChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADWriteChannel) {
                         TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg;
-                        if (writeChannel.getChannelName().equals(channel) && writeChannel.getSecurityContext().equals("")){
+                        if (writeChannel.getChannelName().equals(channel) && writeChannel.getSecurityContext().equals("")) {
 
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
                     }
                 }
-                for (TGComponent comp: channelInstances){
+                for (TGComponent comp : channelInstances) {
                     //TMLADWriteChannel writeChannel = (TMLADWriteChannel) comp;
                     xpos = comp.getX();
                     ypos = comp.getY();
                     fromStart = tad.findTGConnectorEndingAt(comp.getTGConnectingPointAtIndex(0));
                     point = fromStart.getTGConnectingPointP2();
                     //Add encryption operator
-                    TMLADEncrypt enc = new TMLADEncrypt(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    TMLADReadChannel rd=new TMLADReadChannel(0, 0, 0, 0, 0, 0, false, null, tad);
-                    if (nonceOutChannels.get(task).contains(channel)){
+                    TMLADEncrypt enc = new TMLADEncrypt(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    TMLADReadChannel rd = new TMLADReadChannel(0, 0, 0, 0, 0, 0, false, null, tad);
+                    if (nonceOutChannels.get(task).contains(channel)) {
                         //Receive any nonces if ensuring authenticity
-                        rd = new TMLADReadChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        rd = new TMLADReadChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         List<TMLChannel> matches = tmlmodel.getChannels(tmlc.getDestinationTask(), tmlc.getOriginTask());
 
-                        if (matches.size()>0){
-                            rd.setChannelName(matches.get(0).getName().replaceAll(title+"__",""));
-                        }
-                        else {
-                            rd.setChannelName("nonceCh"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
+                        if (matches.size() > 0) {
+                            rd.setChannelName(matches.get(0).getName().replaceAll(title + "__", ""));
+                        } else {
+                            rd.setChannelName("nonceCh" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
                         }
-                        rd.setSecurityContext("nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
-                        tad.addComponent(rd, xpos, ypos+yShift, false,true);
+                        rd.setSecurityContext("nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
+                        tad.addComponent(rd, xpos, ypos + yShift, false, true);
                         fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
-                        fromStart=new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                        fromStart = new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
-                        yShift+=60;
+                        yShift += 60;
                         //Move encryption operator after receive nonce component
-                        enc.setCd(xpos, ypos+yShift);
-                        if (tmlc!=null){
-                            enc.nonce= "nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1];
+                        enc.setCd(xpos, ypos + yShift);
+                        if (tmlc != null) {
+                            enc.nonce = "nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1];
                         }
                     }
 
-                    enc.securityContext = "autoEncrypt_"+channel;
+                    enc.securityContext = "autoEncrypt_" + channel;
                     enc.type = "Symmetric Encryption";
                     enc.message_overhead = overhead;
-                    enc.encTime= encComp;
-                    enc.decTime=decComp;
-                    tad.addComponent(enc, xpos ,ypos+yShift, false, true);
-                    yShift+=60;
+                    enc.encTime = encComp;
+                    enc.decTime = decComp;
+                    tad.addComponent(enc, xpos, ypos + yShift, false, true);
+                    yShift += 60;
                     fromStart.setP2(enc.getTGConnectingPointAtIndex(0));
-                    fromStart=new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(enc.getTGConnectingPointAtIndex(1));
 
@@ -2302,92 +2254,91 @@ public class GTURTLEModeling {
 
                     fromStart.setP2(point);
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg instanceof TMLADWriteChannel){
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg instanceof TMLADWriteChannel) {
                             TMLADWriteChannel wChannel = (TMLADWriteChannel) tg;
                             TraceManager.addDev("Inspecting write channel " + wChannel.getChannelName());
-                            if (channel.equals(wChannel.getChannelName()) && wChannel.getSecurityContext().equals("")){
+                            if (channel.equals(wChannel.getChannelName()) && wChannel.getSecurityContext().equals("")) {
                                 TraceManager.addDev("Securing write channel " + wChannel.getChannelName());
-                                wChannel.setSecurityContext("autoEncrypt_"+wChannel.getChannelName());
+                                wChannel.setSecurityContext("autoEncrypt_" + wChannel.getChannelName());
 
                             }
                         }
-                        if (tg.getY() >= ypos && tg !=enc && tg!=rd){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                        if (tg.getY() >= ypos && tg != enc && tg != rd) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
                 }
             }
 
-            for (String channel: macOutChannels.get(task)){
+            for (String channel : macOutChannels.get(task)) {
                 //Add MAC before writechannel
-                int yShift=50;
-                TMLChannel tmlc = tmlmodel.getChannelByName(title +"__"+channel);
+                int yShift = 50;
+                TMLChannel tmlc = tmlmodel.getChannelByName(title + "__" + channel);
                 //First, find the connector that points to it. We will add the encryption, nonce operators directly before the write channel operator
                 Set<TGComponent> channelInstances = new HashSet<TGComponent>();
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADWriteChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADWriteChannel) {
                         TMLADWriteChannel writeChannel = (TMLADWriteChannel) tg;
-                        if (writeChannel.getChannelName().equals(channel) && writeChannel.getSecurityContext().equals("")){
+                        if (writeChannel.getChannelName().equals(channel) && writeChannel.getSecurityContext().equals("")) {
                             xpos = tg.getX();
                             ypos = tg.getY();
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
                     }
                 }
-                for (TGComponent comp: channelInstances){
+                for (TGComponent comp : channelInstances) {
                     //TMLADWriteChannel writeChannel = (TMLADWriteChannel) comp;
                     xpos = comp.getX();
                     ypos = comp.getY();
                     fromStart = tad.findTGConnectorEndingAt(comp.getTGConnectingPointAtIndex(0));
                     point = fromStart.getTGConnectingPointP2();
 
-                    TMLADEncrypt enc = new TMLADEncrypt(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    TMLADEncrypt enc = new TMLADEncrypt(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
 
                     //If we need to receive a nonce
-                    TMLADReadChannel rd=new TMLADReadChannel(0, 0, 0, 0, 0, 0, false, null, tad);
-                    if (macNonceOutChannels.get(task).contains(channel)){
+                    TMLADReadChannel rd = new TMLADReadChannel(0, 0, 0, 0, 0, 0, false, null, tad);
+                    if (macNonceOutChannels.get(task).contains(channel)) {
                         //Receive any nonces if ensuring authenticity
-                        rd = new TMLADReadChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        rd = new TMLADReadChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         List<TMLChannel> matches = tmlmodel.getChannels(tmlc.getDestinationTask(), tmlc.getOriginTask());
 
-                        if (matches.size()>0){
-                            rd.setChannelName(matches.get(0).getName().replaceAll(title+"__",""));
-                        }
-                        else {
-                            rd.setChannelName("nonceCh"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
+                        if (matches.size() > 0) {
+                            rd.setChannelName(matches.get(0).getName().replaceAll(title + "__", ""));
+                        } else {
+                            rd.setChannelName("nonceCh" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
                         }
-                        rd.setSecurityContext("nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
-                        tad.addComponent(rd, xpos, ypos+yShift, false,true);
+                        rd.setSecurityContext("nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
+                        tad.addComponent(rd, xpos, ypos + yShift, false, true);
                         fromStart.setP2(rd.getTGConnectingPointAtIndex(0));
-                        fromStart=new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                        fromStart = new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         fromStart.setP1(rd.getTGConnectingPointAtIndex(1));
-                        yShift+=60;
+                        yShift += 60;
                         //Move encryption operator after receive nonce component
-                        enc.setCd(xpos, ypos+yShift);
-                        if (tmlc!=null){
-                            enc.nonce= "nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1];
+                        enc.setCd(xpos, ypos + yShift);
+                        if (tmlc != null) {
+                            enc.nonce = "nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1];
                         }
                     }
 
                     //Add encryption operator
 
-                    enc.securityContext = "autoEncrypt_"+channel;
+                    enc.securityContext = "autoEncrypt_" + channel;
                     enc.type = "MAC";
                     enc.message_overhead = overhead;
-                    enc.encTime= encComp;
-                    enc.decTime=decComp;
-                    enc.size=overhead;
-                    tad.addComponent(enc, xpos ,ypos+yShift, false, true);
-                    yShift+=60;
+                    enc.encTime = encComp;
+                    enc.decTime = decComp;
+                    enc.size = overhead;
+                    tad.addComponent(enc, xpos, ypos + yShift, false, true);
+                    yShift += 60;
                     fromStart.setP2(enc.getTGConnectingPointAtIndex(0));
-                    fromStart=new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
+                    fromStart = new TGConnectorTMLAD(enc.getX(), enc.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, null, null, new Vector<Point>());
                     tad.addComponent(fromStart, xpos, ypos, false, true);
                     fromStart.setP1(enc.getTGConnectingPointAtIndex(1));
 
@@ -2395,37 +2346,37 @@ public class GTURTLEModeling {
 
                     fromStart.setP2(point);
                     //Shift components down to make room for the added ones, and add security contexts to write channels
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg instanceof TMLADWriteChannel){
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg instanceof TMLADWriteChannel) {
                             TMLADWriteChannel wChannel = (TMLADWriteChannel) tg;
                             TraceManager.addDev("Inspecting write channel " + wChannel.getChannelName());
-                            if (channel.equals(wChannel.getChannelName()) && wChannel.getSecurityContext().equals("")){
+                            if (channel.equals(wChannel.getChannelName()) && wChannel.getSecurityContext().equals("")) {
                                 TraceManager.addDev("Securing write channel " + wChannel.getChannelName());
-                                wChannel.setSecurityContext("autoEncrypt_"+wChannel.getChannelName());
+                                wChannel.setSecurityContext("autoEncrypt_" + wChannel.getChannelName());
                                 tad.repaint();
                             }
                         }
-                        if (tg.getY() >= ypos && tg !=enc && tg!=rd){
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                        if (tg.getY() >= ypos && tg != enc && tg != rd) {
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                 }
             }
-            for (String channel: macInChannels.get(task)){
+            for (String channel : macInChannels.get(task)) {
                 //Add decryptmac after readchannel
-                int yShift=50;
+                int yShift = 50;
                 Set<TGComponent> channelInstances = new HashSet<TGComponent>();
-                TGConnector conn =new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
+                TGConnector conn = new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
                 TGConnectingPoint next = new TGConnectingPoint(null, 0, 0, false, false);
                 //Find read channel operator
 
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADReadChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADReadChannel) {
                         TMLADReadChannel readChannel = (TMLADReadChannel) tg;
-                        if (readChannel.getChannelName().equals(channel) && readChannel.getSecurityContext().equals("")){
+                        if (readChannel.getChannelName().equals(channel) && readChannel.getSecurityContext().equals("")) {
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
@@ -2433,61 +2384,60 @@ public class GTURTLEModeling {
                 }
 
 
-                for (TGComponent comp: channelInstances){
+                for (TGComponent comp : channelInstances) {
 
                     fromStart = tad.findTGConnectorEndingAt(comp.getTGConnectingPointAtIndex(0));
                     point = fromStart.getTGConnectingPointP2();
                     conn = tad.findTGConnectorStartingAt(comp.getTGConnectingPointAtIndex(1));
-                    next= conn.getTGConnectingPointP2();
+                    next = conn.getTGConnectingPointP2();
                     xpos = fromStart.getX();
                     ypos = fromStart.getY();
 
 
                     TMLADReadChannel readChannel = (TMLADReadChannel) comp;
                     TraceManager.addDev("Securing read channel " + readChannel.getChannelName());
-                    readChannel.setSecurityContext("autoEncrypt_"+readChannel.getChannelName());
+                    readChannel.setSecurityContext("autoEncrypt_" + readChannel.getChannelName());
                     tad.repaint();
 
                     TMLADWriteChannel wr = new TMLADWriteChannel(0, 0, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                     //Create nonce and send it
-                    TMLChannel tmlc = tmlmodel.getChannelByName(title +"__"+channel);
-                    if (macNonceInChannels.get(task).contains(channel)){
+                    TMLChannel tmlc = tmlmodel.getChannelByName(title + "__" + channel);
+                    if (macNonceInChannels.get(task).contains(channel)) {
                         //Create a nonce operator and a write channel operator
-                        TMLADEncrypt nonce = new TMLADEncrypt(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                        nonce.securityContext = "nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1];
+                        TMLADEncrypt nonce = new TMLADEncrypt(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        nonce.securityContext = "nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1];
                         nonce.type = "Nonce";
                         nonce.message_overhead = overhead;
-                        nonce.encTime= encComp;
-                        nonce.decTime=decComp;
-                        tad.addComponent(nonce, xpos ,ypos+yShift, false, true);
+                        nonce.encTime = encComp;
+                        nonce.decTime = decComp;
+                        tad.addComponent(nonce, xpos, ypos + yShift, false, true);
                         fromStart.setP2(nonce.getTGConnectingPointAtIndex(0));
-                        yShift+=50;
-                        wr = new TMLADWriteChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        yShift += 50;
+                        wr = new TMLADWriteChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         //Send nonce along channel, the newly created nonce channel or an existing channel with the matching sender and receiver
                         //Find matching channels
                         List<TMLChannel> matches = tmlmodel.getChannels(tmlc.getDestinationTask(), tmlc.getOriginTask());
 
-                        if (matches.size()>0){
-                            wr.setChannelName(matches.get(0).getName().replaceAll(title+"__",""));
-                        }
-                        else {
-                            wr.setChannelName("nonceCh"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
+                        if (matches.size() > 0) {
+                            wr.setChannelName(matches.get(0).getName().replaceAll(title + "__", ""));
+                        } else {
+                            wr.setChannelName("nonceCh" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
                         }
                         //send the nonce along the channel
-                        wr.setSecurityContext("nonce_"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
-                        tad.addComponent(wr,xpos,ypos+yShift,false,true);
+                        wr.setSecurityContext("nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
+                        tad.addComponent(wr, xpos, ypos + yShift, false, true);
                         wr.makeValue();
-                        TGConnector tmp =new TGConnectorTMLAD(wr.getX(), wr.getY()+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null,tad,nonce.getTGConnectingPointAtIndex(1), wr.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        tad.addComponent(tmp, xpos,ypos,false,true);
-                        fromStart=new TGConnectorTMLAD(wr.getX(), wr.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, wr.getTGConnectingPointAtIndex(1), null, new Vector<Point>());
+                        TGConnector tmp = new TGConnectorTMLAD(wr.getX(), wr.getY() + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, nonce.getTGConnectingPointAtIndex(1), wr.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                        tad.addComponent(tmp, xpos, ypos, false, true);
+                        fromStart = new TGConnectorTMLAD(wr.getX(), wr.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, wr.getTGConnectingPointAtIndex(1), null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         //Connect created write channel operator to start of read channel operator
                         fromStart.setP1(wr.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(point);
                         //Shift everything from the read channel on down
-                        for (TGComponent tg:tad.getComponentList()){
-                            if (tg.getY() >= ypos && tg!=nonce && tg!=wr){
-                                tg.setCd(tg.getX(), tg.getY()+yShift);
+                        for (TGComponent tg : tad.getComponentList()) {
+                            if (tg.getY() >= ypos && tg != nonce && tg != wr) {
+                                tg.setCd(tg.getX(), tg.getY() + yShift);
                             }
                         }
                     }
@@ -2496,60 +2446,60 @@ public class GTURTLEModeling {
                     xpos = conn.getX();
                     ypos = conn.getY();
 
-                    TMLADDecrypt dec = new TMLADDecrypt(xpos+10, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    TMLADDecrypt dec = new TMLADDecrypt(xpos + 10, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                     dec.securityContext = "autoEncrypt_" + readChannel.getChannelName();
                     tad.addComponent(dec, dec.getX(), dec.getY(), false, true);
                     conn.setP2(dec.getTGConnectingPointAtIndex(0));
-                    yShift+=60;
-                    conn = new TGConnectorTMLAD(xpos,ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, dec.getTGConnectingPointAtIndex(1), next, new Vector<Point>());
+                    yShift += 60;
+                    conn = new TGConnectorTMLAD(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, dec.getTGConnectingPointAtIndex(1), next, new Vector<Point>());
                     conn.setP1(dec.getTGConnectingPointAtIndex(1));
                     conn.setP2(next);
-                    tad.addComponent(conn, conn.getX(), conn.getY(), false,true);
+                    tad.addComponent(conn, conn.getX(), conn.getY(), false, true);
                     //Shift everything down
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg instanceof TMLADReadChannel){
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg instanceof TMLADReadChannel) {
                             readChannel = (TMLADReadChannel) tg;
                             TraceManager.addDev("Inspecting read channel " + readChannel.getChannelName());
-                            if (channel.equals(readChannel.getChannelName()) && readChannel.getSecurityContext().equals("")){
+                            if (channel.equals(readChannel.getChannelName()) && readChannel.getSecurityContext().equals("")) {
                                 TraceManager.addDev("Securing read channel " + readChannel.getChannelName());
-                                readChannel.setSecurityContext("autoEncrypt_"+readChannel.getChannelName());
+                                readChannel.setSecurityContext("autoEncrypt_" + readChannel.getChannelName());
 
                             }
                         }
-                        if (tg.getY() > ypos && tg!=dec && tg!=comp){
+                        if (tg.getY() > ypos && tg != dec && tg != comp) {
 
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
 
 
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
                     tad.repaint();
                 }
             }
-            for (String channel: secInChannels.get(task)){
-                TraceManager.addDev("securing channel "+channel);
-                int yShift=20;
+            for (String channel : secInChannels.get(task)) {
+                TraceManager.addDev("securing channel " + channel);
+                int yShift = 20;
                 //        String title = task.getName().split("__")[0];
-                TMLChannel tmlc = tmlmodel.getChannelByName(title +"__"+channel);
-                TGConnector conn =new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
+                TMLChannel tmlc = tmlmodel.getChannelByName(title + "__" + channel);
+                TGConnector conn = new TGConnectorTMLAD(0, 0, 0, 0, 0, 0, false, null, tad, null, null, new Vector<Point>());
                 TGConnectingPoint next = new TGConnectingPoint(null, 0, 0, false, false);
                 //Find read channel operator
-                TMLADReadChannel readChannel = new TMLADReadChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                TMLADReadChannel readChannel = new TMLADReadChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                 HashSet<TGComponent> channelInstances = new HashSet<TGComponent>();
-                for (TGComponent tg: tad.getComponentList()){
-                    if (tg instanceof TMLADReadChannel){
+                for (TGComponent tg : tad.getComponentList()) {
+                    if (tg instanceof TMLADReadChannel) {
                         readChannel = (TMLADReadChannel) tg;
-                        if (readChannel.getChannelName().equals(channel) && readChannel.getSecurityContext().equals("")){
+                        if (readChannel.getChannelName().equals(channel) && readChannel.getSecurityContext().equals("")) {
                             fromStart = tad.findTGConnectorEndingAt(tg.getTGConnectingPointAtIndex(0));
-                            if (fromStart!=null){
+                            if (fromStart != null) {
                                 channelInstances.add(tg);
                             }
                         }
                     }
                 }
 
-                for (TGComponent comp: channelInstances){
+                for (TGComponent comp : channelInstances) {
 
                     fromStart = tad.findTGConnectorEndingAt(comp.getTGConnectingPointAtIndex(0));
                     point = fromStart.getTGConnectingPointP2();
@@ -2558,101 +2508,99 @@ public class GTURTLEModeling {
                     xpos = fromStart.getX();
                     ypos = fromStart.getY();
                     TMLADWriteChannel wr = new TMLADWriteChannel(0, 0, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                    if (nonceInChannels.get(task).contains(channel)){
+                    if (nonceInChannels.get(task).contains(channel)) {
                         //Create a nonce operator and a write channel operator
-                        TMLADEncrypt nonce = new TMLADEncrypt(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
-                        nonce.securityContext = "nonce_"+ tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1];
+                        TMLADEncrypt nonce = new TMLADEncrypt(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        nonce.securityContext = "nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1];
                         nonce.type = "Nonce";
                         nonce.message_overhead = overhead;
-                        nonce.encTime= encComp;
-                        nonce.decTime=decComp;
-                        tad.addComponent(nonce, xpos ,ypos+yShift, false, true);
+                        nonce.encTime = encComp;
+                        nonce.decTime = decComp;
+                        tad.addComponent(nonce, xpos, ypos + yShift, false, true);
                         fromStart.setP2(nonce.getTGConnectingPointAtIndex(0));
-                        yShift+=50;
-                        wr = new TMLADWriteChannel(xpos, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                        yShift += 50;
+                        wr = new TMLADWriteChannel(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                         //Send nonce along channel, the newly created nonce channel or an existing channel with the matching sender and receiver
                         //Find matching channels
                         List<TMLChannel> matches = tmlmodel.getChannels(tmlc.getDestinationTask(), tmlc.getOriginTask());
 
-                        if (matches.size()>0){
-                            wr.setChannelName(matches.get(0).getName().replaceAll(title+"__",""));
-                        }
-                        else {
-                            wr.setChannelName("nonceCh"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
+                        if (matches.size() > 0) {
+                            wr.setChannelName(matches.get(0).getName().replaceAll(title + "__", ""));
+                        } else {
+                            wr.setChannelName("nonceCh" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
                         }
                         //send the nonce along the channel
-                        wr.setSecurityContext("nonce_"+tmlc.getDestinationTask().getName().split("__")[1] + "_"+tmlc.getOriginTask().getName().split("__")[1]);
-                        tad.addComponent(wr,xpos,ypos+yShift,false,true);
+                        wr.setSecurityContext("nonce_" + tmlc.getDestinationTask().getName().split("__")[1] + "_" + tmlc.getOriginTask().getName().split("__")[1]);
+                        tad.addComponent(wr, xpos, ypos + yShift, false, true);
                         wr.makeValue();
-                        TGConnector tmp =new TGConnectorTMLAD(wr.getX(), wr.getY()+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null,tad,nonce.getTGConnectingPointAtIndex(1), wr.getTGConnectingPointAtIndex(0), new Vector<Point>());
-                        tad.addComponent(tmp, xpos,ypos,false,true);
-                        fromStart=new TGConnectorTMLAD(wr.getX(), wr.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, wr.getTGConnectingPointAtIndex(1), null, new Vector<Point>());
+                        TGConnector tmp = new TGConnectorTMLAD(wr.getX(), wr.getY() + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, nonce.getTGConnectingPointAtIndex(1), wr.getTGConnectingPointAtIndex(0), new Vector<Point>());
+                        tad.addComponent(tmp, xpos, ypos, false, true);
+                        fromStart = new TGConnectorTMLAD(wr.getX(), wr.getY(), tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, wr.getTGConnectingPointAtIndex(1), null, new Vector<Point>());
                         tad.addComponent(fromStart, xpos, ypos, false, true);
                         //Connect created write channel operator to start of read channel operator
                         fromStart.setP1(wr.getTGConnectingPointAtIndex(1));
                         fromStart.setP2(point);
                         //Shift everything from the read channel on down
-                        for (TGComponent tg:tad.getComponentList()){
-                            if (tg.getY() >= ypos && tg!=nonce && tg!=wr){
-                                tg.setCd(tg.getX(), tg.getY()+yShift);
+                        for (TGComponent tg : tad.getComponentList()) {
+                            if (tg.getY() >= ypos && tg != nonce && tg != wr) {
+                                tg.setCd(tg.getX(), tg.getY() + yShift);
                             }
                         }
                     }
                     //tad.repaint();
 
                     //Now add the decrypt operator
-                    yShift=40;
+                    yShift = 40;
                     TraceManager.addDev("Securing read channel " + readChannel.getChannelName());
-                    readChannel.setSecurityContext("autoEncrypt_"+readChannel.getChannelName());
+                    readChannel.setSecurityContext("autoEncrypt_" + readChannel.getChannelName());
                     tad.repaint();
                     //Add decryption operator if it does not already exist
                     xpos = readChannel.getX();
                     ypos = readChannel.getY();
-                    TMLADDecrypt dec = new TMLADDecrypt(xpos+10, ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
+                    TMLADDecrypt dec = new TMLADDecrypt(xpos + 10, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad);
                     dec.securityContext = "autoEncrypt_" + readChannel.getChannelName();
                     tad.addComponent(dec, dec.getX(), dec.getY(), false, true);
                     conn.setP2(dec.getTGConnectingPointAtIndex(0));
-                    yShift+=100;
-                    conn = new TGConnectorTMLAD(xpos,ypos+yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, dec.getTGConnectingPointAtIndex(1), next, new Vector<Point>());
+                    yShift += 100;
+                    conn = new TGConnectorTMLAD(xpos, ypos + yShift, tad.getMinX(), tad.getMaxX(), tad.getMinY(), tad.getMaxY(), false, null, tad, dec.getTGConnectingPointAtIndex(1), next, new Vector<Point>());
                     conn.setP1(dec.getTGConnectingPointAtIndex(1));
 
                     conn.setP2(next);
-                    tad.addComponent(conn, conn.getX(), conn.getY(), false,true);
+                    tad.addComponent(conn, conn.getX(), conn.getY(), false, true);
                     //Shift everything down
-                    for (TGComponent tg:tad.getComponentList()){
-                        if (tg instanceof TMLADReadChannel){
+                    for (TGComponent tg : tad.getComponentList()) {
+                        if (tg instanceof TMLADReadChannel) {
                             readChannel = (TMLADReadChannel) tg;
                             TraceManager.addDev("Inspecting read channel " + readChannel.getChannelName());
-                            if (channel.equals(readChannel.getChannelName()) && readChannel.getSecurityContext().equals("")){
+                            if (channel.equals(readChannel.getChannelName()) && readChannel.getSecurityContext().equals("")) {
                                 TraceManager.addDev("Securing read channel " + readChannel.getChannelName());
-                                readChannel.setSecurityContext("autoEncrypt_"+readChannel.getChannelName());
+                                readChannel.setSecurityContext("autoEncrypt_" + readChannel.getChannelName());
 
                             }
                         }
-                        if (tg.getY() > ypos && tg!=dec){
+                        if (tg.getY() > ypos && tg != dec) {
 
-                            tg.setCd(tg.getX(), tg.getY()+yShift);
+                            tg.setCd(tg.getX(), tg.getY() + yShift);
                         }
                     }
 
-                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY()+yShift);
+                    tad.setMaxPanelSize(tad.getMaxX(), tad.getMaxY() + yShift);
 
                     tad.repaint();
                 }
             }
         }
         GTMLModeling gtm = new GTMLModeling(t, false);
-        TMLModeling<TGComponent> newmodel = gtm.translateToTMLModeling(false,false);
-        for (TMLTask task:newmodel.getTasks()){
-            task.setName(tabName+"_"+name+"__"+task.getName());
-        }
-        for (TMLTask task: tmlmodel.getTasks()){
-            HwExecutionNode node =(HwExecutionNode) map.getHwNodeOf(task);
-            if (newmodel.getTMLTaskByName(task.getName().replace(tabName,tabName+"_"+name))!=null){
-                map.addTaskToHwExecutionNode(newmodel.getTMLTaskByName(task.getName().replace(tabName,tabName+"_"+name)), node);
+        TMLModeling<TGComponent> newmodel = gtm.translateToTMLModeling(false, false);
+        for (TMLTask task : newmodel.getTasks()) {
+            task.setName(tabName + "_" + name + "__" + task.getName());
+        }
+        for (TMLTask task : tmlmodel.getTasks()) {
+            HwExecutionNode node = (HwExecutionNode) map.getHwNodeOf(task);
+            if (newmodel.getTMLTaskByName(task.getName().replace(tabName, tabName + "_" + name)) != null) {
+                map.addTaskToHwExecutionNode(newmodel.getTMLTaskByName(task.getName().replace(tabName, tabName + "_" + name)), node);
                 map.removeTask(task);
-            }
-            else {
+            } else {
                 System.out.println("Can't find " + task.getName());
             }
         }
@@ -2664,9 +2612,9 @@ public class GTURTLEModeling {
     }
 
 
-    public boolean securePath(TMLMapping<TGComponent> map, TMLTask t1, TMLTask t2){
+    public boolean securePath(TMLMapping<TGComponent> map, TMLTask t1, TMLTask t2) {
         //Check if a path between two tasks is secure
-        boolean secure=true;
+        boolean secure = true;
         List<HwLink> links = map.getTMLArchitecture().getHwLinks();
         HwExecutionNode node1 = (HwExecutionNode) map.getHwNodeOf(t1);
         HwExecutionNode node2 = (HwExecutionNode) map.getHwNodeOf(t2);
@@ -2675,11 +2623,11 @@ public class GTURTLEModeling {
         List<HwNode> path = new ArrayList<HwNode>();
         Map<HwNode, List<HwNode>> pathMap = new HashMap<HwNode, List<HwNode>>();
         TraceManager.addDev("Links " + links);
-        if (node1==node2){
+        if (node1 == node2) {
             return true;
         }
-        for (HwLink link: links){
-            if (link.hwnode == node1){
+        for (HwLink link : links) {
+            if (link.hwnode == node1) {
                 found.add(link.bus);
                 List<HwNode> tmp = new ArrayList<HwNode>();
                 tmp.add(link.bus);
@@ -2687,23 +2635,22 @@ public class GTURTLEModeling {
             }
         }
         outerloop:
-        while (found.size()>0){
+        while (found.size() > 0) {
             HwNode curr = found.remove(0);
-            for (HwLink link: links){
-                if (curr == link.bus){
-                    if (link.hwnode == node2){
+            for (HwLink link : links) {
+                if (curr == link.bus) {
+                    if (link.hwnode == node2) {
                         path = pathMap.get(curr);
                         break outerloop;
                     }
-                    if (!done.contains(link.hwnode) && !found.contains(link.hwnode) && link.hwnode instanceof HwBridge){
+                    if (!done.contains(link.hwnode) && !found.contains(link.hwnode) && link.hwnode instanceof HwBridge) {
                         found.add(link.hwnode);
                         List<HwNode> tmp = new ArrayList<HwNode>(pathMap.get(curr));
                         tmp.add(link.hwnode);
                         pathMap.put(link.hwnode, tmp);
                     }
-                }
-                else if (curr == link.hwnode){
-                    if (!done.contains(link.bus) && !found.contains(link.bus)){
+                } else if (curr == link.hwnode) {
+                    if (!done.contains(link.bus) && !found.contains(link.bus)) {
                         found.add(link.bus);
                         List<HwNode> tmp = new ArrayList<HwNode>(pathMap.get(curr));
                         tmp.add(link.bus);
@@ -2713,17 +2660,16 @@ public class GTURTLEModeling {
             }
             done.add(curr);
         }
-        if (path.size() ==0){
+        if (path.size() == 0) {
             System.out.println("no path");
             return true;
-        }
-        else {
+        } else {
             HwBus bus;
             //Check if all buses and bridges are private
-            for (HwNode n: path){
-                if (n instanceof HwBus){
+            for (HwNode n : path) {
+                if (n instanceof HwBus) {
                     bus = (HwBus) n;
-                    if (bus.privacy ==0){
+                    if (bus.privacy == 0) {
                         return false;
                     }
                 }
@@ -2732,81 +2678,79 @@ public class GTURTLEModeling {
         return secure;
     }
 
-    public void autoMapKeys(){
+    public void autoMapKeys() {
         TraceManager.addDev("auto map keys");
-        if (tmap==null){
+        if (tmap == null) {
             return;
         }
         List<HwLink> links = tmap.getArch().getHwLinks();
         //Find all Security Patterns, if they don't have an associated memory at encrypt and decrypt, map them
         TMLModeling<TGComponent> tmlm = tmap.getTMLModeling();
-        if (tmlm.securityTaskMap ==null){
+        if (tmlm.securityTaskMap == null) {
             return;
         }
         //      System.out.println(tmlm.securityTaskMap);
-        for (SecurityPattern sp: tmlm.securityTaskMap.keySet()){
-            if (sp.type.contains("Symmetric Encryption") || sp.type.equals("MAC")){
-                TraceManager.addDev("Adding keys for "+sp.name);
-                for (TMLTask t:tmlm.securityTaskMap.get(sp)){
+        for (SecurityPattern sp : tmlm.securityTaskMap.keySet()) {
+            if (sp.type.contains("Symmetric Encryption") || sp.type.equals("MAC")) {
+                TraceManager.addDev("Adding keys for " + sp.name);
+                for (TMLTask t : tmlm.securityTaskMap.get(sp)) {
                     ArrayList<HwMemory> mems = new ArrayList<HwMemory>();
-                    boolean keyFound=false;
+                    boolean keyFound = false;
                     HwExecutionNode node1 = (HwExecutionNode) tmap.getHwNodeOf(t);
                     //Try to find memory using only private buses
                     List<HwNode> toVisit = new ArrayList<HwNode>();
                     //  List<HwNode> toMemory = new ArrayList<HwNode>();
                     List<HwNode> complete = new ArrayList<HwNode>();
-                    for (HwLink link:links){
-                        if (link.hwnode==node1){
-                            if (link.bus.privacy==1){
+                    for (HwLink link : links) {
+                        if (link.hwnode == node1) {
+                            if (link.bus.privacy == 1) {
                                 toVisit.add(link.bus);
                             }
                         }
                     }
                     memloop:
-                    while (toVisit.size()>0){
+                    while (toVisit.size() > 0) {
                         HwNode curr = toVisit.remove(0);
-                        for (HwLink link: links){
-                            if (curr == link.bus){
-                                if (link.hwnode instanceof HwMemory){
+                        for (HwLink link : links) {
+                            if (curr == link.bus) {
+                                if (link.hwnode instanceof HwMemory) {
                                     mems.add((HwMemory) link.hwnode);
-                                    TMLArchiMemoryNode memNode= (TMLArchiMemoryNode) listE.getTG(link.hwnode);
+                                    TMLArchiMemoryNode memNode = (TMLArchiMemoryNode) listE.getTG(link.hwnode);
                                     ArrayList<TMLArchiKey> keys = memNode.getKeyList();
-                                    String patternString= "";
-                                    for (TMLArchiKey key: keys){
-                                        if (key.getValue().equals(sp.name)){
+                                    String patternString = "";
+                                    for (TMLArchiKey key : keys) {
+                                        if (key.getValue().equals(sp.name)) {
 
-                                            keyFound=true;
+                                            keyFound = true;
                                             break memloop;
                                         }
                                         patternString += key.getValue();
                                         patternString += " ";
                                     }
-                                    TraceManager.addDev("Memory "+ link.hwnode.getName() + " has currently mapped: " + patternString);
+                                    TraceManager.addDev("Memory " + link.hwnode.getName() + " has currently mapped: " + patternString);
                                 }
-                                if (!complete.contains(link.hwnode) && !toVisit.contains(link.hwnode) && link.hwnode instanceof HwBridge){
+                                if (!complete.contains(link.hwnode) && !toVisit.contains(link.hwnode) && link.hwnode instanceof HwBridge) {
                                     toVisit.add(link.hwnode);
                                 }
-                            }
-                            else if (curr == link.hwnode){
-                                if (!complete.contains(link.bus) && !toVisit.contains(link.bus)){
+                            } else if (curr == link.hwnode) {
+                                if (!complete.contains(link.bus) && !toVisit.contains(link.bus)) {
                                     toVisit.add(link.bus);
                                 }
                             }
                         }
                         complete.add(curr);
                     }
-                    if (!keyFound){
-                        if (mems.size()>0){
-                            TMLArchiMemoryNode memNode= (TMLArchiMemoryNode) listE.getTG(mems.get(0));
+                    if (!keyFound) {
+                        if (mems.size() > 0) {
+                            TMLArchiMemoryNode memNode = (TMLArchiMemoryNode) listE.getTG(mems.get(0));
                             TMLArchiKey key = new TMLArchiKey(memNode.x, memNode.y, memNode.tdp.getMinX(), memNode.tdp.getMaxX(), memNode.tdp.getMinY(), memNode.tdp.getMaxY(), false, memNode, memNode.tdp);
                             key.setReferenceKey(sp.name);
                             key.makeFullValue();
-                            TraceManager.addDev("Adding " +sp.name+ " key to " +memNode.getName());
-                            TraceManager.addDev("Adding " +sp + " key to " +memNode.getName());
-                            memNode.tdp.addComponent(key, memNode.x, memNode.y, true,true);
+                            TraceManager.addDev("Adding " + sp.name + " key to " + memNode.getName());
+                            TraceManager.addDev("Adding " + sp + " key to " + memNode.getName());
+                            memNode.tdp.addComponent(key, memNode.x, memNode.y, true, true);
                             memNode.tdp.repaint();
-                        }
-                        else {
+                        } else {
                             System.out.println("Can't map key to memory for " + sp.name + " on task " + t.getName());
                             UICheckingError ce = new UICheckingError(CheckingError.STRUCTURE_ERROR, "Cannot map key in memory for " + sp.name + " on task " + t.getName());
                             ce.setTDiagramPanel(tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel());
@@ -2815,68 +2759,65 @@ public class GTURTLEModeling {
                         }
                     }
                 }
-            }
-            else if (sp.type.contains("Asymmetric Encryption")){
-                 for (TMLTask t:tmlm.securityTaskMap.get(sp)){
+            } else if (sp.type.contains("Asymmetric Encryption")) {
+                for (TMLTask t : tmlm.securityTaskMap.get(sp)) {
                     ArrayList<HwMemory> mems = new ArrayList<HwMemory>();
-                    boolean keyFound=false;
+                    boolean keyFound = false;
                     HwExecutionNode node1 = (HwExecutionNode) tmap.getHwNodeOf(t);
                     //Try to find memory using only private buses
                     List<HwNode> toVisit = new ArrayList<HwNode>();
                     //  List<HwNode> toMemory = new ArrayList<HwNode>();
                     List<HwNode> complete = new ArrayList<HwNode>();
-                    for (HwLink link:links){
-                        if (link.hwnode==node1){
-                            if (link.bus.privacy==1){
+                    for (HwLink link : links) {
+                        if (link.hwnode == node1) {
+                            if (link.bus.privacy == 1) {
                                 toVisit.add(link.bus);
                             }
                         }
                     }
                     memloop:
-                    while (toVisit.size()>0){
+                    while (toVisit.size() > 0) {
                         HwNode curr = toVisit.remove(0);
-                        for (HwLink link: links){
-                            if (curr == link.bus){
-                                if (link.hwnode instanceof HwMemory){
+                        for (HwLink link : links) {
+                            if (curr == link.bus) {
+                                if (link.hwnode instanceof HwMemory) {
                                     mems.add((HwMemory) link.hwnode);
-                                    TMLArchiMemoryNode memNode= (TMLArchiMemoryNode) listE.getTG(link.hwnode);
+                                    TMLArchiMemoryNode memNode = (TMLArchiMemoryNode) listE.getTG(link.hwnode);
                                     ArrayList<TMLArchiKey> keys = memNode.getKeyList();
-                                    String patternString= "";
-                                    for (TMLArchiKey key: keys){
-                                        if (key.getValue().equals(sp.name)){
+                                    String patternString = "";
+                                    for (TMLArchiKey key : keys) {
+                                        if (key.getValue().equals(sp.name)) {
 
-                                            keyFound=true;
+                                            keyFound = true;
                                             break memloop;
                                         }
                                         patternString += key.getValue();
                                         patternString += " ";
                                     }
-                                    TraceManager.addDev("Memory "+ link.hwnode.getName() + " has currently mapped: " + patternString);
+                                    TraceManager.addDev("Memory " + link.hwnode.getName() + " has currently mapped: " + patternString);
                                 }
-                                if (!complete.contains(link.hwnode) && !toVisit.contains(link.hwnode) && link.hwnode instanceof HwBridge){
+                                if (!complete.contains(link.hwnode) && !toVisit.contains(link.hwnode) && link.hwnode instanceof HwBridge) {
                                     toVisit.add(link.hwnode);
                                 }
-                            }
-                            else if (curr == link.hwnode){
-                                if (!complete.contains(link.bus) && !toVisit.contains(link.bus)){
+                            } else if (curr == link.hwnode) {
+                                if (!complete.contains(link.bus) && !toVisit.contains(link.bus)) {
                                     toVisit.add(link.bus);
                                 }
                             }
                         }
                         complete.add(curr);
                     }
-                    if (!keyFound){
-                        if (mems.size()>0){
-                            TMLArchiMemoryNode memNode= (TMLArchiMemoryNode) listE.getTG(mems.get(0));
+                    if (!keyFound) {
+                        if (mems.size() > 0) {
+                            TMLArchiMemoryNode memNode = (TMLArchiMemoryNode) listE.getTG(mems.get(0));
                             TMLArchiKey key = new TMLArchiKey(memNode.x, memNode.y, memNode.tdp.getMinX(), memNode.tdp.getMaxX(), memNode.tdp.getMinY(), memNode.tdp.getMaxY(), false, memNode, memNode.tdp);
                             key.setReferenceKey(sp.name);
                             key.makeFullValue();
-                            TraceManager.addDev("Adding " +sp.name+ " key to " +memNode.getName());
-                            TraceManager.addDev("Adding " +sp + " key to " +memNode.getName());
-                            memNode.tdp.addComponent(key, memNode.x, memNode.y, true,true);
+                            TraceManager.addDev("Adding " + sp.name + " key to " + memNode.getName());
+                            TraceManager.addDev("Adding " + sp + " key to " + memNode.getName());
+                            memNode.tdp.addComponent(key, memNode.x, memNode.y, true, true);
                             memNode.tdp.repaint();
-                        }
-                        else {
+                        } else {
                             System.out.println("Can't map key to memory for " + sp.name + " on task " + t.getName());
                             UICheckingError ce = new UICheckingError(CheckingError.STRUCTURE_ERROR, "Cannot map key in memory for " + sp.name + " on task " + t.getName());
                             ce.setTDiagramPanel(tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel());
@@ -2890,15 +2831,14 @@ public class GTURTLEModeling {
         TraceManager.addDev("Mapping finished");
     }
 
-    public void generateAvatarFromTML(boolean mc, boolean security){
+    public void generateAvatarFromTML(boolean mc, boolean security) {
         TraceManager.addDev("Generating Avatar from TML");
-        if (tmlm!=null && tmap==null){
+        if (tmlm != null && tmap == null) {
             tmap = tmlm.getDefaultMapping();
         }
-        if (avatarspec!=null){
+        if (avatarspec != null) {
             return;
-        }
-        else if (tmap!=null){
+        } else if (tmap != null) {
             t2a = new TML2Avatar(tmap, mc, security);
             TraceManager.addDev("Avatar spec generation");
             avatarspec = t2a.generateAvatarSpec("1");
@@ -2908,23 +2848,20 @@ public class GTURTLEModeling {
 
     public boolean generateProVerifFromAVATAR(String _path, int _stateReachability, boolean _typed, boolean allowPrivateChannelDuplication, String loopLimit) {
         //      System.out.println(avatarspec);
-        if (avatarspec !=null){
+        if (avatarspec != null) {
             //use avspec
-        }
-        else if (tmap!=null){
-            t2a = new TML2Avatar(tmap,false,true);
+        } else if (tmap != null) {
+            t2a = new TML2Avatar(tmap, false, true);
             avatarspec = t2a.generateAvatarSpec(loopLimit);
             drawPanel(avatarspec, mgui.getFirstAvatarDesignPanelFound());
 
-        }
-        else if (tmlm!=null){
+        } else if (tmlm != null) {
             //Generate default mapping
             tmap = tmlm.getDefaultMapping();
-          
-            t2a=new TML2Avatar(tmap,false,true);
+
+            t2a = new TML2Avatar(tmap, false, true);
             avatarspec = t2a.generateAvatarSpec(loopLimit);
-        }
-        else if (avatarspec == null){
+        } else if (avatarspec == null) {
             return false;
         }
 
@@ -2937,7 +2874,7 @@ public class GTURTLEModeling {
         mgui.setMode(MainGUI.EDIT_PROVERIF_OK);
         //uppaalTable = tml2uppaal.getRelationTIFUPPAAL(_debug);
         try {
-            if (avatar2proverif.saveInFile(_path)){
+            if (avatar2proverif.saveInFile(_path)) {
                 TraceManager.addDev("Specification generated in " + _path);
                 return true;
             }
@@ -2982,18 +2919,18 @@ public class GTURTLEModeling {
     }
 
     public ArrayList<TGComponentAndUPPAALQuery> getUPPAALQueries(TURTLEPanel tp) {
-	return getUPPAALQueries(tp, false);
+        return getUPPAALQueries(tp, false);
     }
 
     public ArrayList<TGComponentAndUPPAALQuery> getUPPAALQueries(TURTLEPanel tp, boolean considerAll) {
         TraceManager.addDev("Searching for queries on " + mgui.getTabName(tp));
         ArrayList<TGComponent> list = new ArrayList<TGComponent>();
         ArrayList<TClass> tclasses;
-	if (considerAll) {
-	    tp.getAllCheckableTGComponent(list);
-	} else {
-	    tp.getAllCheckedTGComponent(list);
-	}
+        if (considerAll) {
+            tp.getAllCheckableTGComponent(list);
+        } else {
+            tp.getAllCheckedTGComponent(list);
+        }
         TGComponentAndUPPAALQuery tmpQ;
 
         ArrayList<TGComponentAndUPPAALQuery> listQ = new ArrayList<TGComponentAndUPPAALQuery>();
@@ -3009,16 +2946,16 @@ public class GTURTLEModeling {
 
             TClass t;
             String s;
-            for(ADComponent adc:listAD) {
+            for (ADComponent adc : listAD) {
                 if (adc != null) {
                     t = tm.findTClass(adc);
                     //TraceManager.addDev("Found class:" + t.getName());
-                    if (t!= null) {
+                    if (t != null) {
                         tclasses = new ArrayList<TClass>();
                         tclasses.add(t);
                         // For handling tobjects
                         tm.addAllTClassesEndingWith(tclasses, "_" + t.getName());
-                        for(TClass tc: tclasses) {
+                        for (TClass tc : tclasses) {
                             //TraceManager.addDev("Analyzing class:" + tc.getName());
                             s = uppaalTIFTable.getRQuery(tc, adc);
                             if (s != null) {
@@ -3040,16 +2977,16 @@ public class GTURTLEModeling {
 
             TMLTask task;
             String s;
-            for(TMLActivityElement elt:listAE) {
+            for (TMLActivityElement elt : listAE) {
                 if (elt != null) {
                     task = tmlm.findTMLTask(elt);
-                    if (task!= null) {
+                    if (task != null) {
                         s = uppaalTMLTable.getRQuery(task, elt);
                         if (s != null) {
                             //TraceManager.addDev("Adding query:" + s);
                             // Object ref;
                             if (elt.getReferenceObject() instanceof TGComponent) {
-                                tmpQ = new TGComponentAndUPPAALQuery((TGComponent)(elt.getReferenceObject()), s + "$" + elt);
+                                tmpQ = new TGComponentAndUPPAALQuery((TGComponent) (elt.getReferenceObject()), s + "$" + elt);
                             } else {
                                 tmpQ = new TGComponentAndUPPAALQuery(null, s + "$" + elt);
                             }
@@ -3061,11 +2998,11 @@ public class GTURTLEModeling {
 
         } else if ((avatar2uppaal != null) && (tp instanceof AvatarDesignPanel)) {
             TraceManager.addDev("Making UPPAAL queries");
-            for(TGComponent tgc: list) {
+            for (TGComponent tgc : list) {
                 TraceManager.addDev("Making UPPAAL query for " + tgc);
                 String s = avatar2uppaal.getUPPAALIdentification(tgc);
                 TraceManager.addDev("Query: " + s);
-                if ((s!= null) && (s.length() > 0)) {
+                if ((s != null) && (s.length() > 0)) {
                     AvatarBlock block = avatar2uppaal.getBlockFromReferenceObject(tgc);
                     listQ.add(new TGComponentAndUPPAALQuery(tgc, s + "$" + block.getName() + "." + tgc));
                 } else {
@@ -3074,11 +3011,11 @@ public class GTURTLEModeling {
             }
         } else if ((avatar2uppaal != null) && (tp instanceof AttackTreePanel)) {
             TraceManager.addDev("Making UPPAAL queries");
-            for(TGComponent tgc: list) {
+            for (TGComponent tgc : list) {
                 TraceManager.addDev("Making UPPAAL query for " + tgc);
                 String s = avatar2uppaal.getUPPAALIdentification(tgc);
                 TraceManager.addDev("Query: " + s);
-                if ((s!= null) && (s.length() > 0)) {
+                if ((s != null) && (s.length() > 0)) {
                     AvatarBlock block = avatar2uppaal.getBlockFromReferenceObject(tgc);
                     listQ.add(new TGComponentAndUPPAALQuery(tgc, s + "$" + block.getName() + "." + tgc));
                 } else {
@@ -3086,7 +3023,7 @@ public class GTURTLEModeling {
                 }
             }
         }
-		
+
 
         return listQ;
     }
@@ -3245,7 +3182,7 @@ public class GTURTLEModeling {
             JFrameSimulationTrace jfst = new JFrameSimulationTrace("Last simulation trace", sim, type);
             jfst.setIconImage(IconManager.img8);
             //  jfst.setSize(900, 600);
-            GraphicLib.centerOnParent( jfst, 900, 600 );
+            GraphicLib.centerOnParent(jfst, 900, 600);
             jfst.setVisible(true);
         }
     }
@@ -3301,7 +3238,7 @@ public class GTURTLEModeling {
 
     public static String runDOTTY(String data) {
         String fileName = "graph" + graphId + ".dot";
-        graphId ++;
+        graphId++;
 
         RemoteExecutionThread ret = new RemoteExecutionThread(ConfigurationTTool.DOTTYHost, fileName, data, ConfigurationTTool.DOTTYPath + " " + fileName);
         ret.start();
@@ -3332,13 +3269,13 @@ public class GTURTLEModeling {
 
         try {
             FileOutputStream fos = new FileOutputStream(file);
-            while(index1<length) {
-                index2 = Math.min(index1+step, length);
+            while (index1 < length) {
+                index2 = Math.min(index1 + step, length);
                 fos.write(s.substring(index1, index2).getBytes());
                 index1 += step;
             }
             fos.close();
-        } catch(Exception e) {
+        } catch (Exception e) {
             JOptionPane.showMessageDialog(mgui.frame, "Specification could not be saved " + e.getMessage(), "Lotos File Error", JOptionPane.INFORMATION_MESSAGE);
             TraceManager.addError("Specification could not be saved " + e.getMessage());
         }
@@ -3354,7 +3291,7 @@ public class GTURTLEModeling {
     }
 
     public String getLastRTLOTOSSpecification() {
-        return  rtlotos;
+        return rtlotos;
     }
 
     public String getLastTextualDTA() {
@@ -3583,7 +3520,6 @@ public class GTURTLEModeling {
     }
 
 
-
     public TURTLEModeling getTURTLEModeling() {
         return tm;
     }
@@ -3595,9 +3531,11 @@ public class GTURTLEModeling {
     public TMLModeling<TGComponent> getTMLModeling() {
         return tmlm;
     }
-    public TML2Avatar getTML2Avatar(){
+
+    public TML2Avatar getTML2Avatar() {
         return t2a;
     }
+
     public TMLMapping<TGComponent> getArtificialTMLMapping() {
         return artificialtmap;
     }
@@ -3611,20 +3549,34 @@ public class GTURTLEModeling {
     }
 
     // TREE MANAGEMENT
-
     public void expandToErrors() {
-	if (mcvdt != null) {
-	    SyntaxAnalysisErrorTree saet = mcvdt.getSyntaxAnalysisErrorTree();
-	    if (saet != null) {
-		Object []obj = new Object[3];
-		obj[0] = mgui.dtree.getModel().getRoot();
-		obj[1] = mcvdt;
-		obj[2] = saet;
-		TraceManager.addDev("Expanding Path because of errors");
-		mgui.dtree.expandMyPath(new TreePath(obj));
-		mgui.dtree.forceUpdate();
-	    }
-	}
+        if ((mcvdt != null) && (checkingErrors != null) && (checkingErrors.size() > 0)){
+            SyntaxAnalysisErrorTree saet = mcvdt.getSyntaxAnalysisErrorTree();
+            if (saet != null) {
+                Object[] obj = new Object[3];
+                obj[0] = mgui.dtree.getModel().getRoot();
+                obj[1] = mcvdt;
+                obj[2] = saet;
+                TraceManager.addDev("Expanding Path because of errors");
+                mgui.dtree.expandMyPath(new TreePath(obj));
+                mgui.dtree.forceUpdate();
+            }
+        }
+    }
+
+    public void expandToWarnings() {
+        if ((mcvdt != null) && (warnings != null) && (warnings.size() > 0)) {
+            SyntaxAnalysisWarningTree sawt = mcvdt.getSyntaxAnalysisWarningTree();
+            if (sawt != null) {
+                Object[] obj = new Object[3];
+                obj[0] = mgui.dtree.getModel().getRoot();
+                obj[1] = mcvdt;
+                obj[2] = sawt;
+                TraceManager.addDev("Expanding Path because of warnings");
+                mgui.dtree.expandMyPath(new TreePath(obj));
+                mgui.dtree.forceUpdate();
+            }
+        }
     }
 
     public String toString() {
@@ -3642,7 +3594,7 @@ public class GTURTLEModeling {
             return mcvdt;
         } else if (index == (panels.size() + 1)) {
             return gt;
-        }  else if (index == (panels.size() + 2)) {
+        } else if (index == (panels.size() + 2)) {
             return idt;
         } else {
             return st;
@@ -3668,7 +3620,7 @@ public class GTURTLEModeling {
             return panels.size() + 2;
         }
 
-        return panels.size()+3;
+        return panels.size() + 3;
     }
 
     // Projection management
@@ -3688,7 +3640,7 @@ public class GTURTLEModeling {
         MasterGateManager mgm = new MasterGateManager(tm, 1);
         //   Gate g;
         GroupOfGates gog;
-        Hashtable <String, GroupOfGates> hashtable = new Hashtable<String, GroupOfGates>();
+        Hashtable<String, GroupOfGates> hashtable = new Hashtable<String, GroupOfGates>();
 
         //   int cpt = 0;
 
@@ -3696,7 +3648,7 @@ public class GTURTLEModeling {
 
         // Fill Hashtable
         // int j;
-        for (TClassAndGateDS tag: gates) {
+        for (TClassAndGateDS tag : gates) {
             //TraceManager.addDev("TClass:" + tag.getTClassName() + " Gate:" + tag.getGateName());
             //actionName = tag.getGateName();
             //g = mgm.getGate(tag.getTClassName(), actionName);
@@ -3717,7 +3669,7 @@ public class GTURTLEModeling {
         }
 
         try {
-            while((s = br.readLine()) != null) {
+            while ((s = br.readLine()) != null) {
                 /*if (cpt % 10000 == 0) {
                   TraceManager.addDev("cpt=" + cpt);
                   }*/
@@ -3808,31 +3760,31 @@ public class GTURTLEModeling {
         int index1, index2, index3, index4;
         Gate g;
         String g0, g1, g2;
-        int cpt, transi=0;
+        int cpt, transi = 0;
         MasterGateManager mgm = new MasterGateManager(tm, 1);
         Map<String, Gate> ht = mgm.getGatesUpperCaseHashTable();
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
 
         //TraceManager.addDev("input data=" + inputData);
 
         //   int cpt1 = 0;
 
         try {
-            while((s = br.readLine()) != null) {
+            while ((s = br.readLine()) != null) {
                 //   cpt1 ++;
                 //if (cpt1 % 100000 == 0) {
                 //TraceManager.addDev("=" + cpt1 + " / " + transi);
                 //}
                 if (s.charAt(0) == '(') {
                     index1 = s.indexOf(",");
-                    if ((index1 > -1) && ((index1+1) < s.length())) {
+                    if ((index1 > -1) && ((index1 + 1) < s.length())) {
                         g1 = s.substring(0, index1 + 1);
-                        s = s.substring(index1+1, s.length());
+                        s = s.substring(index1 + 1, s.length());
 
                         //TraceManager.addDev("g1=" + g1 + " s=" + s);
 
                         index2 = s.indexOf(",");
-                        if ((index2 > -1) && ((index2+1) < s.length())) {
+                        if ((index2 > -1) && ((index2 + 1) < s.length())) {
                             g2 = s.substring(index2, s.length());
                             s = s.substring(0, index2);
                             s = s.trim();
@@ -3847,17 +3799,17 @@ public class GTURTLEModeling {
                                 g0 = "";
                             } else {
                                 // Extract action name
-                                actionName = s.substring(index3+1, s.indexOf('!')).trim();
+                                actionName = s.substring(index3 + 1, s.indexOf('!')).trim();
 
                                 // Format data
                                 g0 = "<";
                                 cpt = 0;
-                                while((index4 = s.indexOf('!')) > -1) {
-                                    s = s.substring(index4+1, s.length());
+                                while ((index4 = s.indexOf('!')) > -1) {
+                                    s = s.substring(index4 + 1, s.length());
                                     if (cpt > 0) {
                                         g0 += ",";
                                     }
-                                    cpt ++;
+                                    cpt++;
                                     index4 = s.indexOf('!');
                                     if (index4 > -1) {
                                         g0 += s.substring(0, index4);
@@ -3890,7 +3842,7 @@ public class GTURTLEModeling {
                     }
                 } else if (s.startsWith("des")) {
                     index1 = s.indexOf(",");
-                    s1 = s.substring(index1+1, s.length());
+                    s1 = s.substring(index1 + 1, s.length());
                     index1 = s1.indexOf(",");
                     s1 = s1.substring(0, index1).trim();
                     //TraceManager.addDev("nb of transitions=" + s);
@@ -3913,10 +3865,10 @@ public class GTURTLEModeling {
         int i, j;
         TClassAndGateDS tcg;
         String nameTClass, nameGate;
-        for(i=0; i<gog.size(); i++) {
+        for (i = 0; i < gog.size(); i++) {
             nameTClass = gog.getTClassAt(i).getName();
             nameGate = gog.getGateAt(i).getName();
-            for(j=0; j<gates.size(); j++) {
+            for (j = 0; j < gates.size(); j++) {
                 tcg = gates.elementAt(j);
 
                 if ((tcg.getTClassName().compareTo(nameTClass) == 0) && (tcg.getGateName().compareTo(nameGate) == 0)) {
@@ -3934,14 +3886,14 @@ public class GTURTLEModeling {
         int index1, index2;
         index1 = s.indexOf("i(");
         index2 = s.indexOf(")");
-        return s.substring(0, index1-1) + "i" + s.substring(index2+2, s.length());
+        return s.substring(0, index1 - 1) + "i" + s.substring(index2 + 2, s.length());
     }
 
     public String makeAction(String s, String actionName) {
         int index1, index2;
         index1 = s.indexOf("i(");
         index2 = s.indexOf(")");
-        return s.substring(0, index1) + actionName + s.substring(index2+1, s.length());
+        return s.substring(0, index1) + actionName + s.substring(index2 + 1, s.length());
     }
 
     public void enableUndo(boolean b) {
@@ -3967,17 +3919,17 @@ public class GTURTLEModeling {
 
         if ((pointerOperation > -1) && (pointerOperation < savedOperations.size() - 1)) {
             // some save operations must be erased
-            for (int i = pointerOperation +1; i<savedOperations.size(); i++) {
+            for (int i = pointerOperation + 1; i < savedOperations.size(); i++) {
                 savedOperations.removeElementAt(i);
                 savedPanels.removeElementAt(i);
-                i --;
+                i--;
             }
         }
 
         // save actions on tab
         int size = savedPanels.size();
         if (size > 0) {
-            Point p1  = savedPanels.elementAt(size - 1); // panels are saved under the form of a point -> x = analysis/design, y = panel
+            Point p1 = savedPanels.elementAt(size - 1); // panels are saved under the form of a point -> x = analysis/design, y = panel
             if (p == null)
                 p = p1;
             /*if ((p1.x != p.x) || (p1.y != p.y)){
@@ -4005,7 +3957,7 @@ public class GTURTLEModeling {
     public void backward() {
         undoRunning = true;
         TraceManager.addDev("Nb Of saved operations:" + savedOperations.size() + " pointer=" + pointerOperation);
-        if ((pointerOperation < 1)        || (savedOperations.size() < 2)) {
+        if ((pointerOperation < 1) || (savedOperations.size() < 2)) {
             TraceManager.addDev("Undo not possible");
             undoRunning = false;
             return;
@@ -4015,10 +3967,10 @@ public class GTURTLEModeling {
         mgui.reinitMainTabbedPane();
 
         // Issue #42: the selected tabs should be memorized before decrementing the pointer
-        final Point prevSelectedTabs = savedPanels.elementAt( pointerOperation );
+        final Point prevSelectedTabs = savedPanels.elementAt(pointerOperation);
 
         try {
-            pointerOperation --;
+            pointerOperation--;
             TraceManager.addDev("Decrementing pointer =" + pointerOperation);
             loadModelingFromXML(savedOperations.elementAt(pointerOperation));
 
@@ -4031,9 +3983,9 @@ public class GTURTLEModeling {
         // Issue #42:
         //Point p = savedPanels.elementAt(pointerOperation);
 
-        if ( prevSelectedTabs != null ) {
+        if (prevSelectedTabs != null) {
             TraceManager.addDev("Selecting tab panel=" + prevSelectedTabs.getX() + " diagram=" + prevSelectedTabs.getY());
-            TDiagramPanel tdp = mgui.selectTab( prevSelectedTabs );
+            TDiagramPanel tdp = mgui.selectTab(prevSelectedTabs);
             tdp.mode = TDiagramPanel.NORMAL;
             tdp.setDraw(true);
             tdp.repaint();
@@ -4045,7 +3997,7 @@ public class GTURTLEModeling {
     }
 
     public void selectBackwardMode() {
-        if (pointerOperation <0) {
+        if (pointerOperation < 0) {
             mgui.setMode(MainGUI.NO_BACKWARD);
             mgui.setMode(MainGUI.NO_FORWARD);
         } else {
@@ -4053,7 +4005,7 @@ public class GTURTLEModeling {
             // forward
             if (pointerOperation < savedOperations.size() - 1) {
                 mgui.setMode(MainGUI.FORWARD);
-            }  else {
+            } else {
                 mgui.setMode(MainGUI.NO_FORWARD);
             }
 
@@ -4068,7 +4020,7 @@ public class GTURTLEModeling {
 
 
     public void forward() {
-        if ((pointerOperation < 0) || (pointerOperation >          savedOperations.size() - 2)) {
+        if ((pointerOperation < 0) || (pointerOperation > savedOperations.size() - 2)) {
             return;
         }
 
@@ -4077,18 +4029,18 @@ public class GTURTLEModeling {
         mgui.reinitMainTabbedPane();
 
         // Issue #42: the selected tabs should be memorized before incrementing the pointer
-        final Point prevSelectedTabs = savedPanels.elementAt( pointerOperation );
+        final Point prevSelectedTabs = savedPanels.elementAt(pointerOperation);
 
         try {
-            pointerOperation ++;
+            pointerOperation++;
             loadModelingFromXML(savedOperations.elementAt(pointerOperation));
         } catch (Exception e) {
             TraceManager.addError("Exception in forward: " + e.getMessage());
         }
 
         //Point prevSelectedTabs = savedPanels.elementAt(pointerOperation);
-        if ( prevSelectedTabs != null ) {
-            TDiagramPanel tdp = mgui.selectTab( prevSelectedTabs );
+        if (prevSelectedTabs != null) {
+            TDiagramPanel tdp = mgui.selectTab(prevSelectedTabs);
             tdp.mode = TDiagramPanel.NORMAL;
             tdp.setDraw(true);
             tdp.repaint();
@@ -4116,7 +4068,7 @@ public class GTURTLEModeling {
         listE = dpt.getCorrespondanceTGElement();
         checkingErrors = dpt.getErrors();
         warnings = dpt.getWarnings();
-        if ((checkingErrors != null) && (checkingErrors.size() >0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         }
 
@@ -4128,7 +4080,7 @@ public class GTURTLEModeling {
             checkingErrors = tmc.syntaxAnalysisChecking();
             warnings.addAll(tmc.getWarnings());
 
-            if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+            if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
                 analyzeErrors();
                 return false;
             } else {
@@ -4195,7 +4147,7 @@ public class GTURTLEModeling {
         AvatarDesignPanel adp = null;
 
         try {
-            adp = (AvatarDesignPanel)(avatarspec.getInformationSource());
+            adp = (AvatarDesignPanel) (avatarspec.getInformationSource());
         } catch (Exception e) {
             TraceManager.addDev("Exception gtm: " + e.getMessage());
             return -1;
@@ -4205,7 +4157,7 @@ public class GTURTLEModeling {
         LinkedList<TGComponent> compInMutex = adp.getListOfComponentsInMutex();
         TraceManager.addDev("Nb of elements in mutex:" + compInMutex.size());
 
-        if (compInMutex.size() ==0) {
+        if (compInMutex.size() == 0) {
             return -2;
         }
 
@@ -4214,12 +4166,12 @@ public class GTURTLEModeling {
         int nbOfFound;
         int cpt = 0;
         // Go thru invariants, and see whether one contains
-        for(Invariant inv: invariants) {
+        for (Invariant inv : invariants) {
             comps = inv.getComponents();
             nbOfFound = 0;
-            for(TGComponent tgc_mutex: compInMutex) {
+            for (TGComponent tgc_mutex : compInMutex) {
                 found = false;
-                for(TGComponent tgc_inv: comps) {
+                for (TGComponent tgc_inv : comps) {
                     if (tgc_mutex == tgc_inv) {
                         found = true;
                         break;
@@ -4228,20 +4180,20 @@ public class GTURTLEModeling {
                 if (!found) {
                     break;
                 }
-                nbOfFound ++;
+                nbOfFound++;
             }
             if (nbOfFound == compInMutex.size()) {
                 TraceManager.addDev("Mutex found in inv:" + cpt);
-                for(TGComponent tgc: compInMutex) {
+                for (TGComponent tgc : compInMutex) {
                     tgc.setMutexResult(TGComponent.MUTEX_OK);
                 }
                 return cpt;
             }
-            cpt ++;
+            cpt++;
         }
 
 
-        for(TGComponent tgc: compInMutex) {
+        for (TGComponent tgc : compInMutex) {
             tgc.setMutexResult(TGComponent.MUTEX_UNKNOWN);
         }
 
@@ -4258,7 +4210,7 @@ public class GTURTLEModeling {
         AvatarDesignPanel adp = null;
 
         try {
-            adp = (AvatarDesignPanel)(avatarspec.getInformationSource());
+            adp = (AvatarDesignPanel) (avatarspec.getInformationSource());
         } catch (Exception e) {
             TraceManager.addDev("Exception gtm: " + e.getMessage());
             return;
@@ -4271,7 +4223,6 @@ public class GTURTLEModeling {
         adp.removeAllMutualExclusionWithMasterMutex();
 
 
-
     }
 
 
@@ -4286,10 +4237,10 @@ public class GTURTLEModeling {
             return -1;
         }
 
-        for(Invariant inv: invariants) {
+        for (Invariant inv : invariants) {
             if (inv.containsComponent(state)) {
                 // All other states are in mutual exclusion
-                for(TGComponent tgc: inv.getComponents()) {
+                for (TGComponent tgc : inv.getComponents()) {
                     if ((tgc instanceof AvatarSMDState) && (tgc != state)) {
                         if (tgc.getTDiagramPanel() != state.getTDiagramPanel()) {
                             if (!(list.contains(tgc))) {
@@ -4325,16 +4276,16 @@ public class GTURTLEModeling {
             return;
         }
 
-        AvatarDesignPanel adp = (AvatarDesignPanel)(tp);
+        AvatarDesignPanel adp = (AvatarDesignPanel) (tp);
         adp.reinitMutualExclusionStates();
 
         // First step: build a list of all states being in invariants
         Vector<AvatarSMDState> v = new Vector<AvatarSMDState>();
-        for(Invariant inv: invariants) {
-            for(TGComponent tgc: inv.getComponents()) {
+        for (Invariant inv : invariants) {
+            for (TGComponent tgc : inv.getComponents()) {
                 if (tgc instanceof AvatarSMDState) {
                     if (!(v.contains(tgc))) {
-                        v.add((AvatarSMDState)tgc);
+                        v.add((AvatarSMDState) tgc);
                     }
                 }
             }
@@ -4342,15 +4293,15 @@ public class GTURTLEModeling {
 
         // Then, add to all states its list of mutually exclusive states
 
-        for(AvatarSMDState s: v) {
+        for (AvatarSMDState s : v) {
             Vector<AvatarSMDState> v0 = new Vector<AvatarSMDState>();
-            for(Invariant inv: invariants) {
+            for (Invariant inv : invariants) {
                 if (inv.containsComponent(s)) {
-                    for(TGComponent tgc: inv.getComponents()) {
+                    for (TGComponent tgc : inv.getComponents()) {
                         if ((tgc instanceof AvatarSMDState) && (tgc != s)) {
                             if (tgc.getTDiagramPanel() != s.getTDiagramPanel()) {
                                 if (!(v0.contains(tgc))) {
-                                    v0.add((AvatarSMDState)tgc);
+                                    v0.add((AvatarSMDState) tgc);
                                 }
                             }
                         }
@@ -4359,7 +4310,7 @@ public class GTURTLEModeling {
             }
             TraceManager.addDev("State " + s.getStateName() + " has " + v0.size() + " mutually eclusive states");
 
-            for(AvatarSMDState s0: v0) {
+            for (AvatarSMDState s0 : v0) {
                 s.addMutexState(s0);
             }
         }
@@ -4377,7 +4328,7 @@ public class GTURTLEModeling {
         checkingErrors = tmc.syntaxAnalysisChecking();
         warnings.addAll(tmc.getWarnings());
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             analyzeErrors();
             return false;
         } else {
@@ -4437,7 +4388,7 @@ public class GTURTLEModeling {
             return null;
         }
 
-        tmp = tmp.substring(index2+1, tmp.length());
+        tmp = tmp.substring(index2 + 1, tmp.length());
 
         return modeling + tmp;
     }
@@ -4461,15 +4412,15 @@ public class GTURTLEModeling {
         if (tgc instanceof AvatarBDBlock) {
             AvatarSMDPanel asmdp = mgui.getAvatarSMDPanel(mgui.getCurrentSelectedIndex(), tgc.getValue());
             s.append(asmdp.saveInXML());
-            LinkedList<AvatarBDBlock> list = ((AvatarBDBlock)tgc).getFullBlockList();
-            for(AvatarBDBlock b:list) {
+            LinkedList<AvatarBDBlock> list = ((AvatarBDBlock) tgc).getFullBlockList();
+            for (AvatarBDBlock b : list) {
                 asmdp = mgui.getAvatarSMDPanel(mgui.getCurrentSelectedIndex(), b.getValue());
                 s.append(asmdp.saveInXML());
             }
         }
 
         if (tgc instanceof AvatarBDLibraryFunction) {
-            AvatarSMDPanel asmdp = mgui.getAvatarSMDPanel(mgui.getCurrentSelectedIndex(), ((AvatarBDLibraryFunction) tgc).getFunctionName ());
+            AvatarSMDPanel asmdp = mgui.getAvatarSMDPanel(mgui.getCurrentSelectedIndex(), ((AvatarBDLibraryFunction) tgc).getFunctionName());
             s.append(asmdp.saveInXML());
         }
 
@@ -4495,10 +4446,10 @@ public class GTURTLEModeling {
 
         if (tgc instanceof TMLCCompositeComponent) {
             TMLActivityDiagramPanel tmladp3;
-            List<TMLCPrimitiveComponent> list =  ((TMLCCompositeComponent)tgc).getAllPrimitiveComponents();
+            List<TMLCPrimitiveComponent> list = ((TMLCCompositeComponent) tgc).getAllPrimitiveComponents();
 
-            for (TMLCPrimitiveComponent comp: list) {
-                tmladp3 =  mgui.getTMLActivityDiagramPanel(mgui.getCurrentSelectedIndex(), comp.getValue());
+            for (TMLCPrimitiveComponent comp : list) {
+                tmladp3 = mgui.getTMLActivityDiagramPanel(mgui.getCurrentSelectedIndex(), comp.getValue());
                 s.append(tmladp3.saveInXML());
             }
         }
@@ -4539,7 +4490,7 @@ public class GTURTLEModeling {
         if ((classes != null) && (classes.size() > 0)) {
             TCDTClass t;
             TActivityDiagramPanel tadp;
-            for(int i=0; i<classes.size(); i++) {
+            for (int i = 0; i < classes.size(); i++) {
                 t = classes.elementAt(i);
                 tadp = mgui.getActivityDiagramPanel(mgui.getCurrentSelectedIndex(), t.getValue());
                 s.append(tadp.saveInXML());
@@ -4549,15 +4500,15 @@ public class GTURTLEModeling {
         //Added by Solange
         //bug removed by Emil
         if (tdp instanceof ProactiveCSDPanel) {
-            final Vector<ProCSDComponent> comp =((ProactiveCSDPanel)tdp).selectedProCSDComponent(null);
+            final Vector<ProCSDComponent> comp = ((ProactiveCSDPanel) tdp).selectedProCSDComponent(null);
 
             if ((comp != null) && (comp.size() > 0)) {
                 ProCSDComponent t;
                 ProactiveSMDPanel psmd;
-                for(int i=0; i<comp.size(); i++) {
+                for (int i = 0; i < comp.size(); i++) {
                     t = comp.elementAt(i);
                     psmd = mgui.getSMDPanel(mgui.getCurrentSelectedIndex(), t.getValue());
-                    if (psmd!=null)
+                    if (psmd != null)
                         s.append(psmd.saveInXML());
                 }
             }
@@ -4571,7 +4522,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("Saving TURTLEOS activity diagram Panel...");
             TOSClass t;
             TURTLEOSActivityDiagramPanel tosadp;
-            for(int i=0; i<toClasses.size(); i++) {
+            for (int i = 0; i < toClasses.size(); i++) {
                 t = toClasses.elementAt(i);
                 tosadp = mgui.getTURTLEOSActivityDiagramPanel(mgui.getCurrentSelectedIndex(), t.getValue());
                 s.append(tosadp.saveInXML());
@@ -4583,7 +4534,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("Saving TML activity diagram Panel...");
             TMLTaskOperator t;
             TMLActivityDiagramPanel tmladp;
-            for(int i=0; i<operators.size(); i++) {
+            for (int i = 0; i < operators.size(); i++) {
                 t = operators.elementAt(i);
                 tmladp = mgui.getTMLActivityDiagramPanel(mgui.getCurrentSelectedIndex(), t.getValue());
                 s.append(tmladp.saveInXML());
@@ -4595,7 +4546,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("Saving TML activity diagram Panel...");
             AvatarBDBlock abdb;
             AvatarSMDPanel asmdp;
-            for(int i=0; i<blocks.size(); i++) {
+            for (int i = 0; i < blocks.size(); i++) {
                 abdb = blocks.elementAt(i);
                 asmdp = mgui.getAvatarSMDPanel(mgui.getCurrentSelectedIndex(), abdb.getBlockName());
                 s.append(asmdp.saveInXML());
@@ -4609,7 +4560,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("Saving TML activity diagram Panel...");
             TMLCPrimitiveComponent ct;
             TMLActivityDiagramPanel tmladp;
-            for(int i=0; i<primComps.size(); i++) {
+            for (int i = 0; i < primComps.size(); i++) {
                 ct = primComps.elementAt(i);
                 tmladp = mgui.getTMLActivityDiagramPanel(mgui.getCurrentSelectedIndex(), ct.getValue());
                 s.append(tmladp.saveInXML());
@@ -4670,7 +4621,7 @@ public class GTURTLEModeling {
         TURTLEPanel tp;
         int i;
         // search for diagram panels (Design)
-        for(i=0; i<panels.size(); i++) {
+        for (i = 0; i < panels.size(); i++) {
             if ((index == -1) || (i == index)) {
                 tp = panels.elementAt(i);
                 s = tp.saveInXML(extensionToName);
@@ -4695,9 +4646,9 @@ public class GTURTLEModeling {
         int i, j;
         Vector<TDiagramPanel> panelss;
         // search for diagram panels
-        for(i=0; i<panels.size(); i++) {
+        for (i = 0; i < panels.size(); i++) {
             panelss = (panels.elementAt(i).panels);
-            for(j=0; j<panelss.size(); j++) {
+            for (j = 0; j < panelss.size(); j++) {
                 tdp = panelss.elementAt(j);
                 tdp.removeAll();
             }
@@ -4724,7 +4675,7 @@ public class GTURTLEModeling {
         int beginIndex = tdp.getComponentList().size();
 
         //Added by Solange
-        int cuenta=1;
+        int cuenta = 1;
 
         s = decodeString(s);
 
@@ -4755,7 +4706,7 @@ public class GTURTLEModeling {
             Node adn;
             Element elt;
 
-            for(i=0; i<nl.getLength(); i++) {
+            for (i = 0; i < nl.getLength(); i++) {
                 adn = nl.item(i);
                 if (adn.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) adn;
@@ -4777,10 +4728,10 @@ public class GTURTLEModeling {
                 }
 
 
-                TClassDiagramPanel tcdp = (TClassDiagramPanel)tdp;
+                TClassDiagramPanel tcdp = (TClassDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -4824,9 +4775,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                TActivityDiagramPanel tadp = (TActivityDiagramPanel)tdp;
+                TActivityDiagramPanel tadp = (TActivityDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -4866,9 +4817,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                InteractionOverviewDiagramPanel iodp = (InteractionOverviewDiagramPanel)tdp;
+                InteractionOverviewDiagramPanel iodp = (InteractionOverviewDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -4906,11 +4857,11 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                ui.sd.SequenceDiagramPanel sdp = (ui.sd.SequenceDiagramPanel)tdp;
+                ui.sd.SequenceDiagramPanel sdp = (ui.sd.SequenceDiagramPanel) tdp;
 
                 //TraceManager.addDev("Sequence diagram!");
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -4948,11 +4899,11 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                ui.sd2.SequenceDiagramPanel sdp = (ui.sd2.SequenceDiagramPanel)tdp;
+                ui.sd2.SequenceDiagramPanel sdp = (ui.sd2.SequenceDiagramPanel) tdp;
 
                 //TraceManager.addDev("Sequence diagram!");
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -4990,9 +4941,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                UseCaseDiagramPanel ucdp = (UseCaseDiagramPanel)tdp;
+                UseCaseDiagramPanel ucdp = (UseCaseDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5029,9 +4980,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                TDeploymentDiagramPanel tddp = (TDeploymentDiagramPanel)tdp;
+                TDeploymentDiagramPanel tddp = (TDeploymentDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5068,9 +5019,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                NCDiagramPanel ncdp = (NCDiagramPanel)tdp;
+                NCDiagramPanel ncdp = (NCDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5107,9 +5058,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                RequirementDiagramPanel rdp = (RequirementDiagramPanel)tdp;
+                RequirementDiagramPanel rdp = (RequirementDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5141,9 +5092,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                EBRDDPanel ebrddp = (EBRDDPanel)tdp;
+                EBRDDPanel ebrddp = (EBRDDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5175,9 +5126,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AttackTreeDiagramPanel atdp = (AttackTreeDiagramPanel)tdp;
+                AttackTreeDiagramPanel atdp = (AttackTreeDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5203,16 +5154,16 @@ public class GTURTLEModeling {
                     }
                 }
 
-		} else if (tdp instanceof FaultTreeDiagramPanel) {
+            } else if (tdp instanceof FaultTreeDiagramPanel) {
                 nl = doc.getElementsByTagName("FaultTreeDiagramPanelCopy");
 
                 if (nl == null) {
                     return;
                 }
 
-                FaultTreeDiagramPanel ftdp = (FaultTreeDiagramPanel)tdp;
+                FaultTreeDiagramPanel ftdp = (FaultTreeDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5248,10 +5199,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel)tdp;
+                TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5288,7 +5239,7 @@ public class GTURTLEModeling {
                         //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading done");
                     }
                 }
-            }else if (tdp instanceof DiplodocusMethodologyDiagramPanel) {
+            } else if (tdp instanceof DiplodocusMethodologyDiagramPanel) {
                 nl = doc.getElementsByTagName("DiplodocusMethodologyDiagramPanelCopy");
                 docCopy = doc;
 
@@ -5299,10 +5250,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                DiplodocusMethodologyDiagramPanel tmltdp = (DiplodocusMethodologyDiagramPanel)tdp;
+                DiplodocusMethodologyDiagramPanel tmltdp = (DiplodocusMethodologyDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5341,7 +5292,7 @@ public class GTURTLEModeling {
                 }
 
 
-            }else if (tdp instanceof AvatarMethodologyDiagramPanel) {
+            } else if (tdp instanceof AvatarMethodologyDiagramPanel) {
                 nl = doc.getElementsByTagName("AvatarMethodologyDiagramPanelCopy");
                 docCopy = doc;
 
@@ -5352,10 +5303,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                AvatarMethodologyDiagramPanel amdp = (AvatarMethodologyDiagramPanel)tdp;
+                AvatarMethodologyDiagramPanel amdp = (AvatarMethodologyDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5392,7 +5343,7 @@ public class GTURTLEModeling {
                         //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading done");
                     }
                 }
-            }else if (tdp instanceof SysmlsecMethodologyDiagramPanel) {
+            } else if (tdp instanceof SysmlsecMethodologyDiagramPanel) {
                 nl = doc.getElementsByTagName("SysmlsecMethodologyDiagramPanelCopy");
                 docCopy = doc;
 
@@ -5403,10 +5354,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                SysmlsecMethodologyDiagramPanel amdp = (SysmlsecMethodologyDiagramPanel)tdp;
+                SysmlsecMethodologyDiagramPanel amdp = (SysmlsecMethodologyDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5443,7 +5394,7 @@ public class GTURTLEModeling {
                         //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading done");
                     }
                 }
-            }  else if (tdp instanceof TMLComponentTaskDiagramPanel) {
+            } else if (tdp instanceof TMLComponentTaskDiagramPanel) {
                 nl = doc.getElementsByTagName("TMLComponentTaskDiagramPanelCopy");
                 docCopy = doc;
 
@@ -5454,11 +5405,11 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                TMLComponentTaskDiagramPanel tmlctdp = (TMLComponentTaskDiagramPanel)tdp;
+                TMLComponentTaskDiagramPanel tmlctdp = (TMLComponentTaskDiagramPanel) tdp;
                 //tmlctdp.updateReferences();
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5505,9 +5456,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                TMLActivityDiagramPanel tmladp = (TMLActivityDiagramPanel)tdp;
+                TMLActivityDiagramPanel tmladp = (TMLActivityDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5539,7 +5490,7 @@ public class GTURTLEModeling {
                         makePostLoading(tmladp, beginIndex);
                     }
                 }
-            }  else if (tdp instanceof TMLCPPanel) {
+            } else if (tdp instanceof TMLCPPanel) {
                 nl = doc.getElementsByTagName("CommunicationPatternDiagramPanelCopy");
                 docCopy = doc;
 
@@ -5549,9 +5500,9 @@ public class GTURTLEModeling {
 
                 //TraceManager.addDev("Toto 1");
 
-                TMLCPPanel tmlcpp = (TMLCPPanel)tdp;
+                TMLCPPanel tmlcpp = (TMLCPPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5598,9 +5549,9 @@ public class GTURTLEModeling {
 
                 //TraceManager.addDev("Toto 1");
 
-                TMLSDPanel tmlsdp = (TMLSDPanel)tdp;
+                TMLSDPanel tmlsdp = (TMLSDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5647,9 +5598,9 @@ public class GTURTLEModeling {
 
                 //TraceManager.addDev("Toto 1");
 
-                TMLArchiDiagramPanel tmadp = (TMLArchiDiagramPanel)tdp;
+                TMLArchiDiagramPanel tmadp = (TMLArchiDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5694,9 +5645,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                TURTLEOSClassDiagramPanel toscdp = (TURTLEOSClassDiagramPanel)tdp;
+                TURTLEOSClassDiagramPanel toscdp = (TURTLEOSClassDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5738,9 +5689,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                TURTLEOSActivityDiagramPanel tosadp = (TURTLEOSActivityDiagramPanel)tdp;
+                TURTLEOSActivityDiagramPanel tosadp = (TURTLEOSActivityDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5774,102 +5725,94 @@ public class GTURTLEModeling {
                 }
             } else if (tdp instanceof ProactiveCSDPanel) {
                 //cuenta=beginIndex+1;
-                cuenta=mgui.tabs.size()-1;
+                cuenta = mgui.tabs.size() - 1;
                 nl = doc.getElementsByTagName("ProactiveCSDPanelCopy");
-                if (nl.getLength()==0)
-                    {
-                        nl=doc.getElementsByTagName("ProactiveCSDPanel");
-                    }
+                if (nl.getLength() == 0) {
+                    nl = doc.getElementsByTagName("ProactiveCSDPanel");
+                }
                 docCopy = doc;
-                if (nl == null)
-                    {
-                        return;
-                    }
-                ProactiveCSDPanel pcsdp = (ProactiveCSDPanel)tdp;
-                for(i=0; i<nl.getLength(); i++)
-                    {
-                        adn = nl.item(i);
-                        if (adn.getNodeType() == Node.ELEMENT_NODE)
-                            {
-                                elt = (Element) adn;
-                                if (pcsdp == null)
-                                    {
-                                        throw new MalformedModelingException();
-                                    }
+                if (nl == null) {
+                    return;
+                }
+                ProactiveCSDPanel pcsdp = (ProactiveCSDPanel) tdp;
+                for (i = 0; i < nl.getLength(); i++) {
+                    adn = nl.item(i);
+                    if (adn.getNodeType() == Node.ELEMENT_NODE) {
+                        elt = (Element) adn;
+                        if (pcsdp == null) {
+                            throw new MalformedModelingException();
+                        }
 
 
-                                //                                                                                        int xSel = Integer.decode(elt.getAttribute("xSel")).intValue();
-                                //int ySel = Integer.decode(elt.getAttribute("ySel")).intValue();
-                                //int widthSel = Integer.decode(elt.getAttribute("widthSel")).intValue();
-                                //int heightSel = Integer.decode(elt.getAttribute("heightSel")).intValue();
-
-                                decX = _decX;
-                                decY = _decY;
-
-                                //pcsdp.loadExtraParameters(elt);
-                                //TraceManager.addDev("Toto 2");
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " components");
-                                makeXMLComponents(elt.getElementsByTagName("COMPONENT"), pcsdp);
-                                //TraceManager.addDev("Toto 3");
-                                makePostProcessing(pcsdp);
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " connectors");
-                                makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), pcsdp);
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " subcomponents");
-                                makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), pcsdp);
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " real points");
-                                connectConnectorsToRealPoints(pcsdp);
-                                pcsdp.structureChanged();
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading " + beginIndex);
-                                makePostLoading(pcsdp, beginIndex);
-                                //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading done");
-                            }
+                        //                                                                                        int xSel = Integer.decode(elt.getAttribute("xSel")).intValue();
+                        //int ySel = Integer.decode(elt.getAttribute("ySel")).intValue();
+                        //int widthSel = Integer.decode(elt.getAttribute("widthSel")).intValue();
+                        //int heightSel = Integer.decode(elt.getAttribute("heightSel")).intValue();
+
+                        decX = _decX;
+                        decY = _decY;
+
+                        //pcsdp.loadExtraParameters(elt);
+                        //TraceManager.addDev("Toto 2");
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " components");
+                        makeXMLComponents(elt.getElementsByTagName("COMPONENT"), pcsdp);
+                        //TraceManager.addDev("Toto 3");
+                        makePostProcessing(pcsdp);
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " connectors");
+                        makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), pcsdp);
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " subcomponents");
+                        makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), pcsdp);
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " real points");
+                        connectConnectorsToRealPoints(pcsdp);
+                        pcsdp.structureChanged();
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading " + beginIndex);
+                        makePostLoading(pcsdp, beginIndex);
+                        //TraceManager.addDev("TML task diagram : " + tmltdp.getName() + " post loading done");
                     }
+                }
                 // Added by Solange
                 nl = doc.getElementsByTagName("ProactiveSMDPanel");
-                if (nl == null)
-                    {
-                        return;
-                    }
-                String name="";
+                if (nl == null) {
+                    return;
+                }
+                String name = "";
                 ProactiveSMDPanel psmdp;
-                for(i=0; i<nl.getLength(); i++) //Erased cuenta++ by Solange at the end condition of the for
-                    {
-                        adn = nl.item(i);
-                        if (adn.getNodeType() == Node.ELEMENT_NODE)
-                            {
-                                elt = (Element) adn;
-                                name=elt.getAttribute("name");
-                                //Added by Solange name at the beginning and cuenta
-                                name=mgui.createProActiveSMD(cuenta,name);
-                                psmdp=mgui.getSMDPanel(cuenta, name);
-                                if (psmdp == null)
-                                    {
-                                        throw new MalformedModelingException();
-                                    }
+                for (i = 0; i < nl.getLength(); i++) //Erased cuenta++ by Solange at the end condition of the for
+                {
+                    adn = nl.item(i);
+                    if (adn.getNodeType() == Node.ELEMENT_NODE) {
+                        elt = (Element) adn;
+                        name = elt.getAttribute("name");
+                        //Added by Solange name at the beginning and cuenta
+                        name = mgui.createProActiveSMD(cuenta, name);
+                        psmdp = mgui.getSMDPanel(cuenta, name);
+                        if (psmdp == null) {
+                            throw new MalformedModelingException();
+                        }
 
-                                //                                                                                        int xSel = Integer.decode(elt.getAttribute("minX")).intValue();
-                                //int ySel = Integer.decode(elt.getAttribute("maxX")).intValue(); // - mgui.getCurrentTDiagramPanel().currentX;
-                                //                                                                                        int widthSel = Integer.decode(elt.getAttribute("minY")).intValue(); // - mgui.getCurrentTDiagramPanel().currentY;;
-                                //                                                                                        int heightSel = Integer.decode(elt.getAttribute("maxY")).intValue(); // - mgui.getCurrentTDiagramPanel().currentY;;
-
-                                decX = _decX;
-                                decY = _decY;
-
-                                //tmladp.loadExtraParameters(elt);
-                                //TraceManager.addDev("Activity diagram : " + tadp.getName() + " components");
-                                makeXMLComponents(elt.getElementsByTagName("COMPONENT"), psmdp);
-                                //TraceManager.addDev("Activity diagram : " + tadp.getName() + " connectors");
-                                makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), psmdp);
-                                //TraceManager.addDev("Activity diagram : " + tadp.getName() + " subcomponents");
-                                makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), psmdp);
-                                //TraceManager.addDev("Activity diagram : " + tadp.getName() + " real points");
-                                connectConnectorsToRealPoints(psmdp);
-                                psmdp.structureChanged();
-                                //TraceManager.addDev("Activity diagram : " + tadp.getName() + " post loading");
-                                makePostLoading(psmdp, beginIndex);
-                                //until here
-                            }
+                        //                                                                                        int xSel = Integer.decode(elt.getAttribute("minX")).intValue();
+                        //int ySel = Integer.decode(elt.getAttribute("maxX")).intValue(); // - mgui.getCurrentTDiagramPanel().currentX;
+                        //                                                                                        int widthSel = Integer.decode(elt.getAttribute("minY")).intValue(); // - mgui.getCurrentTDiagramPanel().currentY;;
+                        //                                                                                        int heightSel = Integer.decode(elt.getAttribute("maxY")).intValue(); // - mgui.getCurrentTDiagramPanel().currentY;;
+
+                        decX = _decX;
+                        decY = _decY;
+
+                        //tmladp.loadExtraParameters(elt);
+                        //TraceManager.addDev("Activity diagram : " + tadp.getName() + " components");
+                        makeXMLComponents(elt.getElementsByTagName("COMPONENT"), psmdp);
+                        //TraceManager.addDev("Activity diagram : " + tadp.getName() + " connectors");
+                        makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), psmdp);
+                        //TraceManager.addDev("Activity diagram : " + tadp.getName() + " subcomponents");
+                        makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), psmdp);
+                        //TraceManager.addDev("Activity diagram : " + tadp.getName() + " real points");
+                        connectConnectorsToRealPoints(psmdp);
+                        psmdp.structureChanged();
+                        //TraceManager.addDev("Activity diagram : " + tadp.getName() + " post loading");
+                        makePostLoading(psmdp, beginIndex);
+                        //until here
                     }
+                }
             } else if (tdp instanceof ProactiveSMDPanel) {
                 //Changed by Solange, before it was like the first line
                 //nl = doc.getElementsByTagName("ProactiveSMDPanelCopy");
@@ -5879,9 +5822,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                ProactiveSMDPanel psmdp = (ProactiveSMDPanel)tdp;
+                ProactiveSMDPanel psmdp = (ProactiveSMDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5926,10 +5869,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                AvatarBDPanel abdp = (AvatarBDPanel)tdp;
+                AvatarBDPanel abdp = (AvatarBDPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -5979,10 +5922,10 @@ public class GTURTLEModeling {
                 //TraceManager.addDev("Toto 1");
 
 
-                ADDDiagramPanel addp = (ADDDiagramPanel)tdp;
+                ADDDiagramPanel addp = (ADDDiagramPanel) tdp;
 
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6027,9 +5970,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarSMDPanel asmdp = (AvatarSMDPanel)tdp;
+                AvatarSMDPanel asmdp = (AvatarSMDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6068,9 +6011,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarRDPanel ardp = (AvatarRDPanel)tdp;
+                AvatarRDPanel ardp = (AvatarRDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6103,9 +6046,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarMADPanel amadp = (AvatarMADPanel)tdp;
+                AvatarMADPanel amadp = (AvatarMADPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6138,9 +6081,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarPDPanel apdp = (AvatarPDPanel)tdp;
+                AvatarPDPanel apdp = (AvatarPDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6173,9 +6116,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarCDPanel acdp = (AvatarCDPanel)tdp;
+                AvatarCDPanel acdp = (AvatarCDPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6201,16 +6144,16 @@ public class GTURTLEModeling {
                     }
                 }
 
-		} else if (tdp instanceof CAMSBlockDiagramPanel) {  //ajout CD 24.07----mark
+            } else if (tdp instanceof CAMSBlockDiagramPanel) {  //ajout CD 24.07----mark
                 nl = doc.getElementsByTagName("CAMSBlockDiagramPanelCopy");
 
                 if (nl == null) {
                     return;
                 }
 
-                CAMSBlockDiagramPanel camsp = (CAMSBlockDiagramPanel)tdp;
+                CAMSBlockDiagramPanel camsp = (CAMSBlockDiagramPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6229,7 +6172,7 @@ public class GTURTLEModeling {
                         camsp.structureChanged();
                         makePostLoading(camsp, beginIndex);
                     }
-		}
+                }
 
             } else if (tdp instanceof AvatarADPanel) {
                 nl = doc.getElementsByTagName("AvatarADPanelCopy");
@@ -6238,9 +6181,9 @@ public class GTURTLEModeling {
                     return;
                 }
 
-                AvatarADPanel aadp = (AvatarADPanel)tdp;
+                AvatarADPanel aadp = (AvatarADPanel) tdp;
 
-                for(i=0; i<nl.getLength(); i++) {
+                for (i = 0; i < nl.getLength(); i++) {
                     adn = nl.item(i);
                     if (adn.getNodeType() == Node.ELEMENT_NODE) {
                         elt = (Element) adn;
@@ -6282,7 +6225,7 @@ public class GTURTLEModeling {
         index2 = s.indexOf("<InteractionOverviewDiagramPanel ");
         index3 = s.indexOf("</TURTLEGMODELING>");
 
-        if ((index1 <0) ||(index3 < 0)){
+        if ((index1 < 0) || (index3 < 0)) {
             return null;
         }
 
@@ -6360,7 +6303,7 @@ public class GTURTLEModeling {
 
             //TraceManager.addDev("nb de design=" + designPanelNl.getLength() + " nb d'analyse=" + analysisNl.getLength());
             boolean error = false;
-            for(i=0; i<panelNl.getLength(); i++) {
+            for (i = 0; i < panelNl.getLength(); i++) {
                 node = panelNl.item(i);
                 //TraceManager.addDev("Node = " + dnd);
 
@@ -6371,7 +6314,7 @@ public class GTURTLEModeling {
                     } catch (MalformedModelingException mme) {
                         Element elt = (Element) node;
                         String type = elt.getAttribute("type");
-                        TraceManager.addError("Error when loading diagram: " + elt + " " +type, mme);
+                        TraceManager.addError("Error when loading diagram: " + elt + " " + type, mme);
                         error = true;
                     }
                 }
@@ -6396,7 +6339,7 @@ public class GTURTLEModeling {
         //TraceManager.addDev("IDs done");
     }
 
-    public void loadModeling(Node node) throws  MalformedModelingException, SAXException {
+    public void loadModeling(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String type = elt.getAttribute("type");
         // AVATAR
@@ -6425,7 +6368,7 @@ public class GTURTLEModeling {
             loadRequirement(node);
         } else if (type.compareTo("AttackTree") == 0) {
             loadAttackTree(node);
-	} else if (type.compareTo("FaultTree") == 0) {
+        } else if (type.compareTo("FaultTree") == 0) {
             loadFaultTree(node);
         } else if (type.compareTo("Diplodocus Methodology") == 0) {
             loadDiplodocusMethodology(node);
@@ -6433,8 +6376,8 @@ public class GTURTLEModeling {
             loadAvatarMethodology(node);
         } else if (type.compareTo("Sysmlsec Methodology") == 0) {
             loadSysmlsecMethodology(node);
-	} else if (type.compareTo("SystemC-AMS") == 0) {
-	    loadSystemCAMS(node);
+        } else if (type.compareTo("SystemC-AMS") == 0) {
+            loadSystemCAMS(node);
         } else if (type.compareTo("TML Design") == 0) {
             loadTMLDesign(node);
         } else if (type.compareTo("TML Component Design") == 0) {
@@ -6452,7 +6395,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadAvatarDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6470,7 +6413,7 @@ public class GTURTLEModeling {
          * informations provided by blocks. For instance we can check
          * that an attribute used in a state machine really exists.
          */
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
                 elt = (Element) node;
@@ -6479,7 +6422,7 @@ public class GTURTLEModeling {
                     loadAvatarBD(elt, indexDesign);
             }
         }
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
                 elt = (Element) node;
@@ -6490,7 +6433,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadAvatarDeployment(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarDeployment(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6505,21 +6448,21 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("ADDDiagramPanel") == 0) {
                     TraceManager.addDev("Loading ADD 1");
                     loadADDDiagram(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 }
             }
         }
     }
 
-    public void loadAvatarRequirement(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarRequirement(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6533,23 +6476,23 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("AvatarRDPanel") == 0) {
                     loadAvatarRD(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 } else if (elt.getTagName().compareTo("AvatarPDPanel") == 0) {
                     loadAvatarPD(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 }
             }
         }
     }
 
-    public void loadAttackTree(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAttackTree(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6563,20 +6506,20 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("AttackTreeDiagramPanel") == 0) {
                     loadAttackTreeDiagram(elt, indexTree, cpttdp);
-                    cpttdp ++;
+                    cpttdp++;
                 }
             }
         }
     }
 
-    public void loadFaultTree(Node node) throws  MalformedModelingException, SAXException {
+    public void loadFaultTree(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6590,20 +6533,20 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("FaultTreeDiagramPanel") == 0) {
                     loadFaultTreeDiagram(elt, indexTree, cpttdp);
-                    cpttdp ++;
+                    cpttdp++;
                 }
             }
         }
     }
 
-    public void loadAvatarMADs(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarMADs(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6619,20 +6562,20 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             TraceManager.addDev("MADs nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("AvatarMADPanel") == 0) {
                     loadAvatarMAD(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 }
             }
         }
     }
 
-    public void loadDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6645,11 +6588,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TClassDiagramPanel") == 0) {
                     // Class diagram
                     loadTClassDiagram(elt, indexDesign);
@@ -6663,7 +6606,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadAnalysis(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAnalysis(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6676,26 +6619,26 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("InteractionOverviewDiagramPanel") == 0) {
                     // IOD
                     loadIODiagram(elt, indexAnalysis);
-                    cpt ++;
+                    cpt++;
                 } else { // Managing sequence diagrams
                     if (elt.getTagName().compareTo("SequenceDiagramPanel") == 0) {
                         loadSequenceDiagram(elt, indexAnalysis);
-                        cpt ++;
+                        cpt++;
                     } else if (elt.getTagName().compareTo("SequenceDiagramPanelZV") == 0) {
                         loadSequenceDiagramZV(elt, indexAnalysis);
-                        cpt ++;
+                        cpt++;
                     } else if (elt.getTagName().compareTo("UseCaseDiagramPanel") == 0) {
                         // Managing use case diagrams
                         loadUseCaseDiagram(elt, indexAnalysis, cpt);
-                        cpt ++;
+                        cpt++;
                     } /*else if (elt.getTagName().compareTo("AvatarCDPanel") == 0) {
                       // Managing use case diagrams
                       loadAvatarCD(elt, indexAnalysis, cpt);
@@ -6710,7 +6653,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadTMLCP(Node node) throws  MalformedModelingException, SAXException {
+    public void loadTMLCP(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6723,11 +6666,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("CommunicationPatternDiagramPanel") == 0) {
                     // CP
                     loadTMLCPDiagram(elt, indexTMLCP);
@@ -6742,7 +6685,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadAvatarAnalysis(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarAnalysis(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6757,48 +6700,48 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
 
                 if (elt.getTagName().compareTo("SequenceDiagramPanel") == 0) {
                     //TraceManager.addDev("Loading seq diag");
                     loadSequenceDiagram(elt, indexAnalysis);
                     //TraceManager.addDev("Loading seq diag done");
-                    cpt ++;
+                    cpt++;
                 } else if (elt.getTagName().compareTo("SequenceDiagramPanelZV") == 0) {
                     //TraceManager.addDev("Loading seq diag");
                     loadSequenceDiagramZV(elt, indexAnalysis);
                     //TraceManager.addDev("Loading seq diag done");
-                    cpt ++;
+                    cpt++;
                 } else if (elt.getTagName().compareTo("UseCaseDiagramPanel") == 0) {
                     // Managing use case diagrams
                     //TraceManager.addDev("Loading ucd diag");
                     loadUseCaseDiagram(elt, indexAnalysis, cpt);
                     //TraceManager.addDev("Loading ucd diag done");
 
-                    cpt ++;
+                    cpt++;
                 } else if (elt.getTagName().compareTo("AvatarCDPanel") == 0) {
                     // Managing use case diagrams
                     //TraceManager.addDev("Loading cd diag");
                     loadAvatarCD(elt, indexAnalysis, cpt);
                     //TraceManager.addDev("Loading cd diag done");
-                    cpt ++;
+                    cpt++;
                 } else if (elt.getTagName().compareTo("AvatarADPanel") == 0) {
                     // Managing use case diagrams
                     //TraceManager.addDev("Loading ad diag");
                     loadAvatarAD(elt, indexAnalysis, cpt);
                     //TraceManager.addDev("Loading ad diag done");
-                    cpt ++;
+                    cpt++;
                 }
 
             }
         }
     }
 
-    public void loadDeployment(Node node) throws  MalformedModelingException, SAXException {
+    public void loadDeployment(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6811,11 +6754,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TDeploymentDiagramPanel") == 0) {
                     // IOD
                     loadTDeploymentDiagram(elt, indexAnalysis);
@@ -6824,7 +6767,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadNC(Node node) throws  MalformedModelingException, SAXException {
+    public void loadNC(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6837,11 +6780,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("NCDiagramPanel") == 0) {
                     // IOD
                     loadNCDiagram(elt, indexAnalysis);
@@ -6850,7 +6793,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadRequirement(Node node) throws  MalformedModelingException, SAXException {
+    public void loadRequirement(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6864,25 +6807,24 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Deployment nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TRequirementDiagramPanel") == 0) {
                     loadRequirementDiagram(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 } else if (elt.getTagName().compareTo("EBRDDPanel") == 0) {
                     loadEBRDD(elt, indexReq, cpt_req);
-                    cpt_req ++;
+                    cpt_req++;
                 }
             }
         }
     }
 
 
-
-    public void loadDiplodocusMethodology(Node node) throws  MalformedModelingException, SAXException {
+    public void loadDiplodocusMethodology(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6895,11 +6837,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("DiplodocusMethodologyDiagramPanel") == 0) {
                     // Class diagram
                     //TraceManager.addDev("Loading TML CD");
@@ -6910,7 +6852,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadAvatarMethodology(Node node) throws  MalformedModelingException, SAXException {
+    public void loadAvatarMethodology(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6923,11 +6865,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("AvatarMethodologyDiagramPanel") == 0) {
                     // Class diagram
                     TraceManager.addDev("Loading Avatar methodo");
@@ -6938,7 +6880,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadSysmlsecMethodology(Node node) throws  MalformedModelingException, SAXException {
+    public void loadSysmlsecMethodology(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6951,11 +6893,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("SysmlsecMethodologyDiagramPanel") == 0) {
                     // Class diagram
                     TraceManager.addDev("Loading SysMLSec methodo");
@@ -6966,7 +6908,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadSystemCAMS(Node node) throws  MalformedModelingException, SAXException {
+    public void loadSystemCAMS(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -6979,11 +6921,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("SystemCAMSDiagramPanel") == 0) {
                     // Class diagram
                     TraceManager.addDev("Loading SystemC-AMS");
@@ -6994,7 +6936,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadTMLDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadTMLDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -7007,11 +6949,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TMLTaskDiagramPanel") == 0) {
                     // Class diagram
                     //TraceManager.addDev("Loading TML CD");
@@ -7028,7 +6970,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadTMLComponentDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadTMLComponentDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -7041,11 +6983,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TMLComponentTaskDiagramPanel") == 0) {
                     // Component diagram
                     //TraceManager.addDev("Loading TML Component diagram");
@@ -7062,7 +7004,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadTMLArchitecture(Node node) throws  MalformedModelingException, SAXException {
+    public void loadTMLArchitecture(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -7075,11 +7017,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("TML Architecture nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TMLArchiDiagramPanel") == 0) {
                     //TraceManager.addDev("Loading TML DD" + elt.getTagName() );
                     loadTMLArchitectureDiagram(elt, indexDesign);
@@ -7089,7 +7031,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadTURTLEOSDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadTURTLEOSDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -7101,11 +7043,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("TURTLEOSClassDiagramPanel") == 0) {
                     // Class diagram
                     //TraceManager.addDev("Loading TURTLEOS CD");
@@ -7122,7 +7064,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadProActiveDesign(Node node) throws  MalformedModelingException, SAXException {
+    public void loadProActiveDesign(Node node) throws MalformedModelingException, SAXException {
         Element elt = (Element) node;
         String nameTab;
         NodeList diagramNl;
@@ -7136,11 +7078,11 @@ public class GTURTLEModeling {
 
         diagramNl = node.getChildNodes();
 
-        for(int j=0; j<diagramNl.getLength(); j++) {
+        for (int j = 0; j < diagramNl.getLength(); j++) {
             //TraceManager.addDev("Design nodes: " + j);
             node = diagramNl.item(j);
             if (node.getNodeType() == Node.ELEMENT_NODE) {
-                elt = (Element)node;
+                elt = (Element) node;
                 if (elt.getTagName().compareTo("ProactiveCSDPanel") == 0) {
                     // Class diagram
                     //TraceManager.addDev("Loading TML CD");
@@ -7157,7 +7099,7 @@ public class GTURTLEModeling {
         }
     }
 
-    public void loadDiagram(Element elt, TDiagramPanel tdp) throws  MalformedModelingException, SAXException {
+    public void loadDiagram(Element elt, TDiagramPanel tdp) throws MalformedModelingException, SAXException {
         int x, y;
         double zoom = 0;
         try {
@@ -7181,28 +7123,28 @@ public class GTURTLEModeling {
 
         // for TClassdiagram Panel
         if (tdp instanceof TClassDiagramPanel) {
-            ((TClassDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TClassDiagramPanel) tdp).loadExtraParameters(elt);
         }
 
         if (tdp instanceof TActivityDiagramPanel) {
-            ((TActivityDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TActivityDiagramPanel) tdp).loadExtraParameters(elt);
         }
 
         if (tdp instanceof TMLTaskDiagramPanel) {
-            ((TMLTaskDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TMLTaskDiagramPanel) tdp).loadExtraParameters(elt);
         }
 
         if (tdp instanceof TMLComponentTaskDiagramPanel) {
-            ((TMLComponentTaskDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TMLComponentTaskDiagramPanel) tdp).loadExtraParameters(elt);
         }
 
         if (tdp instanceof TMLArchiDiagramPanel) {
-            ((TMLArchiDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TMLArchiDiagramPanel) tdp).loadExtraParameters(elt);
         }
 
 
         if (tdp instanceof AvatarBDPanel) {
-            ((AvatarBDPanel)tdp).loadExtraParameters(elt);
+            ((AvatarBDPanel) tdp).loadExtraParameters(elt);
         }
 
         //TraceManager.addDev("Element" + elt.toString());
@@ -7225,57 +7167,57 @@ public class GTURTLEModeling {
         //TraceManager.addDev("Test connectors");
         if (tdp instanceof TMLComponentTaskDiagramPanel) {
             //TraceManager.addDev("Connectors...");
-            ((TMLComponentTaskDiagramPanel)tdp).setConnectorsToFront();
+            ((TMLComponentTaskDiagramPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof EBRDDPanel) {
             //TraceManager.addDev("Connectors...");
-            ((EBRDDPanel)tdp).setConnectorsToFront();
+            ((EBRDDPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AttackTreeDiagramPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AttackTreeDiagramPanel)tdp).setConnectorsToFront();
+            ((AttackTreeDiagramPanel) tdp).setConnectorsToFront();
         }
 
-	if (tdp instanceof FaultTreeDiagramPanel) {
+        if (tdp instanceof FaultTreeDiagramPanel) {
             //TraceManager.addDev("Connectors...");
-            ((FaultTreeDiagramPanel)tdp).setConnectorsToFront();
+            ((FaultTreeDiagramPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AvatarBDPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AvatarBDPanel)tdp).setConnectorsToFront();
+            ((AvatarBDPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AvatarSMDPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AvatarSMDPanel)tdp).setConnectorsToFront();
+            ((AvatarSMDPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AvatarPDPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AvatarPDPanel)tdp).setConnectorsToFront();
+            ((AvatarPDPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AvatarCDPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AvatarCDPanel)tdp).setConnectorsToFront();
+            ((AvatarCDPanel) tdp).setConnectorsToFront();
         }
 
         if (tdp instanceof AvatarADPanel) {
             //TraceManager.addDev("Connectors...");
-            ((AvatarADPanel)tdp).setConnectorsToFront();
+            ((AvatarADPanel) tdp).setConnectorsToFront();
         }
 
-	if (tdp instanceof CAMSBlockDiagramPanel) {
+        if (tdp instanceof CAMSBlockDiagramPanel) {
             //TraceManager.addDev("Connectors...");
-            ((CAMSBlockDiagramPanel)tdp).setConnectorsToFront();
-	}
+            ((CAMSBlockDiagramPanel) tdp).setConnectorsToFront();
+        }
     }
 
     // AVATAR
-    public void loadAvatarBD(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadAvatarBD(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7288,7 +7230,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAvatarSMD(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadAvatarSMD(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7301,12 +7243,12 @@ public class GTURTLEModeling {
 
         asmdp.removeAll();
 
-        mgui.selectDummyTab (indexDesign);
+        mgui.selectDummyTab(indexDesign);
         loadDiagram(elt, asmdp);
-        mgui.forgetDummyTab ();
+        mgui.forgetDummyTab();
     }
 
-    public void loadAvatarRD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAvatarRD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7323,7 +7265,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAvatarMAD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAvatarMAD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
         name = elt.getAttribute("name");
         mgui.createAvatarMAD(indexAnalysis, name);
@@ -7336,7 +7278,7 @@ public class GTURTLEModeling {
     }
 
 
-    public void loadADDDiagram(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadADDDiagram(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7364,7 +7306,7 @@ public class GTURTLEModeling {
         TraceManager.addDev("ADD 5");
     }
 
-    public void loadAvatarPD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAvatarPD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7380,7 +7322,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAvatarCD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAvatarCD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7396,7 +7338,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAvatarAD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAvatarAD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7413,7 +7355,7 @@ public class GTURTLEModeling {
     }
 
     // TURTLE Design
-    public void loadTClassDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTClassDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7426,7 +7368,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTActivityDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTActivityDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7441,7 +7383,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tadp);
     }
 
-    public void loadDiplodocusMethodologyDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadDiplodocusMethodologyDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7457,7 +7399,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAvatarMethodologyDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadAvatarMethodologyDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7473,7 +7415,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadSysmlsecMethodologyDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadSysmlsecMethodologyDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7489,8 +7431,8 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadSystemCAMSDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
-	//ajout CD
+    public void loadSystemCAMSDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
+        //ajout CD
         String name;
         TDiagramPanel tdp;
 
@@ -7505,7 +7447,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTMLTaskDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTMLTaskDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7520,7 +7462,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTMLComponentTaskDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTMLComponentTaskDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7534,11 +7476,11 @@ public class GTURTLEModeling {
 
         loadDiagram(elt, tdp);
 
-        ((TMLComponentTaskDiagramPanel)tdp).hideConnectors();
-        ((TMLComponentTaskDiagramPanel)tdp).updatePorts();
+        ((TMLComponentTaskDiagramPanel) tdp).hideConnectors();
+        ((TMLComponentTaskDiagramPanel) tdp).updatePorts();
     }
 
-    public void loadTMLArchitectureDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTMLArchitectureDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7553,7 +7495,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTMLActivityDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTMLActivityDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7573,7 +7515,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tmladp);
     }
 
-    public void loadTURTLEOSClassDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTURTLEOSClassDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7585,7 +7527,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTURTLEOSActivityDiagram(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadTURTLEOSActivityDiagram(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7600,7 +7542,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tosadp);
     }
 
-    public void loadProactiveCSD(Element elt, int indexDesign) throws  MalformedModelingException, SAXException {
+    public void loadProactiveCSD(Element elt, int indexDesign) throws MalformedModelingException, SAXException {
 
         String name;
         TDiagramPanel tdp;
@@ -7610,13 +7552,12 @@ public class GTURTLEModeling {
         //  mgui.setProacticeCSDName(indexDesign, name);
         tdp = mgui.getMainTDiagramPanel(indexDesign);
         //ProactiveDesignPanel pdp=(ProactiveDesignPanel) mgui.getCurrentTURTLEPanel();
-        ProactiveDesignPanel pdp=(ProactiveDesignPanel) tdp.tp;
-        if (!tdp.getName().equals(name))
-            {
+        ProactiveDesignPanel pdp = (ProactiveDesignPanel) tdp.tp;
+        if (!tdp.getName().equals(name)) {
 
-                //tdp=pdp.addCompositeStructureDiagram(name);
-                tdp=pdp.addProActiveCompSpecificationPanel(name);
-            }
+            //tdp=pdp.addCompositeStructureDiagram(name);
+            tdp = pdp.addProActiveCompSpecificationPanel(name);
+        }
 
         //TraceManager.addDev("tdp=" + tdp.getName());
 
@@ -7624,7 +7565,7 @@ public class GTURTLEModeling {
 
     }
 
-    public void loadProactiveSMD(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadProactiveSMD(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7642,7 +7583,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, smd);
     }
 
-    public void loadIODiagram(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadIODiagram(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7661,7 +7602,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTMLCPDiagram(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadTMLCPDiagram(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7679,7 +7620,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadTMLSDDiagram(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadTMLSDDiagram(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7697,7 +7638,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadRequirementDiagram(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadRequirementDiagram(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7714,7 +7655,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadEBRDD(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadEBRDD(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7731,7 +7672,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadAttackTreeDiagram(Element elt, int indexDiag, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadAttackTreeDiagram(Element elt, int indexDiag, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         //TraceManager.addDev("indexDiag=" + indexDiag);
@@ -7749,7 +7690,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadFaultTreeDiagram(Element elt, int indexDiag, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadFaultTreeDiagram(Element elt, int indexDiag, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         //TraceManager.addDev("indexDiag=" + indexDiag);
@@ -7767,7 +7708,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadSequenceDiagram(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadSequenceDiagram(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7778,27 +7719,25 @@ public class GTURTLEModeling {
         ui.sd.SequenceDiagramPanel sdp = mgui.getSequenceDiagramPanel(indexAnalysis, name);
         //TraceManager.addDev("Loading seq diag2");
         ui.sd2.SequenceDiagramPanel sdp2 = mgui.getSequenceDiagramPanelZV(indexAnalysis, name);
-        
+
         if (sdp != null) {
-        	sdp.removeAll();
+            sdp.removeAll();
             //TraceManager.addDev("Loading seq diag4");
 
             loadDiagram(elt, sdp);
             //TraceManager.addDev("Loading seq diag5");
-        }
-        else if (sdp2 != null) {
-        	sdp2.removeAll();
+        } else if (sdp2 != null) {
+            sdp2.removeAll();
 
             loadDiagram(elt, sdp2);
-        }
-        else
-        	throw new MalformedModelingException();
+        } else
+            throw new MalformedModelingException();
         //TraceManager.addDev("Loading seq diag3");
 
-        
+
     }
 
-    public void loadSequenceDiagramZV(Element elt, int indexAnalysis) throws  MalformedModelingException, SAXException {
+    public void loadSequenceDiagramZV(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7821,7 +7760,7 @@ public class GTURTLEModeling {
         //TraceManager.addDev("Loading seq diag5");
     }
 
-    public void loadUseCaseDiagram(Element elt, int indexAnalysis, int indexTab) throws  MalformedModelingException, SAXException {
+    public void loadUseCaseDiagram(Element elt, int indexAnalysis, int indexTab) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7839,7 +7778,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, ucdp);
     }
 
-    public void loadTDeploymentDiagram(Element elt, int indexDeployment) throws  MalformedModelingException, SAXException {
+    public void loadTDeploymentDiagram(Element elt, int indexDeployment) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7849,7 +7788,7 @@ public class GTURTLEModeling {
         loadDiagram(elt, tdp);
     }
 
-    public void loadNCDiagram(Element elt, int indexNC) throws  MalformedModelingException, SAXException {
+    public void loadNCDiagram(Element elt, int indexNC) throws MalformedModelingException, SAXException {
         String name;
 
         name = elt.getAttribute("name");
@@ -7866,9 +7805,9 @@ public class GTURTLEModeling {
         int i, j;
         TURTLEPanel tp;
         // search for diagram panels
-        for(i=0; i<panels.size(); i++) {
+        for (i = 0; i < panels.size(); i++) {
             tp = panels.elementAt(i);
-            for(j=0; j<tp.panels.size(); j++) {
+            for (j = 0; j < tp.panels.size(); j++) {
                 tdp = tp.panels.elementAt(j);
                 id = tdp.makeLovelyIds(id);
                 //TraceManager.addDev("Lovely id =" + id);
@@ -7878,7 +7817,7 @@ public class GTURTLEModeling {
         TGComponent.setGeneralId(id + 1);
     }
 
-    public void loadDiagramInformation(Element elt, TDiagramPanel tdp) throws  MalformedModelingException {
+    public void loadDiagramInformation(Element elt, TDiagramPanel tdp) throws MalformedModelingException {
         int x, y;
         double zoom = 0;
         try {
@@ -7901,7 +7840,7 @@ public class GTURTLEModeling {
         }
 
         if (tdp instanceof TActivityDiagramPanel) {
-            ((TActivityDiagramPanel)tdp).loadExtraParameters(elt);
+            ((TActivityDiagramPanel) tdp).loadExtraParameters(elt);
         }
     }
 
@@ -7911,7 +7850,7 @@ public class GTURTLEModeling {
             NodeList activityDiagramNl = docCopy.getElementsByTagName("TActivityDiagramPanel");
 
             TraceManager.addDev("Loading activity diagram of " + newValue + "Before : " + oldValue);
-            TraceManager.addDev(""+docCopy);
+            TraceManager.addDev("" + docCopy);
 
             if (activityDiagramNl == null) {
                 throw new MalformedModelingException();
@@ -7925,7 +7864,7 @@ public class GTURTLEModeling {
             int decYTmp = decY;
             int decIdTmp = decId;
 
-            for(int i=0; i<activityDiagramNl.getLength(); i++) {
+            for (int i = 0; i < activityDiagramNl.getLength(); i++) {
                 adn = activityDiagramNl.item(i);
                 if (adn.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) adn;
@@ -7950,8 +7889,9 @@ public class GTURTLEModeling {
 
                         //TraceManager.addDev("Panel ok");
 
-                        decX = 0; decY = 0; decId = 0;
-
+                        decX = 0;
+                        decY = 0;
+                        decId = 0;
 
 
                         tadp.removeAll();
@@ -8002,7 +7942,7 @@ public class GTURTLEModeling {
             int decYTmp = decY;
             int decIdTmp = decId;
 
-            for(int i=0; i<smdNl.getLength(); i++) {
+            for (int i = 0; i < smdNl.getLength(); i++) {
                 adn = smdNl.item(i);
                 if (adn.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) adn;
@@ -8027,7 +7967,9 @@ public class GTURTLEModeling {
 
                         TraceManager.addDev("Panel ok");
 
-                        decX = 0; decY = 0; decId = 0;
+                        decX = 0;
+                        decY = 0;
+                        decId = 0;
 
 
                         asmdp.removeAll();
@@ -8080,7 +8022,7 @@ public class GTURTLEModeling {
             int decYTmp = decY;
             int decIdTmp = decId;
 
-            for(int i=0; i<activityDiagramNl.getLength(); i++) {
+            for (int i = 0; i < activityDiagramNl.getLength(); i++) {
                 adn = activityDiagramNl.item(i);
                 if (adn.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) adn;
@@ -8105,7 +8047,9 @@ public class GTURTLEModeling {
 
                         //TraceManager.addDev("Panel ok");
 
-                        decX = 0; decY = 0; decId = 0;
+                        decX = 0;
+                        decY = 0;
+                        decId = 0;
 
                         tmladp.removeAll();
 
@@ -8134,14 +8078,14 @@ public class GTURTLEModeling {
         }
     }
 
-    public void makePostLoading(TDiagramPanel tdp, int beginIndex) throws MalformedModelingException{
+    public void makePostLoading(TDiagramPanel tdp, int beginIndex) throws MalformedModelingException {
         TGComponent tgc;
 
         //TraceManager.addDev("Post loading of diagram " + tdp.toString());
 
         List<TGComponent> list = tdp.getComponentList();
 
-        for(int i=0; i<list.size()-beginIndex; i++) {
+        for (int i = 0; i < list.size() - beginIndex; i++) {
             tgc = list.get(i);
             //TraceManager.addDev(tgc.getName());
             //TraceManager.addDev(tgc.getValue());
@@ -8171,7 +8115,7 @@ public class GTURTLEModeling {
 
         try {
 
-            for(int i=0; i<nl.getLength(); i++) {
+            for (int i = 0; i < nl.getLength(); i++) {
                 n = nl.item(i);
                 if (n.getNodeType() == Node.ELEMENT_NODE) {
                     try {
@@ -8189,7 +8133,7 @@ public class GTURTLEModeling {
                         if (type > 0) {
                             t = "" + type;
                         }
-                        TraceManager.addDev ("A badly formed component could not be created in the diagram");
+                        TraceManager.addDev("A badly formed component could not be created in the diagram");
 
                         UICheckingError ce = new UICheckingError(CheckingError.BEHAVIOR_ERROR, "A component could not be correctly loaded - type=" + t);
                         ce.setTDiagramPanel(tdp);
@@ -8217,9 +8161,9 @@ public class GTURTLEModeling {
     public int getTypeOfComponentNode(Node n) {
         try {
             //NodeList nl = n.getChildNodes();
-            Element elt = (Element)n;
+            Element elt = (Element) n;
             return Integer.decode(elt.getAttribute("type")).intValue();
-        } catch (Exception e){
+        } catch (Exception e) {
         }
         return -1;
     }
@@ -8230,20 +8174,20 @@ public class GTURTLEModeling {
         Element elt1;
         TGComponent tgc = null;
         TGComponent father;
-      //  TGComponent reference;
+        //  TGComponent reference;
 
         //
         try {
 
             NodeList nl = n.getChildNodes();
-            elt = (Element)n;
+            elt = (Element) n;
             elt1 = elt;
             //TraceManager.addDev("elt=" + elt);
 
             int myType = Integer.decode(elt.getAttribute("type")).intValue();
             int myId = Integer.decode(elt.getAttribute("id")).intValue() + decId;
 
-            int myX = -1, myY = -1, myWidth = -1, myHeight =-1;
+            int myX = -1, myY = -1, myWidth = -1, myHeight = -1;
             int myMinWidth = -1, myMinHeight = -1, myMinDesiredWidth = -1, myMinDesiredHeight = -1;
             int myMinX = -1, myMaxX = -1, myMinY = -1, myMaxY = -1;
             String myName = null, myValue = null;
@@ -8251,7 +8195,7 @@ public class GTURTLEModeling {
             Point p;
             int i, x, y;
             int fatherId = -1, fatherNum = -1;
-            int referenceId=-1;
+            int referenceId = -1;
             String pre = "", post = "";
             String internalComment = "";
             boolean accessibility = false;
@@ -8262,7 +8206,7 @@ public class GTURTLEModeling {
             boolean masterMutex = false;
             boolean enable = true;
 
-            for(i=0; i<nl.getLength(); i++) {
+            for (i = 0; i < nl.getLength(); i++) {
                 n = nl.item(i);
                 if (n.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) n;
@@ -8323,9 +8267,9 @@ public class GTURTLEModeling {
 
             //TraceManager.addDev("Making TGComponent of type " + myType + " and of name " + myName);
             //TGComponent is ready to be built
-            
 
-            if(fatherId != -1) {
+
+            if (fatherId != -1) {
                 fatherId += decId;
                 // internal component
                 //TraceManager.addDev("I am " + myName);
@@ -8350,7 +8294,7 @@ public class GTURTLEModeling {
                         //TraceManager.addDev("2 Must add the component to its father:" + tgc);
                         if (tgc instanceof SwallowedTGComponent) {
                             //TraceManager.addDev("3 Must add the component to its father:");
-                            ((SwallowTGComponent)father).addSwallowedTGComponent(tgc, myX, myY);
+                            ((SwallowTGComponent) father).addSwallowedTGComponent(tgc, myX, myY);
                             //TraceManager.addDev("Swallowed to father = " + father.getValue() + ". My name=" + myName + " decId=" + decId);
                         } else {
                             throw new MalformedModelingException();
@@ -8379,16 +8323,16 @@ public class GTURTLEModeling {
             }
 
 
-            if (referenceId !=-1){
-            	referenceId += decId;
-            	for (TURTLEPanel turtlepanel: panels){
-            		for (TDiagramPanel tdpanel: turtlepanel.panels){
-            			if (tdpanel.findComponentWithId(referenceId) !=null){
-           					tgc.reference=tdpanel.findComponentWithId(referenceId);
-            				break;
-            			}
-            		}
-            	}
+            if (referenceId != -1) {
+                referenceId += decId;
+                for (TURTLEPanel turtlepanel : panels) {
+                    for (TDiagramPanel tdpanel : turtlepanel.panels) {
+                        if (tdpanel.findComponentWithId(referenceId) != null) {
+                            tgc.reference = tdpanel.findComponentWithId(referenceId);
+                            break;
+                        }
+                    }
+                }
             }
 
             tgc.setEnabled(enable);
@@ -8400,62 +8344,61 @@ public class GTURTLEModeling {
             String oldClassName = myValue;
             //TraceManager.addDev("Old class name=" + oldClassName);
             //Added by Solange
-            if ((myValue != null) && (!myValue.equals(null))){
-                if (tgc instanceof ProCSDComponent)
-                    {
-                        //Added by Solange
-                        //And removed by emil
-                        //myValue=generateNameIfInUse(myValue);
-                        //  tgc.setValueWithChange(myValue);
-                        //TraceManager.addDev("myValue=" + myValue);
-                    }
+            if ((myValue != null) && (!myValue.equals(null))) {
+                if (tgc instanceof ProCSDComponent) {
+                    //Added by Solange
+                    //And removed by emil
+                    //myValue=generateNameIfInUse(myValue);
+                    //  tgc.setValueWithChange(myValue);
+                    //TraceManager.addDev("myValue=" + myValue);
+                }
                 //until here
-                if ((tgc instanceof TCDTClass) && (decId >0)){
+                if ((tgc instanceof TCDTClass) && (decId > 0)) {
                     if (tdp.isAlreadyATClassName(myValue)) {
-                        myValue = tdp.findTClassName(myValue+"_");
+                        myValue = tdp.findTClassName(myValue + "_");
                     }
                 }
-                if ((tgc instanceof TMLTaskOperator) && (decId >0)){
+                if ((tgc instanceof TMLTaskOperator) && (decId > 0)) {
                     if (tdp.isAlreadyATMLTaskName(myValue)) {
-                        myValue = tdp.findTMLTaskName(myValue+"_");
+                        myValue = tdp.findTMLTaskName(myValue + "_");
                     }
                 }
 
-                if ((tgc instanceof AvatarBDBlock) && (decId >0)){
+                if ((tgc instanceof AvatarBDBlock) && (decId > 0)) {
                     if (tdp.isAlreadyAnAvatarBDBlockName(myValue)) {
-                        myValue = tdp.findAvatarBDBlockName(myValue+"_");
+                        myValue = tdp.findAvatarBDBlockName(myValue + "_");
                     }
                 }
 
-                if ((tgc instanceof TMLCPrimitiveComponent) && (decId >0)){
+                if ((tgc instanceof TMLCPrimitiveComponent) && (decId > 0)) {
                     if (tdp.isAlreadyATMLPrimitiveComponentName(myValue)) {
-                        myValue = tdp.findTMLPrimitiveComponentName(myValue+"_");
+                        myValue = tdp.findTMLPrimitiveComponentName(myValue + "_");
                     }
                     //TraceManager.addDev("MyValue=" + myValue);
                 }
-                if ((tgc instanceof TOSClass) && (decId >0)){
+                if ((tgc instanceof TOSClass) && (decId > 0)) {
                     if (tdp.isAlreadyATOSClassName(myValue)) {
-                        myValue = tdp.findTOSClassName(myValue+"_");
+                        myValue = tdp.findTOSClassName(myValue + "_");
                     }
                 }
                 //TraceManager.addDev("myValue=" + myValue);
                 tgc.setValueWithChange(myValue);
                 //TraceManager.addDev("value done");
-                if ((tgc instanceof TCDTClass) && (decId >0)){
+                if ((tgc instanceof TCDTClass) && (decId > 0)) {
                     loadActivityDiagram(tdp, oldClassName, myValue);
                 }
 
-                if ((tgc instanceof AvatarBDBlock) && (decId >0)){
+                if ((tgc instanceof AvatarBDBlock) && (decId > 0)) {
                     //TraceManager.addDev("Going to load ad of task " + oldClassName + " myValue=" + myValue);
                     loadAvatarSMD(tdp, oldClassName, myValue);
                 }
 
-                if ((tgc instanceof TMLTaskOperator) && (decId >0)){
+                if ((tgc instanceof TMLTaskOperator) && (decId > 0)) {
                     //TraceManager.addDev("Going to load ad of task " + oldClassName + " myValue=" + myValue);
                     loadTMLActivityDiagram(tdp, oldClassName, myValue);
                 }
 
-                if ((tgc instanceof TMLCPrimitiveComponent) && (decId >0)){
+                if ((tgc instanceof TMLCPrimitiveComponent) && (decId > 0)) {
                     //TraceManager.addDev("Going to load ad of component " + oldClassName + " myValue=" + myValue);
                     loadTMLActivityDiagram(tdp, oldClassName, myValue);
                 }
@@ -8510,7 +8453,7 @@ public class GTURTLEModeling {
             // TraceManager.addDev("Extra param ok");
 
             if ((tgc instanceof TCDTObject) && (decId > 0)) {
-                TCDTObject to = (TCDTObject)tgc;
+                TCDTObject to = (TCDTObject) tgc;
                 //TraceManager.addDev("Setting TObject name to: " + to.getObjectName());
                 //TraceManager.addDev("Setting TObject name to: " + tdp.findTObjectName(to.getObjectName()));
                 to.setObjectName(tdp.findTObjectName(to.getObjectName()));
@@ -8519,7 +8462,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev(tgc.toString());
 
             //TraceManager.addDev("Making connecting points " + tgcpList.size());
-            for(i=0; i<tgcpList.size(); i++) {
+            for (i = 0; i < tgcpList.size(); i++) {
                 p = tgcpList.elementAt(i);
                 if (!tgc.setIdTGConnectingPoint(p.x, p.y)) {
                     //TraceManager.addDev("Warning: a connecting point has been removed");
@@ -8528,7 +8471,7 @@ public class GTURTLEModeling {
             }
 
             //TraceManager.addDev("Not yet except!");
-            if (decId >0) {
+            if (decId > 0) {
                 tdp.bringToFront(tgc);
             }
             //TraceManager.addDev("Connecting points done " + myType);
@@ -8546,30 +8489,26 @@ public class GTURTLEModeling {
 
     //method added by Solange
 
-    public String generateNameIfInUse(String myName)
-    {
-        if (!(mgui.getCurrentTURTLEPanel().nameInUse(myName)))
-            {
-                return myName;
-            }
+    public String generateNameIfInUse(String myName) {
+        if (!(mgui.getCurrentTURTLEPanel().nameInUse(myName))) {
+            return myName;
+        }
 
         String other;
-        for(int w=0; w<100000; w++)
-            {
-                other = myName + "_" + w;
-                if (!(mgui.getCurrentTURTLEPanel().nameInUse(other)))
-                    {
-                        return other;
-                    }
+        for (int w = 0; w < 100000; w++) {
+            other = myName + "_" + w;
+            if (!(mgui.getCurrentTURTLEPanel().nameInUse(other))) {
+                return other;
             }
+        }
         return null;
     }
     //until here
 
-    public void makePostProcessing(TDiagramPanel tdp) throws MalformedModelingException{
+    public void makePostProcessing(TDiagramPanel tdp) throws MalformedModelingException {
         //TraceManager.addDev("Make post processing!");
         if (tdp instanceof TClassDiagramPanel) {
-            ((TClassDiagramPanel)tdp).makePostLoadingProcessing();
+            ((TClassDiagramPanel) tdp).makePostLoadingProcessing();
         }
         //TraceManager.addDev("Post processing is over");
     }
@@ -8584,7 +8523,7 @@ public class GTURTLEModeling {
             throw new MalformedModelingException();
         }
 
-        for(i=0; i<nl.getLength(); i++) {
+        for (i = 0; i < nl.getLength(); i++) {
             n = nl.item(i);
             if (n.getNodeType() == Node.ELEMENT_NODE) {
                 tgco = makeXMLConnector(n, tdp);
@@ -8612,25 +8551,25 @@ public class GTURTLEModeling {
 
         //connect connectors to their real connecting point
         //TraceManager.addDev("Valid connectors ?");
-        for(i=0; i<list.size(); i++) {
+        for (i = 0; i < list.size(); i++) {
             tgc = list.get(i);
             if (tgc instanceof TGConnector) {
-                tgco = (TGConnector)tgc;
+                tgco = (TGConnector) tgc;
                 p1 = tgco.getTGConnectingPointP1();
                 p2 = tgco.getTGConnectingPointP2();
-                if ((p1 instanceof TGConnectingPointTmp) && (p2 instanceof TGConnectingPointTmp)){
+                if ((p1 instanceof TGConnectingPointTmp) && (p2 instanceof TGConnectingPointTmp)) {
                     //TraceManager.addDev("Searching for id " + p1.getId());
                     p3 = tdp.findConnectingPoint(p1.getId());
                     //TraceManager.addDev("Searching for id " + p2.getId());
                     p4 = tdp.findConnectingPoint(p2.getId());
-                    if (((p3 ==null) || (p4 == null)) &&(decId != 0)) {
+                    if (((p3 == null) || (p4 == null)) && (decId != 0)) {
                         if (list.remove(tgc)) {
-                            i --;
+                            i--;
                         } else {
                             throw new MalformedModelingException();
                         }
                     } else {
-                        if ((p3 == null) ||(p4 == null)) {
+                        if ((p3 == null) || (p4 == null)) {
                             //warning = true;
                             if (p3 == null) {
                                 //TraceManager.addDev("Error on first id");
@@ -8679,19 +8618,19 @@ public class GTURTLEModeling {
         TGConnectingPoint p1, p2, p3, p4;
         TDiagramPanel tdp;
         TGConnector tgco;
-        for(TGConnectorInfo info: pendingConnectors) {
+        for (TGConnectorInfo info : pendingConnectors) {
             tgco = info.connector;
             if (tgco != null) {
                 tdp = tgco.getTDiagramPanel();
                 if (tdp != null) {
                     p1 = tgco.getTGConnectingPointP1();
                     p2 = tgco.getTGConnectingPointP2();
-                    if ((p1 instanceof TGConnectingPointTmp) && (p2 instanceof TGConnectingPointTmp)){
+                    if ((p1 instanceof TGConnectingPointTmp) && (p2 instanceof TGConnectingPointTmp)) {
                         TraceManager.addDev("Searching for id " + p1.getId());
                         p3 = tdp.findConnectingPoint(p1.getId());
                         TraceManager.addDev("Searching for id " + p2.getId());
                         p4 = tdp.findConnectingPoint(p2.getId());
-                        if ((p3 == null) ||(p4 == null)) {
+                        if ((p3 == null) || (p4 == null)) {
                             //warning = true;
                             if (p3 == null) {
                                 TraceManager.addDev("Error on first id");
@@ -8724,18 +8663,18 @@ public class GTURTLEModeling {
         try {
 
             NodeList nl = n.getChildNodes();
-            elt = (Element)n;
+            elt = (Element) n;
             elt1 = elt;
 
             int myType = Integer.decode(elt.getAttribute("type")).intValue();
             int myId = Integer.decode(elt.getAttribute("id")).intValue() + decId;
 
-            int myX = -1, myY = -1, myWidth = -1, myHeight =-1;
+            int myX = -1, myY = -1, myWidth = -1, myHeight = -1;
             int myMinWidth = -1, myMinHeight = -1, myMinDesiredWidth = -1, myMinDesiredHeight = -1;
             int myMaxWidth = -1, myMaxHeight = -1;
             String myName = null, myValue = null;
             int tmpx, tmpy, tmpid;
-            TGConnectingPoint p1 = null, p2=null;
+            TGConnectingPoint p1 = null, p2 = null;
             Vector<Point> pointList = new Vector<Point>();
 
             Vector<Point> tgcpList = new Vector<Point>();
@@ -8744,7 +8683,7 @@ public class GTURTLEModeling {
             //int fatherId = -1, fatherNum = -1;
             boolean automaticDrawing = true;
 
-            for(i=0; i<nl.getLength(); i++) {
+            for (i = 0; i < nl.getLength(); i++) {
                 n = nl.item(i);
                 if (n.getNodeType() == Node.ELEMENT_NODE) {
                     elt = (Element) n;
@@ -8808,7 +8747,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("TGConnector built " + myType);
 
             if (tgco == null) {
-                TraceManager.addDev( "TGCO is null myType: " + myType );
+                TraceManager.addDev("TGCO is null myType: " + myType);
                 throw new MalformedModelingException();
             }
 
@@ -8817,7 +8756,7 @@ public class GTURTLEModeling {
             if (myName != null) {
                 tgco.setName(myName);
             }
-            if ((myValue != null) && (!myValue.equals(null))){
+            if ((myValue != null) && (!myValue.equals(null))) {
                 tgco.setValueWithChange(myValue);
             }
 
@@ -8832,14 +8771,14 @@ public class GTURTLEModeling {
             tgco.loadExtraParam(elt1.getElementsByTagName("extraparam"), decX, decY, decId);
 
             //TraceManager.addDev("Making connecting points " + myType);
-            for(i=0; i<tgcpList.size(); i++) {
+            for (i = 0; i < tgcpList.size(); i++) {
                 p = tgcpList.elementAt(i);
                 if (!tgco.setIdTGConnectingPoint(p.x, p.y)) {
                     throw new MalformedModelingException();
                 }
             }
 
-            if (decId >0) {
+            if (decId > 0) {
                 tdp.bringToFront(tgco);
             }
 
@@ -8853,12 +8792,11 @@ public class GTURTLEModeling {
     }
 
 
-
     public boolean buildTURTLEModelingFromAnalysis(AnalysisPanel ap) throws AnalysisSyntaxException {
 
         HMSC h;
         //listE = new CorrespondanceTGElement();
-        checkingErrors = new LinkedList<CheckingError> ();
+        checkingErrors = new LinkedList<CheckingError>();
 
         AnalysisPanelTranslator apt = new AnalysisPanelTranslator(ap, mgui);
 
@@ -8877,17 +8815,17 @@ public class GTURTLEModeling {
 
         SDTranslator sd = new SDTranslator(h);
         checkingErrors = null;
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
         //TraceManager.addDev("Step 02");
 
-        mgui.setMode( MainGUI.VIEW_SUGG_DESIGN_KO);
+        mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
 
         //TraceManager.addDev("Step 1");
         try {
             tm = sd.toTURTLEModeling();
             tmState = 0;
         } catch (SDTranslationException e) {
-            checkingErrors = new LinkedList<CheckingError> ();
+            checkingErrors = new LinkedList<CheckingError>();
             CheckingError error = new CheckingError(CheckingError.STRUCTURE_ERROR, e.getMessage());
             checkingErrors.add(error);
 
@@ -8907,7 +8845,7 @@ public class GTURTLEModeling {
         checkingErrors = tmc.syntaxAnalysisChecking();
         //TraceManager.addDev("Step 4");
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
             return false;
         } else {
@@ -8922,7 +8860,7 @@ public class GTURTLEModeling {
 
     public void generateDesign(TURTLEModeling tm) {
         //TURTLEPanel tp = mgui.getCurrentTURTLEPanel();
-        nbSuggestedDesign ++;
+        nbSuggestedDesign++;
         TURTLEModelingDrawer tmd = new TURTLEModelingDrawer(mgui);
         tmd.setTURTLEModeling(tm);
         tmd.draw(nbSuggestedDesign);
@@ -8934,15 +8872,15 @@ public class GTURTLEModeling {
         mscd.setHMSC(_hmsc);
         mscd.setMSC(_msc);
         mscd.drawFromMSC(nbSuggestedDesign);
-        nbSuggestedDesign ++;
+        nbSuggestedDesign++;
         mgui.changeMade(null, -1);
     }
 
     public boolean translateDeployment(DeploymentPanel dp) {
         // Builds a TURTLE modeling from a deployment diagram
         TraceManager.addDev("deployement");
-        checkingErrors = new LinkedList<CheckingError> ();
-        warnings = new LinkedList<CheckingError> ();
+        checkingErrors = new LinkedList<CheckingError>();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
         tm = new TURTLEModeling();
         tmState = 0;
@@ -8967,18 +8905,18 @@ public class GTURTLEModeling {
         DesignPanelTranslator dpt;
 
         // Loop on nodes
-        while(iterator.hasNext()) {
+        while (iterator.hasNext()) {
             node = iterator.next();
 
             // Loop on artifact
             artifacts = node.getArtifactList();
-            for(i=0; i<artifacts.size(); i++) {
+            for (i = 0; i < artifacts.size(); i++) {
                 art = artifacts.elementAt(i);
                 dp2 = art.getDesignPanel();
 
                 final Iterator<TGComponent> iterator2 = dp2.tcdp.getComponentList().listIterator();
-                LinkedList<TClassInterface> tclasses = new LinkedList<TClassInterface> ();
-                while(iterator2.hasNext()) {
+                LinkedList<TClassInterface> tclasses = new LinkedList<TClassInterface>();
+                while (iterator2.hasNext()) {
                     tgc = iterator2.next();
                     if (tgc instanceof TClassInterface) {
                         TraceManager.addDev("Found tclass: " + tgc.getValue());
@@ -8988,19 +8926,19 @@ public class GTURTLEModeling {
                 if (tclasses.size() > 0) {
                     name = node.getNodeName() + "__" + art.getValue() + "__";
                     dpt = new DesignPanelTranslator(dp2);
-                    dpt.addTClasses(dp2, tclasses, name,tm);
-                    dpt.addRelations(dp2, name,tm);
+                    dpt.addTClasses(dp2, tclasses, name, tm);
+                    dpt.addRelations(dp2, name, tm);
 
                     listE.merge(dpt.getCorrespondanceTGElement());
                     checkingErrors.addAll(dpt.getErrors());
 
                     // Set package name of tclasses
-                    for(int j=0; j<tclasses.size(); j++) {
-                        tgc = (TGComponent) tclasses.get (j);
+                    for (int j = 0; j < tclasses.size(); j++) {
+                        tgc = (TGComponent) tclasses.get(j);
                         t = listE.getTClass(tgc);
                         if (t != null) {
                             TraceManager.addDev("Setting package name of " + t.getName() + " to " + node.getNodeName());
-                            t.setPackageName(node.getNodeName()+"_"+art.getValue());
+                            t.setPackageName(node.getNodeName() + "_" + art.getValue());
                         }
                     }
                 }
@@ -9022,7 +8960,7 @@ public class GTURTLEModeling {
 
         mgui.setMode(MainGUI.GEN_DESIGN_OK);
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         }
 
@@ -9031,7 +8969,7 @@ public class GTURTLEModeling {
         TURTLEModelChecker tmc = new TURTLEModelChecker(tm);
         checkingErrors = tmc.syntaxAnalysisChecking();
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         } else {
             mgui.setMode(MainGUI.GEN_DESIGN_OK);
@@ -9041,10 +8979,11 @@ public class GTURTLEModeling {
 
     public boolean translateAttackTreePanel(AttackTreePanel atp) {
         AttackTreePanelTranslator att = new AttackTreePanelTranslator(atp);
-        /*attackTree =*/ att.translateToAttackTreeDataStructure();
+        /*attackTree =*/
+        att.translateToAttackTreeDataStructure();
         checkingErrors = att.getCheckingErrors();
         warnings = att.getWarnings();
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         }
         avatarspec = att.generateAvatarSpec();
@@ -9054,8 +8993,8 @@ public class GTURTLEModeling {
 
     public boolean translateNC(NCPanel ncp) {
         TraceManager.addDev("Translating NC");
-        checkingErrors = new LinkedList<CheckingError> ();
-        warnings = new LinkedList<CheckingError> ();
+        checkingErrors = new LinkedList<CheckingError>();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
 
         GNCModeling gncm = new GNCModeling(ncp);
@@ -9066,16 +9005,16 @@ public class GTURTLEModeling {
         warnings = gncm.getCheckingWarnings();
 
         TraceManager.addDev("errors:" + checkingErrors.size() + " warnings:" + warnings.size());
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         } else {
             // Generate XML file
             try {
-            	if (SpecConfigTTool.NCDirectory != null) {
-            		File dir = new File(SpecConfigTTool.NCDirectory);
-            		if (!dir.exists())
-            			dir.mkdirs();
-            	}
+                if (SpecConfigTTool.NCDirectory != null) {
+                    File dir = new File(SpecConfigTTool.NCDirectory);
+                    if (!dir.exists())
+                        dir.mkdirs();
+                }
                 String fileName = "network.xml";
                 if (SpecConfigTTool.NCDirectory != null) {
                     fileName = SpecConfigTTool.NCDirectory + fileName;
@@ -9109,7 +9048,7 @@ public class GTURTLEModeling {
     public boolean translateTMLDesign(Vector<? extends TGComponent> tasksToTakeIntoAccount, TMLDesignPanel tmldp, boolean optimize) {
         nullifyTMLModeling();
         //  List<TMLError> warningsOptimize = new ArrayList<TMLError>();
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
 
         GTMLModeling gtmlm = new GTMLModeling(tmldp, true);
@@ -9128,7 +9067,7 @@ public class GTURTLEModeling {
         checkingErrors = gtmlm.getCheckingErrors();
         warnings = gtmlm.getCheckingWarnings();
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             analyzeErrors();
 
             return false;
@@ -9146,11 +9085,11 @@ public class GTURTLEModeling {
         }
     }
 
-    public Vector<CheckingError> convertToCheckingErrorTMLErrors( List<TMLError> warningsOptimize, TDiagramPanel _tdp) {
+    public Vector<CheckingError> convertToCheckingErrorTMLErrors(List<TMLError> warningsOptimize, TDiagramPanel _tdp) {
         Vector<CheckingError> v = new Vector<CheckingError>();
         UICheckingError warning;
 
-        for(TMLError error: warningsOptimize) {
+        for (TMLError error : warningsOptimize) {
             warning = new UICheckingError(CheckingError.BEHAVIOR_ERROR, error.message);
             warning.setTDiagramPanel(_tdp);
             v.add(warning);
@@ -9162,7 +9101,7 @@ public class GTURTLEModeling {
     public boolean translateTMLComponentDesign(Vector<? extends TGComponent> componentsToTakeIntoAccount, TMLComponentDesignPanel tmlcdp, boolean optimize) {
         nullifyTMLModeling();
         //      ArrayList<TMLError> warningsOptimize = new ArrayList<TMLError>();
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
 
         GTMLModeling gctmlm = new GTMLModeling(tmlcdp, true);
@@ -9182,11 +9121,10 @@ public class GTURTLEModeling {
         checkingErrors = gctmlm.getCheckingErrors();
         warnings = gctmlm.getCheckingWarnings();
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             analyzeErrors();
             return false;
-        }
-        else {
+        } else {
             //                  if (optimize) {
             //                          //TraceManager.addDev("OPTIMIZE");
             //                          warningsOptimize = tmlm.optimize();
@@ -9204,7 +9142,7 @@ public class GTURTLEModeling {
     public boolean translateTMLModeling() {
         TML2TURTLE tt = new TML2TURTLE(tmlm);
         tm = tt.generateTURTLEModeling();
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             TraceManager.addDev("Error in TURTLE generation");
             analyzeErrors();
             return false;
@@ -9215,7 +9153,7 @@ public class GTURTLEModeling {
             TraceManager.addDev("Optimize done");
             TURTLEModelChecker tmc = new TURTLEModelChecker(tm);
             checkingErrors = tmc.syntaxAnalysisChecking();
-            if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+            if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
                 analyzeErrors();
                 return false;
             } else {
@@ -9226,41 +9164,41 @@ public class GTURTLEModeling {
     }
 
     public boolean checkSyntaxSystemCAMS(Vector<TGComponent> blocksToTakeIntoAccount, SystemCAMSPanel scp, boolean optimize) { //ajout CD 04/07 FIXME
-    //     List<TMLError> warningsOptimize = new ArrayList<TMLError>();
-    //     warnings = new LinkedList<CheckingError> ();
-    //     mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
-    //     GTMLModeling gtmlm = new GTMLModeling(scp, true);
-
-    // 	// gtmlm.setBlocks(blocksToTakeIntoAccount); //simply transforms the parameter from a Vector to LinkedList
-    //     nullifyTMLModeling();
-    //     tmlm = null;
-    //     tm = null;
-    //     tmState = 1;
-    // 	// scp = gtmlm.translateToSystemCAMS();
-
-    //     listE = gtmlm.getCorrespondanceTable();
-
-    //     checkingErrors = gtmlm.getCheckingErrors();
-    //     avatarspec = gtmlm.avspec;
-    //     if ((checkingErrors != null) && (checkingErrors.size() > 0)){
-    //         analyzeErrors();
-    //         warnings = gtmlm.getCheckingWarnings();
-    //         return false;
-    //     } else {
-    //         if (optimize) {
-    //             warningsOptimize = tmap.optimize();
-    //         }
-    // 	    //  warnings.addAll(convertToCheckingErrorTMLErrors(warningsOptimize, scp.scp));
-    //         mgui.resetAllDIPLOIDs();
-    //         listE.useDIPLOIDs();
-    //         mgui.setMode(MainGUI.GEN_DESIGN_OK);
-	return true;
-    //     }
+        //     List<TMLError> warningsOptimize = new ArrayList<TMLError>();
+        //     warnings = new LinkedList<CheckingError> ();
+        //     mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
+        //     GTMLModeling gtmlm = new GTMLModeling(scp, true);
+
+        // 	// gtmlm.setBlocks(blocksToTakeIntoAccount); //simply transforms the parameter from a Vector to LinkedList
+        //     nullifyTMLModeling();
+        //     tmlm = null;
+        //     tm = null;
+        //     tmState = 1;
+        // 	// scp = gtmlm.translateToSystemCAMS();
+
+        //     listE = gtmlm.getCorrespondanceTable();
+
+        //     checkingErrors = gtmlm.getCheckingErrors();
+        //     avatarspec = gtmlm.avspec;
+        //     if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        //         analyzeErrors();
+        //         warnings = gtmlm.getCheckingWarnings();
+        //         return false;
+        //     } else {
+        //         if (optimize) {
+        //             warningsOptimize = tmap.optimize();
+        //         }
+        // 	    //  warnings.addAll(convertToCheckingErrorTMLErrors(warningsOptimize, scp.scp));
+        //         mgui.resetAllDIPLOIDs();
+        //         listE.useDIPLOIDs();
+        //         mgui.setMode(MainGUI.GEN_DESIGN_OK);
+        return true;
+        //     }
     }
 
     public boolean checkSyntaxTMLMapping(Vector<TGComponent> nodesToTakeIntoAccount, TMLArchiPanel tmlap, boolean optimize) {
         List<TMLError> warningsOptimize = new ArrayList<TMLError>();
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
         //TraceManager.addDev("New TML Mapping");
         GTMLModeling gtmlm = new GTMLModeling(tmlap, true);
@@ -9279,7 +9217,7 @@ public class GTURTLEModeling {
         warnings = gtmlm.getCheckingWarnings();
 
         avatarspec = gtmlm.avspec;
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             analyzeErrors();
             return false;
         } else {
@@ -9298,15 +9236,15 @@ public class GTURTLEModeling {
     //Newly introduced to perform Syntax check of CP diagrams. Actually the mapping of CPs onto the architecture is done via SDs,
     //onto the application is done onto blocks in the architecture. It would be better to have all the mapping information in one
     //diagram. Up to now, not taking the mapping information into account
-    public boolean checkSyntaxTMLCP( Vector<TGComponent> nodesToTakeIntoAccount, TMLCommunicationPatternPanel tmlcpp, boolean optimize ) {
+    public boolean checkSyntaxTMLCP(Vector<TGComponent> nodesToTakeIntoAccount, TMLCommunicationPatternPanel tmlcpp, boolean optimize) {
 
         //nodesToTakeIntoAccount is the list of SDs and ADs corresponding that compose the CP selected for syntax checking
         //      List<TMLError> warningsOptimize = new ArrayList<TMLError>();
-        warnings = new LinkedList<CheckingError> ();
-        mgui.setMode( MainGUI.VIEW_SUGG_DESIGN_KO );
-        GTMLModeling gtmlm = new GTMLModeling( tmlcpp, true );
+        warnings = new LinkedList<CheckingError>();
+        mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
+        GTMLModeling gtmlm = new GTMLModeling(tmlcpp, true);
 
-        TraceManager.addDev( "NodesToTakeIntoAccount :" + nodesToTakeIntoAccount.toString() );
+        TraceManager.addDev("NodesToTakeIntoAccount :" + nodesToTakeIntoAccount.toString());
 
         //Useless because nodesToTakeIntoAccount does not include the mainCP!
         //gtmlm.setDiagramPanels( nodesToTakeIntoAccount );      //passes the list of nodes (SDs and ADs) to gtml as a LinkedList
@@ -9315,21 +9253,21 @@ public class GTURTLEModeling {
         tmState = 1;
         nullifyTMLModeling();
         //tmlcp is the data structure for a CP corresponding to the graphical description with diagrams
-        tmlcp = gtmlm.translateToTMLCPDataStructure( tmlcpp.getName() );
+        tmlcp = gtmlm.translateToTMLCPDataStructure(tmlcpp.getName());
         //tmlcp.toString();
         /*TraceManager.addDev( "I AM ABOUT TO GENERATE THE TMLtxt CODE!" );
           mgui.generateTMLTxt();                //Now generating the TMLtxt code
           TraceManager.addDev( "TMLtxt CODE GENERATION DONE" );*/
         listE = gtmlm.getCorrespondanceTable();
         //for( CorrespondanceTGElement element : listE.getNames() )      {
-        TraceManager.addDev( "Printing listE.getNames: " + listE.getNames().toString() );
-        TraceManager.addDev( "Printing listE.getTG: " + listE.getTG().toString() );
-        TraceManager.addDev( "Printing listE.getPanelNames: " + listE.getPanelNames().toString() );
-        TraceManager.addDev( "Printing listE.getData: " + listE.getData().toString() );
+        TraceManager.addDev("Printing listE.getNames: " + listE.getNames().toString());
+        TraceManager.addDev("Printing listE.getTG: " + listE.getTG().toString());
+        TraceManager.addDev("Printing listE.getPanelNames: " + listE.getPanelNames().toString());
+        TraceManager.addDev("Printing listE.getData: " + listE.getData().toString());
         //}
         checkingErrors = gtmlm.getCheckingErrors();
 
-        if( (checkingErrors != null) && (checkingErrors.size() > 0) )   {
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             //analyzeErrors();
 
             return false;
@@ -9379,7 +9317,7 @@ public class GTURTLEModeling {
 
         TraceManager.addDev("tm generated from TMAP");
         checkingErrors = m2tif.getCheckingErrors();
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         }
         mgui.setMode(MainGUI.GEN_DESIGN_OK);
@@ -9393,7 +9331,7 @@ public class GTURTLEModeling {
     //
 
     public boolean translateTURTLEOSDesign(TURTLEOSDesignPanel tosdp) {
-        warnings = new LinkedList<CheckingError> ();
+        warnings = new LinkedList<CheckingError>();
         mgui.setMode(MainGUI.VIEW_SUGG_DESIGN_KO);
         //TraceManager.addDev("New TML Modeling");
         GTURTLEOSModeling gosm = new GTURTLEOSModeling(tosdp);
@@ -9407,7 +9345,7 @@ public class GTURTLEModeling {
         tmState = 0;
         checkingErrors = gosm.getCheckingErrors();
 
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         } else {
 
@@ -9416,7 +9354,7 @@ public class GTURTLEModeling {
             //TraceManager.addDev("Optimize done");
             TURTLEModelChecker tmc = new TURTLEModelChecker(tm);
             checkingErrors = tmc.syntaxAnalysisChecking();
-            if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+            if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
                 return false;
             } else {
                 warnings = gosm.getCheckingWarnings();
@@ -9444,7 +9382,7 @@ public class GTURTLEModeling {
         TURTLEModelChecker tmc = new TURTLEModelChecker(tm);
         checkingErrors = tmc.syntaxAnalysisChecking();
         warnings = tmc.getWarnings();
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         } else {
             //A faire:
@@ -9458,14 +9396,14 @@ public class GTURTLEModeling {
     }
 
 
-    public void addStates(AvatarStateMachineElement asme, int x, int y, AvatarSMDPanel smp, AvatarBDBlock bl, Map<AvatarStateMachineElement, TGComponent> SMDMap, Map<AvatarStateMachineElement, TGComponent> locMap, Map<AvatarTransition, AvatarStateMachineElement> tranDestMap, Map<AvatarTransition, TGComponent> tranSourceMap){
+    public void addStates(AvatarStateMachineElement asme, int x, int y, AvatarSMDPanel smp, AvatarBDBlock bl, Map<AvatarStateMachineElement, TGComponent> SMDMap, Map<AvatarStateMachineElement, TGComponent> locMap, Map<AvatarTransition, AvatarStateMachineElement> tranDestMap, Map<AvatarTransition, TGComponent> tranSourceMap) {
         // TGConnectingPoint tp = new TGConnectingPoint(null, x, y, false, false);
         //Create dummy tgcomponent
-        TGComponent tgcomp = new AvatarSMDStartState(x,y,smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(),false,null,smp);
-        if (asme==null){
+        TGComponent tgcomp = new AvatarSMDStartState(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
+        if (asme == null) {
             return;
         }
-        if (asme instanceof AvatarStartState){
+        if (asme instanceof AvatarStartState) {
             AvatarSMDStartState smdss = new AvatarSMDStartState(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
             tgcomp = smdss;
             smp.addComponent(smdss, x, y, false, true);
@@ -9473,33 +9411,33 @@ public class GTURTLEModeling {
             //   tp = smdss.tgconnectingPointAtIndex(0);
             locMap.put(asme, smdss);
         }
-        if (asme instanceof AvatarTransition){
+        if (asme instanceof AvatarTransition) {
             //
         }
-        if (asme instanceof AvatarRandom){
+        if (asme instanceof AvatarRandom) {
             AvatarSMDRandom smdr = new AvatarSMDRandom(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
-            smdr.setVariable(((AvatarRandom)asme).getVariable());
+            smdr.setVariable(((AvatarRandom) asme).getVariable());
             smp.addComponent(smdr, x, y, false, true);
-            tgcomp=smdr;
+            tgcomp = smdr;
             SMDMap.put(asme, smdr);
             locMap.put(asme, smdr);
         }
-        if (asme instanceof AvatarActionOnSignal){
+        if (asme instanceof AvatarActionOnSignal) {
             avatartranslator.AvatarSignal sig = ((AvatarActionOnSignal) asme).getSignal();
-            if (sig.isIn()){
+            if (sig.isIn()) {
                 AvatarSMDReceiveSignal smdrs = new AvatarSMDReceiveSignal(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
-                tgcomp=smdrs;
+                tgcomp = smdrs;
                 smp.addComponent(smdrs, x, y, false, true);
                 //                              String name=sig.minString();
                 //System.out.println("signal values" +((AvatarActionOnSignal)asme).getValues());
-                String parameters="";
-                if (((AvatarActionOnSignal)asme).getValues().size()>0){
-                    parameters+=((AvatarActionOnSignal)asme).getValues().get(0);
-                    for (int i=1; i < ((AvatarActionOnSignal)asme).getValues().size(); i++){
-                        parameters=parameters+","+((AvatarActionOnSignal)asme).getValues().get(i);
+                String parameters = "";
+                if (((AvatarActionOnSignal) asme).getValues().size() > 0) {
+                    parameters += ((AvatarActionOnSignal) asme).getValues().get(0);
+                    for (int i = 1; i < ((AvatarActionOnSignal) asme).getValues().size(); i++) {
+                        parameters = parameters + "," + ((AvatarActionOnSignal) asme).getValues().get(i);
                     }
                 }
-                String name=sig.getName()+"("+parameters+")";
+                String name = sig.getName() + "(" + parameters + ")";
                 smdrs.setValue(name);
                 // sig.setName(name);
                 smdrs.recalculateSize();
@@ -9507,23 +9445,22 @@ public class GTURTLEModeling {
                 //   tp = smdrs.getFreeTGConnectingPoint(x+smdrs.getWidth()/2,y+smdrs.getHeight());
                 //  TGConnectingPoint tp2 = smdrs.getFreeTGConnectingPoint(x+smdrs.getWidth()/2,y);
                 locMap.put(asme, smdrs);
-                if (bl.getAvatarSignalFromName(name) ==null){
+                if (bl.getAvatarSignalFromName(name) == null) {
                     //bl.addSignal(new ui.AvatarSignal(0, name, new String[0], new String[0]));
                 }
 
-            }
-            else {
+            } else {
                 AvatarSMDSendSignal smdss = new AvatarSMDSendSignal(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
-                tgcomp=smdss;
+                tgcomp = smdss;
                 smp.addComponent(smdss, x, y, false, true);
-                String parameters="";
-                if (((AvatarActionOnSignal)asme).getValues().size()>0){
-                    parameters+=((AvatarActionOnSignal)asme).getValues().get(0);
-                    for (int i=1; i < ((AvatarActionOnSignal)asme).getValues().size(); i++){
-                        parameters=parameters+","+((AvatarActionOnSignal)asme).getValues().get(i);
+                String parameters = "";
+                if (((AvatarActionOnSignal) asme).getValues().size() > 0) {
+                    parameters += ((AvatarActionOnSignal) asme).getValues().get(0);
+                    for (int i = 1; i < ((AvatarActionOnSignal) asme).getValues().size(); i++) {
+                        parameters = parameters + "," + ((AvatarActionOnSignal) asme).getValues().get(i);
                     }
                 }
-                String name=sig.getName()+"("+parameters+")";
+                String name = sig.getName() + "(" + parameters + ")";
                 //String name=sig.minString();
                 smdss.setValue(name);
                 smdss.recalculateSize();
@@ -9531,21 +9468,21 @@ public class GTURTLEModeling {
                 //  tp = smdss.getFreeTGConnectingPoint(x+smdss.getWidth()/2,y+smdss.getHeight());
                 //      TGConnectingPoint tp2 = smdss.getFreeTGConnectingPoint(x+smdss.getWidth()/2,y);
                 locMap.put(asme, smdss);
-                if (bl.getAvatarSignalFromName(name)  == null){
+                if (bl.getAvatarSignalFromName(name) == null) {
                     // bl.addSignal(new ui.AvatarSignal(1, name, new String[0], new String[0]));
                 }
             }
 
         }
-        if (asme instanceof AvatarStopState){
+        if (asme instanceof AvatarStopState) {
             AvatarSMDStopState smdstop = new AvatarSMDStopState(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
-            tgcomp=smdstop;
+            tgcomp = smdstop;
             SMDMap.put(asme, smdstop);
             smp.addComponent(smdstop, x, y, false, true);
             //  tp = smdstop.tgconnectingPointAtIndex(0);
             locMap.put(asme, smdstop);
         }
-        if (asme instanceof AvatarState){
+        if (asme instanceof AvatarState) {
             //check if empty checker state
             /* if (asme.getName().contains("signalstate_")){
             //don't add the state, ignore next transition,
@@ -9562,7 +9499,7 @@ public class GTURTLEModeling {
             }
             }*/
             AvatarSMDState smdstate = new AvatarSMDState(x, y, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp);
-            tgcomp=smdstate;
+            tgcomp = smdstate;
             smp.addComponent(smdstate, x, y, false, true);
             smdstate.setValue(asme.getName());
             smdstate.recalculateSize();
@@ -9571,92 +9508,91 @@ public class GTURTLEModeling {
             //  TGConnectingPoint tp2 = smdstate.getFreeTGConnectingPoint(x+smdstate.getWidth()/2,y);
             locMap.put(asme, smdstate);
         }
-        int i=0;
-        int diff=300;
-        int ydiff=50;
+        int i = 0;
+        int diff = 300;
+        int ydiff = 50;
         //int num = asme.nbOfNexts();
-        if (!(asme instanceof AvatarTransition)){
-            for (AvatarStateMachineElement el:asme.getNexts()){
-                if (!(el instanceof AvatarTransition)){
+        if (!(asme instanceof AvatarTransition)) {
+            for (AvatarStateMachineElement el : asme.getNexts()) {
+                if (!(el instanceof AvatarTransition)) {
                     System.out.println("ERROR: non-Transition " + asme + " connected to non-Transition " + el);
                 }
             }
         }
-        for (AvatarStateMachineElement el:asme.getNexts()){
-            if (el instanceof AvatarTransition){
+        for (AvatarStateMachineElement el : asme.getNexts()) {
+            if (el instanceof AvatarTransition) {
                 tranSourceMap.put((AvatarTransition) el, tgcomp);
-            }
-            else {
-                if (asme instanceof AvatarTransition){
+            } else {
+                if (asme instanceof AvatarTransition) {
                     AvatarTransition t = (AvatarTransition) asme;
                     tranDestMap.put(t, el);
                 }
             }
-            if (!SMDMap.containsKey(el)){
-                addStates(el, x+diff*i, y+ydiff, smp, bl, SMDMap, locMap, tranDestMap, tranSourceMap);
+            if (!SMDMap.containsKey(el)) {
+                addStates(el, x + diff * i, y + ydiff, smp, bl, SMDMap, locMap, tranDestMap, tranSourceMap);
             }
             i++;
         }
         return;
     }
 
-    public void drawBlockProperties(AvatarBlock ab, AvatarBDBlock bl){
-        for (avatartranslator.AvatarSignal sig:ab.getSignals()){
-            String name=sig.getName().split("__")[sig.getName().split("__").length-1];
+    public void drawBlockProperties(AvatarBlock ab, AvatarBDBlock bl) {
+        for (avatartranslator.AvatarSignal sig : ab.getSignals()) {
+            String name = sig.getName().split("__")[sig.getName().split("__").length - 1];
             //           sig.setName(name);
             String[] types = new String[sig.getListOfAttributes().size()];
             String[] typeIds = new String[sig.getListOfAttributes().size()];
-            int i=0;
-            for (AvatarAttribute attr: sig.getListOfAttributes()){
-                types[i]=attr.getType().getStringType();
-                typeIds[i]=attr.getName();
+            int i = 0;
+            for (AvatarAttribute attr : sig.getListOfAttributes()) {
+                types[i] = attr.getType().getStringType();
+                typeIds[i] = attr.getName();
                 i++;
             }
-            TraceManager.addDev("Adding signal "+sig);
+            TraceManager.addDev("Adding signal " + sig);
             bl.addSignal(new ui.AvatarSignal(sig.getInOut(), name, types, typeIds));
         }
 
-        bl.setValueWithChange(ab.getName().split("__")[ab.getName().split("__").length-1]);
+        bl.setValueWithChange(ab.getName().split("__")[ab.getName().split("__").length - 1]);
 
-        for (AvatarAttribute attr: ab.getAttributes()){
-            int type=5;
-            if (attr.getType()==AvatarType.BOOLEAN){
-                type=4;
+        for (AvatarAttribute attr : ab.getAttributes()) {
+            int type = 5;
+            if (attr.getType() == AvatarType.BOOLEAN) {
+                type = 4;
             }
-            if (attr.getType()==AvatarType.INTEGER){
-                type=0;
+            if (attr.getType() == AvatarType.INTEGER) {
+                type = 0;
             }
-            if (attr.hasInitialValue()){
+            if (attr.hasInitialValue()) {
                 bl.addAttribute(new TAttribute(0, attr.getName(), attr.getInitialValue(), type));
-            }
-            else {
+            } else {
                 bl.addAttribute(new TAttribute(0, attr.getName(), attr.getType().getDefaultInitialValue(), type));
             }
-            if (attr.getName().contains("key_") || attr.getName().contains("privKey_")){
-                hasCrypto=true;
+            if (attr.getName().contains("key_") || attr.getName().contains("privKey_")) {
+                hasCrypto = true;
                 bl.addCryptoElements();
             }
         }
-        for (avatartranslator.AvatarMethod method: ab.getMethods()){
-            bl.addMethodIfApplicable(method.toString().replaceAll(" = 0",""));
+        for (avatartranslator.AvatarMethod method : ab.getMethods()) {
+            bl.addMethodIfApplicable(method.toString().replaceAll(" = 0", ""));
         }
     }
-    public void drawPanel(AvatarSpecification avspec, AvatarDesignPanel adp){
+
+    public void drawPanel(AvatarSpecification avspec, AvatarDesignPanel adp) {
         //System.out.println(avspec.toString());
-        hasCrypto=false;
+        hasCrypto = false;
         Map<String, Set<String>> originDestMap = new HashMap<String, Set<String>>();
         Map<String, AvatarBDBlock> blockMap = new HashMap<String, AvatarBDBlock>();
-        if (adp ==null){
+        if (adp == null) {
             return;
         }
-        if (avspec==null){
+        if (avspec == null) {
             return;
         }
         AvatarBDPanel abd = adp.abdp;
 
         //Find all blocks, create nested blocks starting from top left
-        int xpos=10;
-        int ypos=40;
+        int xpos = 10;
+        int ypos = 40;
 
         //Create blocks recursively, starting from top level ones with no father
         //Lowest level blocks should be 100x100, next should be 100x(number of children*100+50)...etc,
@@ -9664,113 +9600,111 @@ public class GTURTLEModeling {
         Map<AvatarBlock, Integer> blockLevelMap = new HashMap<AvatarBlock, Integer>();
         Map<AvatarBlock, Integer> blockSizeMap = new HashMap<AvatarBlock, Integer>();
         Map<AvatarBlock, Integer> blockIncMap = new HashMap<AvatarBlock, Integer>();
-        int maxLevel=0;
-        for (AvatarBlock ab: avspec.getListOfBlocks()){
-            int level=0;
-            AvatarBlock block=ab;
-            while (block.getFather()!=null){
-                if (blockSizeMap.containsKey(block.getFather())){
-                    blockSizeMap.put(block.getFather(), blockSizeMap.get(block.getFather())+1);
-                }
-                else {
-                    blockSizeMap.put(block.getFather(),1);
+        int maxLevel = 0;
+        for (AvatarBlock ab : avspec.getListOfBlocks()) {
+            int level = 0;
+            AvatarBlock block = ab;
+            while (block.getFather() != null) {
+                if (blockSizeMap.containsKey(block.getFather())) {
+                    blockSizeMap.put(block.getFather(), blockSizeMap.get(block.getFather()) + 1);
+                } else {
+                    blockSizeMap.put(block.getFather(), 1);
                     blockIncMap.put(block.getFather(), 10);
                 }
                 level++;
-                block=block.getFather();
+                block = block.getFather();
             }
-            if (level>maxLevel){
-                maxLevel=level;
+            if (level > maxLevel) {
+                maxLevel = level;
             }
-            if (!blockSizeMap.containsKey(block)){
+            if (!blockSizeMap.containsKey(block)) {
                 blockSizeMap.put(block, 0);
-                blockIncMap.put(block,10);
+                blockIncMap.put(block, 10);
             }
             blockLevelMap.put(ab, level);
         }
 
 
-        for (int level=0; level<maxLevel+1; level++){
-            for (AvatarBlock ab:avspec.getListOfBlocks()){
-                if (blockLevelMap.get(ab)==level){
-                    if (level==0){
+        for (int level = 0; level < maxLevel + 1; level++) {
+            for (AvatarBlock ab : avspec.getListOfBlocks()) {
+                if (blockLevelMap.get(ab) == level) {
+                    if (level == 0) {
                         AvatarBDBlock bl = new AvatarBDBlock(xpos, ypos, abd.getMinX(), abd.getMaxX(), abd.getMinY(), abd.getMaxY(), false, null, abd);
                         abd.addComponent(bl, xpos, ypos, false, true);
-                        bl.resize(100*blockSizeMap.get(ab)+100, 100+(maxLevel-level)*50);
-                        drawBlockProperties(ab,bl);
+                        bl.resize(100 * blockSizeMap.get(ab) + 100, 100 + (maxLevel - level) * 50);
+                        drawBlockProperties(ab, bl);
                         AvatarSMDPanel smp = adp.getAvatarSMDPanel(bl.getValue());
                         buildStateMachine(ab, bl, smp);
-                        blockMap.put(bl.getValue().split("__")[bl.getValue().split("__").length-1], bl);
-                        xpos+=100*blockSizeMap.get(ab)+200;
-                    }
-                    else {
+                        blockMap.put(bl.getValue().split("__")[bl.getValue().split("__").length - 1], bl);
+                        xpos += 100 * blockSizeMap.get(ab) + 200;
+                    } else {
 
-                        AvatarBDBlock father= blockMap.get(ab.getFather().getName().split("__")[ab.getFather().getName().split("__").length-1]);
+                        AvatarBDBlock father = blockMap.get(ab.getFather().getName().split("__")[ab.getFather().getName().split("__").length - 1]);
                         //System.out.println("blockmap " + blockMap);
-                        if (father==null){
+                        if (father == null) {
                             //System.out.println("Missing father block " + ab.getFather().getName());
                             continue;
                         }
-                        AvatarBDBlock bl = new AvatarBDBlock(father.getX()+blockIncMap.get(ab.getFather()), father.getY()+10, abd.getMinX(), abd.getMaxX(), abd.getMinY(), abd.getMaxY(), false, father, abd);
-                        abd.addComponent(bl, father.getX()+blockIncMap.get(ab.getFather()), father.getY()+10, false, true);
-                        int size=100;
-                        if (blockSizeMap.containsKey(ab)){
-                            size=100*blockSizeMap.get(ab)+50;
+                        AvatarBDBlock bl = new AvatarBDBlock(father.getX() + blockIncMap.get(ab.getFather()), father.getY() + 10, abd.getMinX(), abd.getMaxX(), abd.getMinY(), abd.getMaxY(), false, father, abd);
+                        abd.addComponent(bl, father.getX() + blockIncMap.get(ab.getFather()), father.getY() + 10, false, true);
+                        int size = 100;
+                        if (blockSizeMap.containsKey(ab)) {
+                            size = 100 * blockSizeMap.get(ab) + 50;
                         }
-                        bl.resize(size, 100+(maxLevel-level)*50);
-                        drawBlockProperties(ab,bl);
+                        bl.resize(size, 100 + (maxLevel - level) * 50);
+                        drawBlockProperties(ab, bl);
                         abd.attach(bl);
                         AvatarSMDPanel smp = adp.getAvatarSMDPanel(bl.getValue());
                         buildStateMachine(ab, bl, smp);
-                        blockMap.put(bl.getValue().split("__")[bl.getValue().split("__").length-1], bl);
-                        blockIncMap.put(ab.getFather(), blockIncMap.get(ab.getFather())+size+10);
+                        blockMap.put(bl.getValue().split("__")[bl.getValue().split("__").length - 1], bl);
+                        blockIncMap.put(ab.getFather(), blockIncMap.get(ab.getFather()) + size + 10);
                     }
                 }
             }
         }
 
 
-        for (AvatarRelation ar: avspec.getRelations()){
+        for (AvatarRelation ar : avspec.getRelations()) {
             String bl1 = ar.block1.getName();
             String bl2 = ar.block2.getName();
-            if (originDestMap.containsKey(bl1.split("__")[bl1.split("__").length-1])){
-                originDestMap.get(bl1.split("__")[bl1.split("__").length-1]).add(bl2.split("__")[bl2.split("__").length-1]);
-            } else if (originDestMap.containsKey(bl2.split("__")[bl2.split("__").length-1])){
-                originDestMap.get(bl2.split("__")[bl2.split("__").length-1]).add(bl1.split("__")[bl1.split("__").length-1]);
+            if (originDestMap.containsKey(bl1.split("__")[bl1.split("__").length - 1])) {
+                originDestMap.get(bl1.split("__")[bl1.split("__").length - 1]).add(bl2.split("__")[bl2.split("__").length - 1]);
+            } else if (originDestMap.containsKey(bl2.split("__")[bl2.split("__").length - 1])) {
+                originDestMap.get(bl2.split("__")[bl2.split("__").length - 1]).add(bl1.split("__")[bl1.split("__").length - 1]);
             } else {
-                Set<String> hs= new HashSet<String>();
-                hs.add(bl2.split("__")[bl2.split("__").length-1]);
-                originDestMap.put(bl1.split("__")[bl1.split("__").length-1], hs);
+                Set<String> hs = new HashSet<String>();
+                hs.add(bl2.split("__")[bl2.split("__").length - 1]);
+                originDestMap.put(bl1.split("__")[bl1.split("__").length - 1], hs);
             }
         }
         //Add Relations
 
-        for (String bl1: originDestMap.keySet()){
-            for (String bl2:originDestMap.get(bl1)){
-                Vector<Point> points=new Vector<Point>();
+        for (String bl1 : originDestMap.keySet()) {
+            for (String bl2 : originDestMap.get(bl1)) {
+                Vector<Point> points = new Vector<Point>();
                 //      System.out.println("Finding " + bl1 + " and bl2 "+ bl2);
-                if (blockMap.get(bl1)==null || blockMap.get(bl2)==null){
+                if (blockMap.get(bl1) == null || blockMap.get(bl2) == null) {
                     continue;
                 }
-                TGConnectingPoint p1= blockMap.get(bl1).findFirstFreeTGConnectingPoint(true,true);
+                TGConnectingPoint p1 = blockMap.get(bl1).findFirstFreeTGConnectingPoint(true, true);
                 p1.setFree(false);
 
-                TGConnectingPoint p2= blockMap.get(bl2).findFirstFreeTGConnectingPoint(true,true);
+                TGConnectingPoint p2 = blockMap.get(bl2).findFirstFreeTGConnectingPoint(true, true);
                 p2.setFree(false);
 
-                if (bl2.equals(bl1)){
+                if (bl2.equals(bl1)) {
                     //Add 2 point so the connection looks square
-                    Point p = new Point(p1.getX(), p1.getY()-10);
+                    Point p = new Point(p1.getX(), p1.getY() - 10);
                     points.add(p);
-                    p = new Point(p2.getX(), p2.getY()-10);
+                    p = new Point(p2.getX(), p2.getY() - 10);
                     points.add(p);
                 }
                 AvatarBDPortConnector conn = new AvatarBDPortConnector(0, 0, 0, 0, 0, 0, true, null, abd, p1, p2, points);
-                abd.addComponent(conn, 0,0,false,true);
+                abd.addComponent(conn, 0, 0, false, true);
 
                 //Add Relations to connector
-                for (AvatarRelation ar:avspec.getRelations()){
-                    if (ar.block1.getName().contains(bl1) && ar.block2.getName().contains(bl2) || ar.block1.getName().contains(bl2) && ar.block2.getName().contains(bl1)){
+                for (AvatarRelation ar : avspec.getRelations()) {
+                    if (ar.block1.getName().contains(bl1) && ar.block2.getName().contains(bl2) || ar.block1.getName().contains(bl2) && ar.block2.getName().contains(bl1)) {
 
                         //TGConnectingPoint p1= blockMap.get(bl1).getFreeTGConnectingPoint(blockMap.get(bl1).getX(), blockMap.get(bl1).getY());
 
@@ -9779,10 +9713,10 @@ public class GTURTLEModeling {
                         conn.setPrivate(ar.isPrivate());
                         conn.setSizeOfFIFO(ar.getSizeOfFIFO());
                         //System.out.println(bl1 +" "+ ar.block1.getName() + " "+ ar.block2.getName());
-                        for (int i =0; i< ar.nbOfSignals(); i++){
+                        for (int i = 0; i < ar.nbOfSignals(); i++) {
                             //System.out.println("Adding relation " + ar.getSignal1(i).toString() + " " + ar.getSignal2(i).toBasicString());
-                            conn.addSignal(ar.getSignal1(i).toString(),ar.getSignal1(i).getInOut()==0,ar.block1.getName().contains(bl1));
-                            conn.addSignal(ar.getSignal2(i).toString(), ar.getSignal2(i).getInOut()==0,!ar.block1.getName().contains(bl1));
+                            conn.addSignal(ar.getSignal1(i).toString(), ar.getSignal1(i).getInOut() == 0, ar.block1.getName().contains(bl1));
+                            conn.addSignal(ar.getSignal2(i).toString(), ar.getSignal2(i).getInOut() == 0, !ar.block1.getName().contains(bl1));
                             //  System.out.println("adding signal " +ar.getSignal1(i).toBasicString());
                         }
                         //System.out.println("Added Signals");
@@ -9803,77 +9737,73 @@ public class GTURTLEModeling {
                   }*/
             }
         }
-        ypos+=100;
+        ypos += 100;
         //Add Pragmas
-        AvatarBDPragma pragma=new AvatarBDPragma(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, null,abd);
+        AvatarBDPragma pragma = new AvatarBDPragma(xpos, ypos, xpos, xpos * 2, ypos, ypos * 2, false, null, abd);
         //  String[] arr = new String[avspec.getPragmas().size()];
-        String s="";
+        String s = "";
         // int i=0;
-        for (AvatarPragma p: avspec.getPragmas()){
+        for (AvatarPragma p : avspec.getPragmas()) {
 
             //    arr[i] = p.getName();
-            String t= "";
+            String t = "";
             String[] split = p.getName().split(" ");
-            if (p.getName().contains("#Confidentiality")){
-                for (String str:split){
-                    if (str.contains(".")){
+            if (p.getName().contains("#Confidentiality")) {
+                for (String str : split) {
+                    if (str.contains(".")) {
                         String tmp = str.split("\\.")[0];
                         String tmp2 = str.split("\\.")[1];
-                        t=t.concat(tmp.split("__")[tmp.split("__").length-1] + "." + tmp2.split("__")[tmp2.split("__").length-1] + " ");
-                    }
-                    else {
-                        t=t.concat(str+" ");
+                        t = t.concat(tmp.split("__")[tmp.split("__").length - 1] + "." + tmp2.split("__")[tmp2.split("__").length - 1] + " ");
+                    } else {
+                        t = t.concat(str + " ");
                     }
                 }
+            } else if (p.getName().contains("Authenticity")) {
+                t = p.getName();
+            } else if (p.getName().contains("Initial")) {
+                t = p.getName();
+            } else {
+                t = p.getName();
             }
-            else if (p.getName().contains("Authenticity")){
-                t=p.getName();
-            }
-            else if (p.getName().contains("Initial")){
-                t=p.getName();
-            }
-            else {
-                t=p.getName();
-            }
-            s=s.concat(t+"\n");
+            s = s.concat(t + "\n");
             //  i++;
         }
         pragma.setValue(s);
         pragma.makeValue();
-        abd.addComponent(pragma, xpos, ypos, false,true);
+        abd.addComponent(pragma, xpos, ypos, false, true);
         //Add message and key datatype if there is a cryptoblock
 
-        xpos=50;
-        ypos+=200;
-        if (hasCrypto){
-            AvatarBDDataType message = new AvatarBDDataType(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, null,abd);
+        xpos = 50;
+        ypos += 200;
+        if (hasCrypto) {
+            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);
-            message.resize(200,100);
-            xpos+=400;
+            abd.addComponent(message, xpos, ypos, false, true);
+            message.resize(200, 100);
+            xpos += 400;
 
-            AvatarBDDataType key = new AvatarBDDataType(xpos, ypos, xpos, xpos*2, ypos, ypos*2, false, null,abd);
+            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);
-            key.resize(200,100);
-            abd.addComponent(key, xpos, ypos, false,true);
+            key.resize(200, 100);
+            abd.addComponent(key, xpos, ypos, false, true);
         }
     }
 
-    public void buildStateMachine(AvatarBlock ab, AvatarBDBlock bl, AvatarSMDPanel smp){
+    public void buildStateMachine(AvatarBlock ab, AvatarBDBlock bl, AvatarSMDPanel smp) {
         Map<AvatarTransition, TGComponent> tranSourceMap = new HashMap<AvatarTransition, TGComponent>();
         Map<AvatarTransition, AvatarStateMachineElement> tranDestMap = new HashMap<AvatarTransition, AvatarStateMachineElement>();
         Map<AvatarStateMachineElement, TGComponent> locMap = new HashMap<AvatarStateMachineElement, TGComponent>();
         Map<AvatarStateMachineElement, TGComponent> SMDMap = new HashMap<AvatarStateMachineElement, TGComponent>();
 
         //Build the state machine
-        int smx=400;
-        int smy=40;
+        int smx = 400;
+        int smy = 40;
 
-        if (smp==null){
+        if (smp == null) {
             System.out.println("can't find");
             return;
         }
@@ -9881,42 +9811,41 @@ public class GTURTLEModeling {
         AvatarStateMachine asm = ab.getStateMachine();
         //Remove the empty check states
 
-        AvatarStartState start= asm.getStartState();
+        AvatarStartState start = asm.getStartState();
         addStates(start, smx, smy, smp, bl, SMDMap, locMap, tranDestMap, tranSourceMap);
         //Add transitions
-        for (AvatarTransition t: tranSourceMap.keySet()){
-            if (tranSourceMap.get(t)==null || tranDestMap.get(t)==null){
+        for (AvatarTransition t : tranSourceMap.keySet()) {
+            if (tranSourceMap.get(t) == null || tranDestMap.get(t) == null) {
                 continue;
             }
-            int x=tranSourceMap.get(t).getX()+tranSourceMap.get(t).getWidth()/2;
-            int y=tranSourceMap.get(t).getY()+tranSourceMap.get(t).getHeight();
+            int x = tranSourceMap.get(t).getX() + tranSourceMap.get(t).getWidth() / 2;
+            int y = tranSourceMap.get(t).getY() + tranSourceMap.get(t).getHeight();
 
             //    TGConnectingPoint p1 = tranSourceMap.get(t).findFirstFreeTGConnectingPoint(true,false);
             TGConnectingPoint p1 = tranSourceMap.get(t).closerFreeTGConnectingPoint(x, y, true, false);
-            if (p1==null){
-                  p1= tranSourceMap.get(t).findFirstFreeTGConnectingPoint(true,true);
+            if (p1 == null) {
+                p1 = tranSourceMap.get(t).findFirstFreeTGConnectingPoint(true, true);
                 //p1=tranSourceMap.get(t).closerFreeTGConnectingPoint(x,y,true, true);
             }
-            x= locMap.get(tranDestMap.get(t)).getX()+ locMap.get(tranDestMap.get(t)).getWidth()/2;
+            x = locMap.get(tranDestMap.get(t)).getX() + locMap.get(tranDestMap.get(t)).getWidth() / 2;
             y = locMap.get(tranDestMap.get(t)).getY();
-            if (tranSourceMap.get(t).getY() > locMap.get(tranDestMap.get(t)).getY()){
-                y=locMap.get(tranDestMap.get(t)).getY()+locMap.get(tranDestMap.get(t)).getHeight()/2;
-                if (tranSourceMap.get(t).getX() < locMap.get(tranDestMap.get(t)).getX()){
+            if (tranSourceMap.get(t).getY() > locMap.get(tranDestMap.get(t)).getY()) {
+                y = locMap.get(tranDestMap.get(t)).getY() + locMap.get(tranDestMap.get(t)).getHeight() / 2;
+                if (tranSourceMap.get(t).getX() < locMap.get(tranDestMap.get(t)).getX()) {
                     x = locMap.get(tranDestMap.get(t)).getX();
-                }
-                else {
-                    x= locMap.get(tranDestMap.get(t)).getX()+locMap.get(tranDestMap.get(t)).getWidth();
+                } else {
+                    x = locMap.get(tranDestMap.get(t)).getX() + locMap.get(tranDestMap.get(t)).getWidth();
                 }
             }
-            TGConnectingPoint p2 = locMap.get(tranDestMap.get(t)).closerFreeTGConnectingPoint(x,y,false, true);
-            if (p2==null){
-                p2=locMap.get(tranDestMap.get(t)).closerFreeTGConnectingPoint(x,y,true, true);
+            TGConnectingPoint p2 = locMap.get(tranDestMap.get(t)).closerFreeTGConnectingPoint(x, y, false, true);
+            if (p2 == null) {
+                p2 = locMap.get(tranDestMap.get(t)).closerFreeTGConnectingPoint(x, y, true, true);
             }
             Vector<Point> points = new Vector<Point>();
-            if (p1==null || p2 ==null){
-                System.out.println(tranSourceMap.get(t)+" "+locMap.get(tranDestMap.get(t)));
+            if (p1 == null || p2 == null) {
+                System.out.println(tranSourceMap.get(t) + " " + locMap.get(tranDestMap.get(t)));
 
-                System.out.println("Missing point "+ p1 + " "+p2);
+                System.out.println("Missing point " + p1 + " " + p2);
                 return;
             }
             AvatarSMDConnector SMDcon = new AvatarSMDConnector(p1.getX(), p1.getY(), p1.getX(), p1.getY(), p1.getX(), p1.getY(), true, null, smp, p1, p2, points);
@@ -9924,16 +9853,15 @@ public class GTURTLEModeling {
             ///System.out.println("FREE " +p1.isFree() + " "+ p2.isFree());
             p1.setFree(false);
             p2.setFree(false);
-            String action="";
-            if (t.getActions().size()==0){
-                action="";
-            }
-            else {
-                action=t.getActions().get(0).toString().replaceAll(" ","");
+            String action = "";
+            if (t.getActions().size() == 0) {
+                action = "";
+            } else {
+                action = t.getActions().get(0).toString().replaceAll(" ", "");
             }
             SMDcon.setTransitionInfo(t.getGuard().toString(), action);
-            for (int i=1; i<t.getActions().size(); i++){
-                SMDcon.setTransitionInfo("", t.getActions().get(i).toString().replaceAll(" ",""));
+            for (int i = 1; i < t.getActions().size(); i++) {
+                SMDcon.setTransitionInfo("", t.getActions().get(i).toString().replaceAll(" ", ""));
             }
             smp.addComponent(SMDcon, p1.getX(), p1.getY(), false, true);
         }
@@ -9944,7 +9872,7 @@ public class GTURTLEModeling {
         rm = new RequirementModeling(reqs, rdp, mgui);
         checkingErrors = rm.getCheckingErrors();
         warnings = rm.getWarnings();
-        if ((checkingErrors != null) && (checkingErrors.size() > 0)){
+        if ((checkingErrors != null) && (checkingErrors.size() > 0)) {
             return false;
         } else {
             //mgui.setMode(mgui.GEN_DESIGN_OK);
@@ -9977,7 +9905,7 @@ public class GTURTLEModeling {
         CheckingError ce;
         TGComponent tgc;
 
-        for(int i=0; i<checkingErrors.size(); i++) {
+        for (int i = 0; i < checkingErrors.size(); i++) {
             ce = checkingErrors.get(i);
             if (ce != null && ce instanceof UICheckingError) {
                 tgc = ((UICheckingError) ce).getTGComponent();
@@ -9990,9 +9918,9 @@ public class GTURTLEModeling {
 
     private void analyzeErrorOnComponent(TGComponent _tgc) {
         if (_tgc instanceof BasicErrorHighlight) {
-            ((BasicErrorHighlight)_tgc).setStateAction(ErrorHighlight.UNKNOWN);
+            ((BasicErrorHighlight) _tgc).setStateAction(ErrorHighlight.UNKNOWN);
         } else if (_tgc instanceof ActionStateErrorHighlight) {
-            ((ActionStateErrorHighlight)_tgc).setStateAction(ErrorHighlight.UNKNOWN_AS);
+            ((ActionStateErrorHighlight) _tgc).setStateAction(ErrorHighlight.UNKNOWN_AS);
         }
     }
 
diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java
index 3a4d063ea6beb42e5fbe0124da84e126ed748526..260b9e2e5c5e3cc96e3805296ccfb5eb8970c4c8 100644
--- a/src/main/java/ui/MainGUI.java
+++ b/src/main/java/ui/MainGUI.java
@@ -37,8 +37,6 @@
  */
 
 
-
-
 package ui;
 
 import avatartranslator.AvatarSpecification;
@@ -54,7 +52,6 @@ import translator.CheckingError;
 import translator.MasterGateManager;
 import ui.ad.TActivityDiagramPanel;
 import ui.atd.AttackTreeDiagramPanel;
-import ui.ftd.FaultTreeDiagramPanel;
 import ui.avatarad.AvatarADPanel;
 import ui.avatarbd.AvatarBDLibraryFunction;
 import ui.avatarbd.AvatarBDPortConnector;
@@ -70,8 +67,10 @@ import ui.cd.TClassDiagramPanel;
 import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel;
 import ui.ebrdd.EBRDDPanel;
 import ui.file.*;
+import ui.ftd.FaultTreeDiagramPanel;
 import ui.graph.AUTGraph;
 import ui.graph.RG;
+import ui.het.CAMSBlockDiagramPanel;
 import ui.interactivesimulation.JFrameInteractiveSimulation;
 import ui.interactivesimulation.SimulationTransaction;
 import ui.iod.InteractionOverviewDiagramPanel;
@@ -85,10 +84,9 @@ import ui.tmlcd.TMLTaskDiagramPanel;
 import ui.tmlcompd.TMLCCompositeComponent;
 import ui.tmlcompd.TMLComponentTaskDiagramPanel;
 import ui.tmlcp.TMLCPPanel;
-import ui.tmldd.TMLArchiDiagramPanel;
 import ui.tmldd.TMLArchiCAMSNode;
+import ui.tmldd.TMLArchiDiagramPanel;
 import ui.tmlsd.TMLSDPanel;
-import ui.het.*;
 import ui.tree.DiagramTreeModel;
 import ui.tree.DiagramTreeRenderer;
 import ui.tree.JDiagramTree;
@@ -102,7 +100,6 @@ import javax.swing.*;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.filechooser.FileNameExtensionFilter;
-
 import java.awt.*;
 import java.awt.event.*;
 import java.awt.image.BufferedImage;
@@ -122,9 +119,10 @@ import java.util.concurrent.ConcurrentHashMap;
  * Version: 1.1 21/12/2003
  * Version: 1.2 29/09/2004
  * 26/11/2015 D. Genius added DDD
+ *
  * @author Ludovic APVRILLE
  */
-public  class MainGUI implements ActionListener, WindowListener, KeyListener, PeriodicBehavior {
+public class MainGUI implements ActionListener, WindowListener, KeyListener, PeriodicBehavior {
 
     public static boolean systemcOn;
     public static boolean lotosOn;
@@ -138,7 +136,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public static boolean experimentalOn;
     public static boolean avatarOnly;
     public static boolean turtleOn;
-    
+
     public boolean isxml = false;
 
     public final static int LOTOS = 0;
@@ -165,15 +163,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public DiagramTreeModel dtm;
 
     // Actions
-    public      TGUIAction [] actions;
-    public      MouseHandler mouseHandler;
-    public  KeyListener keyHandler;
+    public TGUIAction[] actions;
+    public MouseHandler mouseHandler;
+    public KeyListener keyHandler;
 
     // Validation
-    public LinkedList<TClassInterface> tclassesToValidate = new LinkedList<TClassInterface> ();
+    public LinkedList<TClassInterface> tclassesToValidate = new LinkedList<TClassInterface>();
 
     // Status bar
-    private     JLabel status;
+    private JLabel status;
 
     //Menubar
     private JMenuBarTurtle jmenubarturtle;
@@ -320,7 +318,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     private ArrayList<RunningInfo> runningIDs;
     private ArrayList<LoadInfo> loadIDs;
     private ConcurrentHashMap<Integer, ArrayList<SimulationTransaction>> transactionMap = new ConcurrentHashMap<Integer, ArrayList<SimulationTransaction>>();
-    private ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> latencyMap = new ConcurrentHashMap<Integer, ConcurrentHashMap<String,String>>();
+    private ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> latencyMap = new ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>>();
     private ConcurrentHashMap<String, String> statusMap = new ConcurrentHashMap<String, String>();
     private JFrameInteractiveSimulation jfis;
     private JFrameAvatarInteractiveSimulation jfais;
@@ -338,7 +336,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public MainGUI(boolean _turtleOn, boolean _systemcOn, boolean _lotosOn, boolean _proactiveOn, boolean _tpnOn, boolean _osOn, boolean _uppaalOn, boolean _ncOn, boolean _avatarOn, boolean _proverifOn, boolean
-                   _avatarOnly, boolean _experimental) {
+            _avatarOnly, boolean _experimental) {
         turtleOn = _turtleOn;
         systemcOn = _systemcOn;
         lotosOn = _lotosOn;
@@ -359,7 +357,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //PluginManager.pluginManager = new PluginManager();
 
     }
-    
+
     public void setKey(String _sk) {
         sk = _sk;
         RshClient.sk = sk;
@@ -368,9 +366,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public String getKey() {
         return sk;
     }
-    
+
     public File getDir() {
-    	return dir;
+        return dir;
     }
 
     public boolean isAvatarOn() {
@@ -397,7 +395,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         frame = new JFrame("TTool");
 
         frame.addWindowListener(this);
-        frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE );
+        frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
         frame.setIconImage(IconManager.img8);
 
         framePanel = frame.getContentPane();
@@ -502,7 +500,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         framePanel.add(mainBar, BorderLayout.NORTH);
 
         // Panels
-        panelForTab = new JPanel(); panelForTab.setLayout(new BorderLayout());
+        panelForTab = new JPanel();
+        panelForTab.setLayout(new BorderLayout());
         //panelForTree = new JPanel(); panelForTree.setLayout(new BorderLayout());
         // Tree
         dtree = new JDiagramTree(this);
@@ -541,7 +540,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void initActions() {
         actions = new TGUIAction[TGUIAction.NB_ACTION];
-        for(int i=0; i<TGUIAction.NB_ACTION; i++) {
+        for (int i = 0; i < TGUIAction.NB_ACTION; i++) {
             actions[i] = new TGUIAction(i);
             actions[i].addActionListener(this);
             //actions[i].addKeyListener(this);
@@ -564,33 +563,33 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         hasChanged = true;
         if (tdp != null) {
             switch (type) {
-            case -1:
-                // Structural change
-                break;
-            case TDiagramPanel.NEW_COMPONENT:
-                //TraceManager.addDev("New Component");
-                tdp.structureChanged();
-                break;
-            case TDiagramPanel.NEW_CONNECTOR:
-                //TraceManager.addDev("New Connector");
-                tdp.structureChanged();
-                break;
-            case TDiagramPanel.REMOVE_COMPONENT:
-                //TraceManager.addDev("Remove Component");
-                tdp.structureChanged();
-                break;
-            case TDiagramPanel.MOVE_CONNECTOR:
-                //TraceManager.addDev("Move Connector");
-                tdp.structureChanged();
-                break;
-            case TDiagramPanel.CHANGE_VALUE_COMPONENT:
-                //TraceManager.addDev("Value of component changed");
-                tdp.valueChanged();
-                break;
-            case TDiagramPanel.MOVE_COMPONENT:
-                //TraceManager.addDev("Component moved");
-                break;
-            default:
+                case -1:
+                    // Structural change
+                    break;
+                case TDiagramPanel.NEW_COMPONENT:
+                    //TraceManager.addDev("New Component");
+                    tdp.structureChanged();
+                    break;
+                case TDiagramPanel.NEW_CONNECTOR:
+                    //TraceManager.addDev("New Connector");
+                    tdp.structureChanged();
+                    break;
+                case TDiagramPanel.REMOVE_COMPONENT:
+                    //TraceManager.addDev("Remove Component");
+                    tdp.structureChanged();
+                    break;
+                case TDiagramPanel.MOVE_CONNECTOR:
+                    //TraceManager.addDev("Move Connector");
+                    tdp.structureChanged();
+                    break;
+                case TDiagramPanel.CHANGE_VALUE_COMPONENT:
+                    //TraceManager.addDev("Value of component changed");
+                    tdp.valueChanged();
+                    break;
+                case TDiagramPanel.MOVE_COMPONENT:
+                    //TraceManager.addDev("Component moved");
+                    break;
+                default:
 
             }
         }
@@ -608,12 +607,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void setMethodologicalMode(byte m) {
         methoMode = m;
-        switch(methoMode) {
-        case METHO_ANALYSIS:
-            break;
-        case METHO_DESIGN:
-            break;
-        default:
+        switch (methoMode) {
+            case METHO_ANALYSIS:
+                break;
+            case METHO_DESIGN:
+                break;
+            default:
         }
     }
 
@@ -624,13 +623,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     //@author: Huy TRUONG
-    public JToolBarMainTurtle getMainBar(){
+    public JToolBarMainTurtle getMainBar() {
         return this.mainBar;
     }
     //--
 
     public void activeActions(boolean b) {
-        for(int i=0; i<TGUIAction.NB_ACTION; i++) {
+        for (int i = 0; i < TGUIAction.NB_ACTION; i++) {
             actions[i].setEnabled(b);
         }
     }
@@ -652,7 +651,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TraceManager.addDev("Autosaving in " + fileSave.getAbsolutePath());
         status.setText("Autosaving in " + fileSave.getAbsolutePath());
 
-        if(checkFileForSave(fileSave)) {
+        if (checkFileForSave(fileSave)) {
             try {
                 String s = gtm.makeXMLFromTurtleModeling(-1);
                 FileOutputStream fos = new FileOutputStream(fileSave);
@@ -673,7 +672,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         Vector<Object> elements = new Vector<Object>();
 
         TURTLEPanel panel;
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             panel = tabs.get(i);
             panel.searchForText(text.toLowerCase(), elements);
         }
@@ -729,7 +728,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp = getCurrentTURTLEPanel();
 
         if (tp instanceof AvatarDesignPanel) {
-            return ((AvatarDesignPanel)tp).hasCheckableMasterMutex();
+            return ((AvatarDesignPanel) tp).hasCheckableMasterMutex();
         }
 
         return null;
@@ -739,14 +738,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp = getCurrentTURTLEPanel();
 
         if (tp instanceof AvatarDesignPanel) {
-            ((AvatarDesignPanel)tp).removeAllMutualExclusionWithMasterMutex();
+            ((AvatarDesignPanel) tp).removeAllMutualExclusionWithMasterMutex();
         }
 
     }
 
 
-
-
     private int addAnalysisPanel(String name, int index) {
         if (index == -1) {
             index = tabs.size();
@@ -768,7 +765,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             index = tabs.size();
         }
         TMLCommunicationPatternPanel tmlcpp = new TMLCommunicationPatternPanel(this);
-        tabs.add( index, tmlcpp ); // should look for the first
+        tabs.add(index, tmlcpp); // should look for the first
         //mainTabbedPane.addTab(name, IconManager.imgic17, ap.tabbedPane, "Opens analysis diagrams");
         mainTabbedPane.add(tmlcpp.tabbedPane, index);
         mainTabbedPane.setToolTipTextAt(index, "Open CP diagrams");
@@ -1057,15 +1054,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     //Return the list of all the TMLArchiDiagramPanels
-    public Vector<TMLArchiPanel> getTMLArchiDiagramPanels()     {
+    public Vector<TMLArchiPanel> getTMLArchiDiagramPanels() {
 
         Vector<TMLArchiPanel> panelsList = new Vector<TMLArchiPanel>();
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
-            if ( tp instanceof TMLArchiPanel) {
-                panelsList.add( (TMLArchiPanel) (tp) );
+            if (tp instanceof TMLArchiPanel) {
+                panelsList.add((TMLArchiPanel) (tp));
             }
         }
         return panelsList;
@@ -1075,32 +1072,38 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLDesignPanel) {
-                list.addAll(((TMLDesignPanel)tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
+                list.addAll(((TMLDesignPanel) tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
             }
         }
         return list;
     }
 
     public void expandToErrors() {
-	if (gtm != null) {
-	    gtm.expandToErrors();
-	}
+        if (gtm != null) {
+            gtm.expandToErrors();
+        }
+    }
+
+    public void expandToWarnings() {
+        if (gtm != null) {
+            gtm.expandToWarnings();
+        }
     }
-    
-    public Vector<String> getTMLTasks(){
+
+    public Vector<String> getTMLTasks() {
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLDesignPanel) {
-                list.addAll(((TMLDesignPanel)tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
+                list.addAll(((TMLDesignPanel) tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
             }
             if (tp instanceof TMLComponentDesignPanel) {
-                list.addAll(((TMLComponentDesignPanel)tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
+                list.addAll(((TMLComponentDesignPanel) tp).getAllTMLTaskNames(mainTabbedPane.getTitleAt(i)));
             }
         }
 
@@ -1111,10 +1114,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for( int i = 0; i < tabs.size(); i++ )  {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
-            if( tp instanceof TMLComponentDesignPanel ) {
-                list.addAll( ((TMLComponentDesignPanel)tp).getAllTMLTasksAttributes() );
+            if (tp instanceof TMLComponentDesignPanel) {
+                list.addAll(((TMLComponentDesignPanel) tp).getAllTMLTasksAttributes());
             }
         }
 
@@ -1125,10 +1128,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         ArrayList<TMLCommunicationPatternPanel> list = new ArrayList<TMLCommunicationPatternPanel>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
-            if( tp instanceof TMLCommunicationPatternPanel )    {
-                list.add( (TMLCommunicationPatternPanel) tp );
+            if (tp instanceof TMLCommunicationPatternPanel) {
+                list.add((TMLCommunicationPatternPanel) tp);
             }
         }
         return list;
@@ -1137,10 +1140,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void updateAllReferences() {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
-                ((TMLComponentDesignPanel)tp).tmlctdp.delayedLoad();
+                ((TMLComponentDesignPanel) tp).tmlctdp.delayedLoad();
                 //((TMLComponentDesignPanel)tp).tmlctdp.updatePorts();
             }
         }
@@ -1149,11 +1152,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void updateAllPorts() {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
                 //((TMLComponentDesignPanel)tp).tmlctdp.delayedLoad();
-                ((TMLComponentDesignPanel)tp).tmlctdp.updatePorts();
+                ((TMLComponentDesignPanel) tp).tmlctdp.updatePorts();
             }
         }
     }
@@ -1162,12 +1165,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLDesignPanel) {
-                list.addAll(((TMLDesignPanel)tp).getAllTMLCommunicationNames(mainTabbedPane.getTitleAt(i)));
+                list.addAll(((TMLDesignPanel) tp).getAllTMLCommunicationNames(mainTabbedPane.getTitleAt(i)));
             } else if (tp instanceof TMLComponentDesignPanel) {
-                list.addAll(((TMLComponentDesignPanel)tp).getAllTMLCommunicationNames(mainTabbedPane.getTitleAt(i)));
+                list.addAll(((TMLComponentDesignPanel) tp).getAllTMLCommunicationNames(mainTabbedPane.getTitleAt(i)));
             }
         }
         return list;
@@ -1177,13 +1180,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             /*if (tp instanceof TMLDesignPanel) {
               list.addAll(((TMLDesignPanel)tp).getAllTMLChannelNames( mainTabbedPane.getTitleAt(i)) );
               } else*/
-            if( tp instanceof TMLComponentDesignPanel ) {
-                list.addAll(((TMLComponentDesignPanel)tp).getAllTMLInputPorts( mainTabbedPane.getTitleAt(i)) );
+            if (tp instanceof TMLComponentDesignPanel) {
+                list.addAll(((TMLComponentDesignPanel) tp).getAllTMLInputPorts(mainTabbedPane.getTitleAt(i)));
             }
         }
         return list;
@@ -1193,12 +1196,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for( int i = 0; i < tabs.size(); i++ ) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
-            if ( tp instanceof TMLDesignPanel ) {
-                list.addAll( ( (TMLDesignPanel)tp ).getAllTMLEventNames( mainTabbedPane.getTitleAt(i) ) );
-            } else if ( tp instanceof TMLComponentDesignPanel ) {
-                list.addAll( ( (TMLComponentDesignPanel)tp ).getAllTMLEventNames( mainTabbedPane.getTitleAt(i) ) );
+            if (tp instanceof TMLDesignPanel) {
+                list.addAll(((TMLDesignPanel) tp).getAllTMLEventNames(mainTabbedPane.getTitleAt(i)));
+            } else if (tp instanceof TMLComponentDesignPanel) {
+                list.addAll(((TMLComponentDesignPanel) tp).getAllTMLEventNames(mainTabbedPane.getTitleAt(i)));
             }
         }
         return list;
@@ -1209,15 +1212,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         Vector<String> list = new Vector<String>();
         boolean b;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLDesignPanel) {
                 b = (mainTabbedPane.getTitleAt(i).compareTo(ref) == 0);
-                list.addAll(((TMLDesignPanel)tp).getAllNonMappedTMLTaskNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
+                list.addAll(((TMLDesignPanel) tp).getAllNonMappedTMLTaskNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
             }
             if (tp instanceof TMLComponentDesignPanel) {
                 b = (mainTabbedPane.getTitleAt(i).compareTo(ref) == 0);
-                list.addAll(((TMLComponentDesignPanel)tp).getAllNonMappedTMLPrimitiveComponentNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
+                list.addAll(((TMLComponentDesignPanel) tp).getAllNonMappedTMLPrimitiveComponentNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
             }
         }
 
@@ -1229,11 +1232,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         Vector<String> list = new Vector<String>();
         boolean b;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof AvatarDesignPanel) {
                 b = (mainTabbedPane.getTitleAt(i).compareTo(ref) == 0);
-                list.addAll(((AvatarDesignPanel)tp).getAllNonMappedAvatarBlockNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
+                list.addAll(((AvatarDesignPanel) tp).getAllNonMappedAvatarBlockNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
             }
         }
 
@@ -1245,11 +1248,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         Vector<String> list = new Vector<String>();
         boolean b;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof AvatarDesignPanel) {
                 b = (mainTabbedPane.getTitleAt(i).compareTo(ref) == 0);
-                list.addAll(((AvatarDesignPanel)tp).getAllNonMappedAvatarChannelNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
+                list.addAll(((AvatarDesignPanel) tp).getAllNonMappedAvatarChannelNames(mainTabbedPane.getTitleAt(i), tadp, b, name));
             }
         }
 
@@ -1261,11 +1264,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         Vector<String> list = new Vector<String>();
         // boolean b;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
-            if (tp instanceof TMLComponentDesignPanel)  {
-                if (((TMLComponentDesignPanel)tp).tmlctdp != tcdp) {
-                    list.addAll(((TMLComponentDesignPanel)tp).getAllCompositeComponent(mainTabbedPane.getTitleAt(i)));
+            if (tp instanceof TMLComponentDesignPanel) {
+                if (((TMLComponentDesignPanel) tp).tmlctdp != tcdp) {
+                    list.addAll(((TMLComponentDesignPanel) tp).getAllCompositeComponent(mainTabbedPane.getTitleAt(i)));
                 }
             }
         }
@@ -1505,22 +1508,21 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public void setIODName(int analysisIndex, String name) {
-        AnalysisPanel ap = (AnalysisPanel)(tabs.elementAt(analysisIndex));
+        AnalysisPanel ap = (AnalysisPanel) (tabs.elementAt(analysisIndex));
         ap.tabbedPane.setTitleAt(0, name);
     }
 
     public void setDeploymentName(int deploymentIndex, String name) {
-        DeploymentPanel dp = (DeploymentPanel)(tabs.elementAt(deploymentIndex));
+        DeploymentPanel dp = (DeploymentPanel) (tabs.elementAt(deploymentIndex));
         dp.tabbedPane.setTitleAt(0, name);
     }
 
     public void setNCName(int ncIndex, String name) {
-        NCPanel ncp = (NCPanel)(tabs.elementAt(ncIndex));
+        NCPanel ncp = (NCPanel) (tabs.elementAt(ncIndex));
         ncp.tabbedPane.setTitleAt(0, name);
     }
 
 
-
     // add main panel for editing TURTLE diagrams
     private void addTURTLEPanel() {
 
@@ -1544,11 +1546,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         mainTabbedPane.setOpaque(true);
 
         ChangeListener cl = new ChangeListener() {
-                @Override
-                public void stateChanged(ChangeEvent e){
-                    paneAction(e);
-                }
-            };
+            @Override
+            public void stateChanged(ChangeEvent e) {
+                paneAction(e);
+            }
+        };
 
         mainTabbedPane.addChangeListener(cl);
         panelForTab.add(mainTabbedPane, BorderLayout.CENTER);
@@ -1565,15 +1567,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void firstDiag() {
 
-	TURTLEPanel tp = getCurrentTURTLEPanel();
-	if (tp == null) {
-	    return;
-	}
-	tp.tabbedPane.setSelectedIndex(0);
+        TURTLEPanel tp = getCurrentTURTLEPanel();
+        if (tp == null) {
+            return;
+        }
+        tp.tabbedPane.setSelectedIndex(0);
     }
+
     public String getTitleOf(TDiagramPanel _tdp) {
         TURTLEPanel panel;
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             panel = tabs.get(i);
             if (panel.hasTDiagramPanel(_tdp)) {
                 return getTitleAt(panel);
@@ -1595,7 +1598,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public TURTLEPanel getTURTLEPanel(String s) {
-        for(int i=0; i<mainTabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < mainTabbedPane.getTabCount(); i++) {
             if (mainTabbedPane.getTitleAt(i).compareTo(s) == 0) {
                 return tabs.elementAt(i);
             }
@@ -1605,13 +1608,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void drawAvatarSpecification(AvatarSpecification av) {
         int index = createAvatarDesign("GeneratedDesign");
-        AvatarDesignPanel adp = (AvatarDesignPanel)(tabs.elementAt(index));
+        AvatarDesignPanel adp = (AvatarDesignPanel) (tabs.elementAt(index));
         gtm.drawPanel(av, adp);
     }
 
 
     // Creates the status bar.
-    private     JLabel createStatusBar()  {
+    private JLabel createStatusBar() {
         status = new JLabel("Ready...");
         status.setBorder(BorderFactory.createEtchedBorder());
         return status;
@@ -1619,7 +1622,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void activate(JMenu jm, boolean b) {
         JMenuItem im;
-        for(int i=0; i<jm.getItemCount(); i++) {
+        for (int i = 0; i < jm.getItemCount(); i++) {
             im = jm.getItem(i);
             if (im != null)
                 im.setEnabled(b);
@@ -1661,7 +1664,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         frame.setVisible(true);
     }
 
-    public void newTurtleModeling()     {
+    public void newTurtleModeling() {
         setMode(OPENED);
         addTURTLEPanel();
         gtm = new GTURTLEModeling(this, tabs);
@@ -1674,7 +1677,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             setMode(NOT_OPENED);
 
             // tabbed pane
-            for(int i=0; i<tabs.size(); i++) {
+            for (int i = 0; i < tabs.size(); i++) {
                 tabs.elementAt(i).tabbedPane.removeAll();
             }
 
@@ -1684,10 +1687,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             activetdp = null;
 
             gtm = null;
-            tclassesToValidate = new LinkedList<TClassInterface> ();
+            tclassesToValidate = new LinkedList<TClassInterface>();
             MasterGateManager.reinitNameRestriction();
 
-            typeButtonSelected = - 1;
+            typeButtonSelected = -1;
             idButtonSelected = -1;
             pluginSelected = null;
 
@@ -1702,7 +1705,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void setStatusBarText(String s) {
         // captitalizeFirstLetter
-        if (s == null)  {
+        if (s == null) {
             return;
         }
 
@@ -1725,8 +1728,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newDesign() {
         //TraceManager.addDev("NEW DESIGN");
         addDesignPanel("Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1734,8 +1737,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newDeployment() {
         //TraceManager.addDev("NEW DESIGN");
         addDeploymentPanel("Deployment", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1771,8 +1774,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newTMLDesign() {
         //TraceManager.addDev("NEW DESIGN");
         addTMLDesignPanel("DIPLODOCUS_Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1780,8 +1783,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newDiplodocusMethodology() {
         //TraceManager.addDev("NEW DESIGN");
         addDiplodocusMethodologyPanel("DIPLODOCUS_Methodology", -1, true);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1789,8 +1792,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newAvatarMethodology() {
         //TraceManager.addDev("NEW DESIGN");
         addAvatarMethodologyPanel("AVATAR_Methodology", -1, true);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1798,8 +1801,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newSysmlsecMethodology() {
         //TraceManager.addDev("NEW DESIGN");
         addSysmlsecMethodologyPanel("SysMLSec_Methodology", -1, true);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1807,8 +1810,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newTMLComponentDesign() {
         //TraceManager.addDev("NEW DESIGN");
         addTMLComponentDesignPanel("DIPLODOCUS_C_Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1825,8 +1828,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newTMLArchi() {
         //TraceManager.addDev("NEW DIPLO Architecture");
         addTMLArchiPanel("Architecture", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1834,8 +1837,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newSystemCAMS() {//ajout CD
         //TraceManager.addDev("NEW DIPLO Architecture");
         addSystemCAMSPanel("SystemC-AMS", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1843,8 +1846,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newADD() {
         //TraceManager.addDev("NEW Avatar deployment");
         addADDPanel("Deployment", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();
     }
@@ -1852,22 +1855,22 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void newTURTLEOSDesign() {
         //TraceManager.addDev("NEW DESIGN");
         addTURTLEOSDesignPanel("TURTLE-OS Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
     }
 
     public void newNCDesign() {
         //TraceManager.addDev("NEW NC DESIGN");
         addNCDesignPanel("NC Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
     }
 
     public void newAvatarBD() {
         //TraceManager.addDev("NEW AVATAR BD");
         addAvatarDesignPanel("Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
     }
 
     public void newAvatarRequirement() {
@@ -1886,9 +1889,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void newProactiveDesign() {
         //TraceManager.addDev("NEW DESIGN");
-        /*int index = */addProActiveDesignPanel("ProActive Design", -1);
-        tabs.elementAt(tabs.size()-1).tabbedPane.setSelectedIndex(0);
-        mainTabbedPane.setSelectedIndex(tabs.size()-1);
+        /*int index = */
+        addProActiveDesignPanel("ProActive Design", -1);
+        tabs.elementAt(tabs.size() - 1).tabbedPane.setSelectedIndex(0);
+        mainTabbedPane.setSelectedIndex(tabs.size() - 1);
         //paneAction(null);
         //frame.repaint();*/
     }
@@ -1969,14 +1973,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             frame.setTitle("TTool: unsaved project");
         }
     }
-    
+
     public void newProjectDir() {
-    	if (mode == NOT_OPENED) {
-    		int val = createFileDialog();
-    		if (val == JFileChooser.APPROVE_OPTION) 
-    			createFile();      
-        }
-        else {
+        if (mode == NOT_OPENED) {
+            int val = createFileDialog();
+            if (val == JFileChooser.APPROVE_OPTION)
+                createFile();
+        } else {
             //  check if previous modeling is saved
             boolean b = actions[TGUIAction.ACT_SAVE].isEnabled();
             if (b) {
@@ -1990,44 +1993,44 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             }
             int val = createFileDialog();
             if (val == JFileChooser.APPROVE_OPTION) {
-            // close current modeling
-            	closeTurtleModeling();
-            	createFile();
+                // close current modeling
+                closeTurtleModeling();
+                createFile();
             }
         }
     }
-    
+
     public void saveConfig() {
         int i = 0;
         for (; i < tabs.size(); i++) {
-        	if (tabs.get(i) == activetdp.tp)
-        		break;
+            if (tabs.get(i) == activetdp.tp)
+                break;
         }
         int j = tabs.get(i).getIndexOfChild(activetdp);
         SpecConfigTTool.lastTab = i;
         SpecConfigTTool.lastPanel = j;
         try {
-			SpecConfigTTool.saveConfiguration(config);
-			SpecConfigTTool.lastPanel = -1;
-			SpecConfigTTool.lastTab = -1;
-		} catch (MalformedConfigurationException e) {
-			System.err.println(e.getMessage() + " : Can't save config file.");
-		}
-    }
-    
+            SpecConfigTTool.saveConfiguration(config);
+            SpecConfigTTool.lastPanel = -1;
+            SpecConfigTTool.lastTab = -1;
+        } catch (MalformedConfigurationException e) {
+            System.err.println(e.getMessage() + " : Can't save config file.");
+        }
+    }
+
     public String loadFile(File f) {
         String s = null;
 
-        if(checkFileForOpen(f)) {
+        if (checkFileForOpen(f)) {
             try {
                 FileInputStream fis = new FileInputStream(f);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
             } catch (OutOfMemoryError er) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + er.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
@@ -2037,7 +2040,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public void saveFile(File f, String data, String msg) {
-        if(checkFileForSave(f)) {
+        if (checkFileForSave(f)) {
             try {
                 if (data == null) {
                     return;
@@ -2047,7 +2050,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 fos.close();
                 JOptionPane.showMessageDialog(frame, msg + " " + f.getAbsolutePath(), "Saving", JOptionPane.INFORMATION_MESSAGE);
                 return;
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be saved because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
@@ -2058,7 +2061,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         File libfile;
 
         int returnVal = jfclib.showDialog(frame, "Import library");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return null;
         }
 
@@ -2072,7 +2075,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         File lotfile;
 
         int returnVal = jfclot.showDialog(frame, "Load RT-LOTOS specification");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return null;
         }
 
@@ -2084,7 +2087,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
 
-        String [] ret = new String[2];
+        String[] ret = new String[2];
         ret[0] = lotfile.getName();
         ret[1] = spec;
         return ret;
@@ -2094,7 +2097,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         File lotfile;
 
         int returnVal = jfclot.showDialog(frame, "Save RT-LOTOS specification");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2113,7 +2116,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfctgraph.setCurrentDirectory(new File(SpecConfigTTool.TGraphPath));
 
         int returnVal = jfctgraph.showDialog(frame, "Save last DTA (textual form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2124,7 +2127,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         /* graphical form */
         returnVal = jfcggraph.showDialog(frame, "Save last DTA (graphical form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2137,13 +2140,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public String saveTPNNDRFormat(String tpn) {
         String s = file.getAbsolutePath();
         int l = s.length();
-        String myFile = s.substring(0, l-4) + ".ndr";
+        String myFile = s.substring(0, l - 4) + ".ndr";
         try {
             FileUtils.saveFile(myFile, tpn);
         } catch (Exception e) {
-            return "TPN could not be saved in myFile: " +e.getMessage();
+            return "TPN could not be saved in myFile: " + e.getMessage();
         }
-        return "TPN saved in " +myFile;
+        return "TPN saved in " + myFile;
     }
 
     public void saveRG(String tdata, String gdata) {
@@ -2155,7 +2158,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfctgraph.setCurrentDirectory(new File(SpecConfigTTool.TGraphPath));
 
         int returnVal = jfctgraph.showDialog(frame, "Save last RG (textual form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2166,7 +2169,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         /* graphical form */
         returnVal = jfcggraph.showDialog(frame, "Save last RG (graphical form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2184,7 +2187,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfctgraph.setFileFilter(filter);
 
         int returnVal = jfctgraph.showDialog(frame, "Save last TLSA (textual form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2195,7 +2198,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         /* graphical form */
         returnVal = jfcggraph.showDialog(frame, "Save last TLSA (graphical form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2213,7 +2216,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfctgraph.setFileFilter(filter);
 
         int returnVal = jfctgraph.showDialog(frame, "Save last RG/AUT (textual form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2224,7 +2227,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         /* graphical form */
         returnVal = jfcggraph.showDialog(frame, "Save last RG/AUT (graphical form)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
@@ -2235,12 +2238,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
 
-
     public String[] loadGGraph() {
         File gfile;
 
         int returnVal = jfcggraph.showDialog(frame, "Load Graph (DOT format)");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return null;
         }
 
@@ -2252,7 +2254,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
 
-        String [] ret = new String[2];
+        String[] ret = new String[2];
         ret[0] = gfile.getName();
         ret[1] = spec;
         return ret;
@@ -2265,7 +2267,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 return null;
             }
 
-            String [] ret = new String[2];
+            String[] ret = new String[2];
             ret[0] = name;
             ret[1] = spec;
             return ret;
@@ -2283,7 +2285,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfctgraph.setCurrentDirectory(new File(SpecConfigTTool.TGraphPath));
 
         int returnVal = jfctgraph.showDialog(frame, "Load AUT graph");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return null;
         }
 
@@ -2295,46 +2297,46 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
 
-        String [] ret = new String[2];
+        String[] ret = new String[2];
         ret[0] = autfile.getName();
         ret[1] = spec;
         return ret;
     }
-    
+
     public void loadAUTGraphsDir() {
         File dir = new File(SpecConfigTTool.TGraphPath);
         if (!dir.exists()) {
-        	System.err.println("Graphs directory doesn't exists !");
-        	return;
+            System.err.println("Graphs directory doesn't exists !");
+            return;
         }
-        
-        for (File autfile: dir.listFiles()) {
-        	if (!FileUtils.getExtension(autfile).equals("aut"))
-        		continue;
-        	
-        	String spec = loadFile(autfile);
-        	if (spec == null) {
-        		continue;
-        	}
 
-        	RG rg = new RG(autfile.getName());
-        	rg.fileName = autfile.getName();
-        	rg.data = spec;
-        	addRG(rg);
+        for (File autfile : dir.listFiles()) {
+            if (!FileUtils.getExtension(autfile).equals("aut"))
+                continue;
+
+            String spec = loadFile(autfile);
+            if (spec == null) {
+                continue;
+            }
+
+            RG rg = new RG(autfile.getName());
+            rg.fileName = autfile.getName();
+            rg.data = spec;
+            addRG(rg);
         }
-        
+
     }
 
     public void updateLastOpenFile(File file) {
         if (ConfigurationTTool.LastOpenFileDefined) {
             ConfigurationTTool.LastOpenFile = file.getPath();
             if (ConfigurationTTool.LastOpenFile.contains(".ttool" + File.separator)) {
-            	int last = 0;
-            	for (int i = 0;i < ConfigurationTTool.LastOpenFile.length(); i++) {
-            		if (ConfigurationTTool.LastOpenFile.charAt(i) == '/')
-            			last = i;
-            	}
-            	ConfigurationTTool.LastOpenFile = ConfigurationTTool.LastOpenFile.substring(0, last);
+                int last = 0;
+                for (int i = 0; i < ConfigurationTTool.LastOpenFile.length(); i++) {
+                    if (ConfigurationTTool.LastOpenFile.charAt(i) == '/')
+                        last = i;
+                }
+                ConfigurationTTool.LastOpenFile = ConfigurationTTool.LastOpenFile.substring(0, last);
             }
             // Change name of action
             actions[TGUIAction.ACT_OPEN_LAST].setName(TGUIAction.ACT_OPEN_LAST, ConfigurationTTool.LastOpenFile);
@@ -2353,16 +2355,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         String s = null;
         String oldmodeling = gtm.makeXMLFromTurtleModeling(-1);
-        if(checkFileForOpen(filetmp)) {
+        if (checkFileForOpen(filetmp)) {
             try {
                 FileInputStream fis = new FileInputStream(filetmp);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
@@ -2375,7 +2377,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             //TraceManager.addDev("Loading");
             // load the new TURTLE modeling
             // Issue #41: Moved to common method
-            loadModels( gtm.mergeTURTLEGModeling(oldmodeling, s),  "merged" );
+            loadModels(gtm.mergeTURTLEGModeling(oldmodeling, s), "merged");
             //            try {
             //                //TraceManager.addDev("Merging");
             //                gtm.enableUndo(false);
@@ -2416,8 +2418,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public void openProject(boolean isProject) {
-    	if (config != null && activetdp != null)
-			saveConfig();
+        if (config != null && activetdp != null)
+            saveConfig();
         // check if a current modeling is opened
         boolean b = actions[TGUIAction.ACT_SAVE].isEnabled();
 
@@ -2433,12 +2435,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         //jfc.setApproveButtonText("Open");
         if (isProject) {
-        	jfc.resetChoosableFileFilters();
-        	jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-        	jfc.setAcceptAllFileFilterUsed(false);
-        	FileNameExtensionFilter filter = new FileNameExtensionFilter("TTool project", "ttool");
-        	jfc.setFileFilter(filter);
-        	/*jfc.addMouseListener(new MouseListener() {
+            jfc.resetChoosableFileFilters();
+            jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+            jfc.setAcceptAllFileFilterUsed(false);
+            FileNameExtensionFilter filter = new FileNameExtensionFilter("TTool project", "ttool");
+            jfc.setFileFilter(filter);
+            /*jfc.addMouseListener(new MouseListener() {
 
         	    @Override
         	    public void mouseClicked(MouseEvent arg0) {
@@ -2479,13 +2481,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 					return;
 				}		
         	});*/
-        }
-        else {
-        	jfc.resetChoosableFileFilters();
-        	jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);
-        	jfc.setAcceptAllFileFilterUsed(false);
-        	FileNameExtensionFilter filter = new FileNameExtensionFilter("XML files", "xml");
-        	jfc.setFileFilter(filter);
+        } else {
+            jfc.resetChoosableFileFilters();
+            jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);
+            jfc.setAcceptAllFileFilterUsed(false);
+            FileNameExtensionFilter filter = new FileNameExtensionFilter("XML files", "xml");
+            jfc.setFileFilter(filter);
         	/*jfc.addMouseListener(new MouseListener() {
 
         	    @Override
@@ -2539,37 +2540,36 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public void openProjectFromFile(File _f) {
-    	if (FileUtils.getExtension(_f).equals("ttool")) {
-    		dir = _f;
-    		SpecConfigTTool.setDirConfig(dir);
-    		String filename = dir.getAbsolutePath() + "/" + dir.getName().replaceAll(".ttool", ".xml");
-    		file = new File(filename);
-    		config = new File(dir.getAbsolutePath() + "/project_config.xml");
-    		try {
-				SpecConfigTTool.loadConfigFile(config);
-			} catch (MalformedConfigurationException e) {
-				System.err.println(e.getMessage() + " : Can't load config file.");
-			}
-    	}
-    	else {
-    		dir = null;
-    		config = null;
-    		SpecConfigTTool.setBasicConfig(systemcOn);
-    		file = _f;
-    	}
-        
-    	if(checkFileForOpen(file)) {
+        if (FileUtils.getExtension(_f).equals("ttool")) {
+            dir = _f;
+            SpecConfigTTool.setDirConfig(dir);
+            String filename = dir.getAbsolutePath() + "/" + dir.getName().replaceAll(".ttool", ".xml");
+            file = new File(filename);
+            config = new File(dir.getAbsolutePath() + "/project_config.xml");
+            try {
+                SpecConfigTTool.loadConfigFile(config);
+            } catch (MalformedConfigurationException e) {
+                System.err.println(e.getMessage() + " : Can't load config file.");
+            }
+        } else {
+            dir = null;
+            config = null;
+            SpecConfigTTool.setBasicConfig(systemcOn);
+            file = _f;
+        }
+
+        if (checkFileForOpen(file)) {
             String s = null;
 
             try {
                 FileInputStream fis = new FileInputStream(file);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
@@ -2586,7 +2586,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             updateLastOpenFile(file);
 
             // Issue #41: Moved to common method
-            loadModels( s, "loaded" );
+            loadModels(s, "loaded");
             //            // load the new TURTLE modeling
             //            try {
             //                gtm.loadModelingFromXML(s);
@@ -2607,7 +2607,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             //            gtm.saveOperation(getCurrentSelectedPoint());
             //            dtree.forceUpdate();
             if (getCurrentTDiagramPanel() != null)
-              getCurrentTDiagramPanel().repaint();
+                getCurrentTDiagramPanel().repaint();
         }
     }
 
@@ -2622,45 +2622,44 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         file = new File(ConfigurationTTool.LastOpenFile);
 
-        if(checkFileForOpen(file)) {
+        if (checkFileForOpen(file)) {
             String s = null;
-            
+
             if (FileUtils.getExtension(file).equals("ttool")) {
-            	int last = 0;
-            	for (int i = 0;i < ConfigurationTTool.LastOpenFile.length(); i++) {
-            		if (ConfigurationTTool.LastOpenFile.charAt(i) == '/')
-            			last = i;
-            	}
-            	dir = file;
-            	String xml = ConfigurationTTool.LastOpenFile.substring(last, ConfigurationTTool.LastOpenFile.length()).replaceAll(".ttool", ".xml");
-            	file = new File(dir.getAbsolutePath() + File.separator + xml);
-            	SpecConfigTTool.setDirConfig(dir);
-            	config = new File(dir.getAbsolutePath() + "/project_config.xml");
-            	try {
-    				SpecConfigTTool.loadConfigFile(config);
-    			} catch (MalformedConfigurationException e) {
-    				System.err.println(e.getMessage() + " : Can't load config file.");
-    			}
-            }
-            else {
-            	dir = null;
-            	config = null;
-            	SpecConfigTTool.setBasicConfig(systemcOn);
+                int last = 0;
+                for (int i = 0; i < ConfigurationTTool.LastOpenFile.length(); i++) {
+                    if (ConfigurationTTool.LastOpenFile.charAt(i) == '/')
+                        last = i;
+                }
+                dir = file;
+                String xml = ConfigurationTTool.LastOpenFile.substring(last, ConfigurationTTool.LastOpenFile.length()).replaceAll(".ttool", ".xml");
+                file = new File(dir.getAbsolutePath() + File.separator + xml);
+                SpecConfigTTool.setDirConfig(dir);
+                config = new File(dir.getAbsolutePath() + "/project_config.xml");
+                try {
+                    SpecConfigTTool.loadConfigFile(config);
+                } catch (MalformedConfigurationException e) {
+                    System.err.println(e.getMessage() + " : Can't load config file.");
+                }
+            } else {
+                dir = null;
+                config = null;
+                SpecConfigTTool.setBasicConfig(systemcOn);
             }
 
             try {
                 FileInputStream fis = new FileInputStream(file);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
-            
+
             // close current modeling
             closeTurtleModeling();
 
@@ -2670,7 +2669,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             gtm.enableUndo(false);
 
             // Issue #41: Moved to common method
-            loadModels( s, "loaded" );
+            loadModels(s, "loaded");
             //TraceManager.addDev("Loading");
             // load the new TURTLE modeling
             //            try {
@@ -2699,25 +2698,24 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //
     }
 
-    private void loadModels(    final String xmlModel,
-                                final String actionMessage ) {
+    private void loadModels(final String xmlModel,
+                            final String actionMessage) {
         gtm.enableUndo(false);
 
         // load the new TURTLE modeling
         try {
-            gtm.loadModelingFromXML( xmlModel );
+            gtm.loadModelingFromXML(xmlModel);
             frame.setTitle("TTool: " + file.getAbsolutePath());
             makeLotosFile();
 
             // Issue #41: Reselect the last tab
-            mainTabbedPane.setSelectedIndex( mainTabbedPane.getTabCount() - 1 );
+            mainTabbedPane.setSelectedIndex(mainTabbedPane.getTabCount() - 1);
 
             if (gtm.getCheckingErrors().size() > 0) {
                 JOptionPane.showMessageDialog(frame, "Modeling could not be correctly " + actionMessage, "Error when loading modeling", JOptionPane.INFORMATION_MESSAGE);
 
             }
-        }
-        catch (MalformedModelingException mme) {
+        } catch (MalformedModelingException mme) {
             JOptionPane.showMessageDialog(frame, "Modeling could not be correctly " + actionMessage, "Error when loading modeling", JOptionPane.INFORMATION_MESSAGE);
             frame.setTitle("TToolt: unnamed project");
         }
@@ -2726,28 +2724,28 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         gtm.saveOperation(getCurrentSelectedPoint());
         dtree.forceUpdate();
         if (SpecConfigTTool.lastTab > -1 && SpecConfigTTool.lastPanel > -1 && mainTabbedPane.getTabCount() > 0) {
-        	mainTabbedPane.setSelectedIndex(SpecConfigTTool.lastTab);
-        	activetdp = tabs.get(SpecConfigTTool.lastTab).getPanels().elementAt(SpecConfigTTool.lastPanel);
-        	activetdp.selectTab(activetdp.name);
-        	basicActivateDrawing();
+            mainTabbedPane.setSelectedIndex(SpecConfigTTool.lastTab);
+            activetdp = tabs.get(SpecConfigTTool.lastTab).getPanels().elementAt(SpecConfigTTool.lastPanel);
+            activetdp.selectTab(activetdp.name);
+            basicActivateDrawing();
         }
-        
+
         if (dir != null)
-        	loadAUTGraphsDir();
+            loadAUTGraphsDir();
     }
 
     public void saveAsLibrary(String data) {
         File libfile;
 
         int returnVal = jfclib.showDialog(frame, "Export library");
-        if(returnVal != JFileChooser.APPROVE_OPTION) {
+        if (returnVal != JFileChooser.APPROVE_OPTION) {
             return;
         }
 
         libfile = jfclib.getSelectedFile();
         libfile = FileUtils.addFileExtensionIfMissing(libfile, TLibFilter.getExtension());
 
-        if(checkFileForSave(libfile)) {
+        if (checkFileForSave(libfile)) {
             try {
                 if (data == null) {
                     throw new Exception("Selected data corrupted");
@@ -2757,7 +2755,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 fos.close();
                 JOptionPane.showMessageDialog(frame, "Modeling was correctly saved under a TURTLE library named " + libfile.getName(), "Saving", JOptionPane.INFORMATION_MESSAGE);
                 return;
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be saved because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
@@ -2783,12 +2781,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean saveTIF() {
         int returnVal = jfctif.showSaveDialog(frame);
-        if(returnVal == JFileChooser.APPROVE_OPTION) {
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
             file = jfctif.getSelectedFile();
             file = FileUtils.addFileExtensionIfMissing(file, TTIFFilter.getExtension());
         }
 
-        if(checkFileForSave(file)) {
+        if (checkFileForSave(file)) {
             String s = gtm.saveTIF();
             try {
 
@@ -2818,16 +2816,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         String s = null;
-        if(checkFileForOpen(file)) {
+        if (checkFileForOpen(file)) {
             try {
                 FileInputStream fis = new FileInputStream(file);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return false;
             }
@@ -2852,16 +2850,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         String s = null;
-        if(checkFileForOpen(file)) {
+        if (checkFileForOpen(file)) {
             try {
                 FileInputStream fis = new FileInputStream(file);
                 int nb = fis.available();
 
-                byte [] ba = new byte[nb];
+                byte[] ba = new byte[nb];
                 fis.read(ba);
                 fis.close();
                 s = new String(ba);
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be opened because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return false;
             }
@@ -2878,69 +2876,68 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     private int createFileDialog() {
-    	int returnVal = jfc.showSaveDialog(frame);
-        if(returnVal == JFileChooser.APPROVE_OPTION) {
-        	dir = jfc.getSelectedFile();
-        	dir = FileUtils.addFileExtensionIfMissing(dir, "ttool");
-        	dir.mkdir();
-        	SpecConfigTTool.setDirConfig(dir);
-        	config = SpecConfigTTool.createProjectConfig(dir);
-        	try {
-				SpecConfigTTool.loadConfigFile(config);
-			} catch (MalformedConfigurationException e) {
-				System.err.println(e.getMessage() + " : Can't load config file.");
-			}
-        	String newname = FileUtils.removeFileExtension(dir.getName());
+        int returnVal = jfc.showSaveDialog(frame);
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            dir = jfc.getSelectedFile();
+            dir = FileUtils.addFileExtensionIfMissing(dir, "ttool");
+            dir.mkdir();
+            SpecConfigTTool.setDirConfig(dir);
+            config = SpecConfigTTool.createProjectConfig(dir);
+            try {
+                SpecConfigTTool.loadConfigFile(config);
+            } catch (MalformedConfigurationException e) {
+                System.err.println(e.getMessage() + " : Can't load config file.");
+            }
+            String newname = FileUtils.removeFileExtension(dir.getName());
             file = new File(dir, newname);
             file = FileUtils.addFileExtensionIfMissing(file, TFileFilter.getExtension());
         }
-        
+
         return returnVal;
     }
-    
+
     private void createFile() {
         newTurtleModeling();
-    	frame.setTitle(file.getName());
-    	try {
-    		if (gtm == null) {
-    			throw new Exception("Internal model Error 1");
-    		}
-    		String s = gtm.makeXMLFromTurtleModeling(-1);
-    		if (s == null) {
-    			throw new Exception("Internal model Error 2");
-    		}
-    		FileOutputStream fos = new FileOutputStream(file);
-    		fos.write(s.getBytes());
-    		fos.close();
-    		updateLastOpenFile(file);
-    		setMode(MODEL_SAVED);
-    		String title = "TTool: " + file.getAbsolutePath();
-    		if (!frame.getTitle().equals(title)) {
-    			frame.setTitle(title);
-    		}
-    		if (lotosfile == null) {
-    			makeLotosFile();
-    		}
-    	}
-        catch(Exception e) {
+        frame.setTitle(file.getName());
+        try {
+            if (gtm == null) {
+                throw new Exception("Internal model Error 1");
+            }
+            String s = gtm.makeXMLFromTurtleModeling(-1);
+            if (s == null) {
+                throw new Exception("Internal model Error 2");
+            }
+            FileOutputStream fos = new FileOutputStream(file);
+            fos.write(s.getBytes());
+            fos.close();
+            updateLastOpenFile(file);
+            setMode(MODEL_SAVED);
+            String title = "TTool: " + file.getAbsolutePath();
+            if (!frame.getTitle().equals(title)) {
+                frame.setTitle(title);
+            }
+            if (lotosfile == null) {
+                makeLotosFile();
+            }
+        } catch (Exception e) {
             JOptionPane.showMessageDialog(frame, "File could not be saved because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
         }
     }
-    	
+
     protected boolean saveProject() {
         if (file == null) {
-        	if (dir != null)
-        		createFileDialog();
-        	else {
-        		int returnVal = jfc.showSaveDialog(frame);
-                if(returnVal == JFileChooser.APPROVE_OPTION) {
+            if (dir != null)
+                createFileDialog();
+            else {
+                int returnVal = jfc.showSaveDialog(frame);
+                if (returnVal == JFileChooser.APPROVE_OPTION) {
                     file = jfc.getSelectedFile();
                     file = FileUtils.addFileExtensionIfMissing(file, TFileFilter.getExtension());
                 }
-        	}
+            }
         }
 
-        if( checkFileForSave(file)) {
+        if (checkFileForSave(file)) {
             try {
                 if (gtm == null) {
                     throw new Exception("Internal model Error 1");
@@ -2962,7 +2959,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     makeLotosFile();
                 }
                 return true;
-            } catch(Exception e) {
+            } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame, "File could not be saved because " + e.getMessage(), "File Error", JOptionPane.INFORMATION_MESSAGE);
                 return false;
             }
@@ -2983,11 +2980,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         try {
             if (file != null) {
                 if (!file.exists()) {
-                    pb  = "File " + file + " doesn't exist";
+                    pb = "File " + file + " doesn't exist";
                     ok = false;
                 }
                 if ((ok == true) && (!file.canRead())) {
-                    pb  = "File is read protected";
+                    pb = "File is read protected";
                     ok = false;
                 }
             }
@@ -3014,11 +3011,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             if (file != null) {
                 if (!file.exists()) {
                     if (!file.createNewFile()) {
-                        pb  = "File could not be created";
+                        pb = "File could not be created";
                         ok = false;
                     }
                     if (!file.canWrite()) {
-                        pb  = "File is write protected";
+                        pb = "File is write protected";
                         ok = false;
                     }
                 }
@@ -3080,7 +3077,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void makeLotosFile() {
         String s = file.getAbsolutePath();
         int l = s.length();
-        String myFile = s.substring(0, l-4);
+        String myFile = s.substring(0, l - 4);
         lotosfile = new File(myFile + ".lot");
         simfile = new File(myFile + ".sim");
         dtafile = new File(myFile + ".dta");
@@ -3099,16 +3096,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     /**
      * Display "Modeling has not been saved" window
-     * @author Fabien Tessier
+     *
      * @param str1 (text for the left button)
      * @param str2 (text for the right button)
      * @return boolean (false = cancel, true = perform action)
+     * @author Fabien Tessier
      */
     public boolean saveBeforeAction(String str1, String str2) {
-        Object[] options = { str1, str2, "CANCEL" }; //Texts for buttons
+        Object[] options = {str1, str2, "CANCEL"}; //Texts for buttons
         JOptionPane optionPane = new JOptionPane("Modeling has not been saved", JOptionPane.WARNING_MESSAGE, JOptionPane.YES_NO_CANCEL_OPTION, null, options, options[0]);
         JDialog dialog = optionPane.createDialog(activetdp, "Warning"); //Use JDialog to enable navigation with arrow keys
-        dialog.setLocation((frame.getSize().width)/2 - dialog.getWidth()/2, (frame.getSize().height)/2 - dialog.getHeight()/2);
+        dialog.setLocation((frame.getSize().width) / 2 - dialog.getWidth() / 2, (frame.getSize().height) / 2 - dialog.getHeight() / 2);
         UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
 
         Set<AWTKeyStroke> forwardTraversalKeys = new HashSet<AWTKeyStroke>(dialog.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
@@ -3154,12 +3152,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         try {
             if (ConfigurationTTool.LastOpenFileDefined) {
-            	if (dir != null)
-            		saveConfig();
+                if (dir != null)
+                    saveConfig();
                 ConfigurationTTool.saveConfiguration();
                 //TraceManager.addDev("Configuration written to file");
             }
-        } catch (Exception e) {}
+        } catch (Exception e) {
+        }
 
 
         System.exit(0);
@@ -3215,7 +3214,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void updateZoomInfo() {
         String s = "";
-        int zoom = (int)(getCurrentTDiagramPanel().getZoom()*100);
+        int zoom = (int) (getCurrentTDiagramPanel().getZoom() * 100);
         if (zoom < 100) {
             s = "0" + zoom + "%";
         } else {
@@ -3243,12 +3242,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     //@author: Huy TRUONG
     //open a new External Search Dialog
-    public void showExternalSearch(){
+    public void showExternalSearch() {
         String textSearchField = mainBar.search.getText();
         List<String> listSearch = new ArrayList<String>();
 
         if (null == this.searchBox) {
-            if (getCurrentTDiagramPanel()!=null) {
+            if (getCurrentTDiagramPanel() != null) {
                 if (getCurrentTDiagramPanel().tdmm.getSelectComponents().size() == 0) {
                     listSearch.add(textSearchField);
                 } else {
@@ -3257,29 +3256,27 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
                 }
                 this.searchBox = new JDialogSearchBox(frame, "External Search", listSearch, getCurrentTDiagramPanel().tdmm);
-            }else
+            } else
                 this.searchBox = new JDialogSearchBox(frame, "External Search", new ArrayList<String>());
 
-        }
-        else {
+        } else {
             if (this.searchBox.isShowing()) {
-                this.searchBox.setVisible( true );
-            }
-            else {
+                this.searchBox.setVisible(true);
+            } else {
                 this.searchBox = null;
                 showExternalSearch();
             }
         }
     }
 
-    public void doInternalSearch(){
+    public void doInternalSearch() {
         search(mainBar.search.getText());
     }
 
     public void aboutVersion() {
         JFrameBasicText jft = new JFrameBasicText("About TTool ...", DefaultText.getAboutText(), IconManager.imgic324);
         jft.setIconImage(IconManager.img8);
-        GraphicLib.centerOnParent(jft, 740, 800 );
+        GraphicLib.centerOnParent(jft, 740, 800);
         jft.setVisible(true);
 
     }
@@ -3288,7 +3285,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         JFrameBasicText jft = new JFrameBasicText("Your configuration of TTool ...", ConfigurationTTool.getConfiguration(systemcOn), IconManager.imgic76);
         jft.setIconImage(IconManager.img8);
         //jft.setSize(700, 800);
-        GraphicLib.centerOnParent(jft, 700, 800 );
+        GraphicLib.centerOnParent(jft, 700, 800);
         jft.setVisible(true);
 
     }
@@ -3368,51 +3365,52 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         if (file == null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The project must be saved before any simulation or formal verification can be performed",
-                                          "Syntax analysis failed",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The project must be saved before any simulation or formal verification can be performed",
+                    "Syntax analysis failed",
+                    JOptionPane.INFORMATION_MESSAGE);
             return false;
         }
 
 
         if (tp instanceof AnalysisPanel) {
             try {
-                b = gtm.buildTURTLEModelingFromAnalysis((AnalysisPanel)tp);
+                b = gtm.buildTURTLEModelingFromAnalysis((AnalysisPanel) tp);
             } catch (AnalysisSyntaxException ae) {
                 //TraceManager.addDev("Exception AnalysisSyntaxException");
                 //msg = ae.getMessage();
                 b = false;
             }
+            expandToWarnings();
+            expandToErrors();
             if (b) {
                 setMode(MainGUI.MODEL_OK);
                 setMode(MainGUI.GEN_DESIGN_OK);
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
-                                                  "Syntax analysis successful on analysis diagrams",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
+                            "Syntax analysis successful on analysis diagrams",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The TURTLE Analysis contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The TURTLE Analysis contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
                 setMode(MainGUI.GEN_DESIGN_OK);
                 //setMode(MainGUI.MODEL_OK);
             }
 
 
-
         } else if (tp instanceof DesignPanel) {
             //Design
-            DesignPanel dp = (DesignPanel)tp;
+            DesignPanel dp = (DesignPanel) tp;
             JDialogModelChecking.validated = dp.validated;
             JDialogModelChecking.ignored = dp.ignored;
-            LinkedList<TClassInterface> tclassesToValidate = new LinkedList<TClassInterface> ();
-            JDialogModelChecking jdmc = new JDialogModelChecking(frame, tclassesToValidate,dp.tcdp.getComponentList(), "Choosing Tclasses to validate");
+            LinkedList<TClassInterface> tclassesToValidate = new LinkedList<TClassInterface>();
+            JDialogModelChecking jdmc = new JDialogModelChecking(frame, tclassesToValidate, dp.tcdp.getComponentList(), "Choosing Tclasses to validate");
             if (!automatic) {
                 GraphicLib.centerOnParent(jdmc);
                 jdmc.setVisible(true); // blocked until dialog has been closed
@@ -3424,22 +3422,24 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 dp.validated = JDialogModelChecking.validated;
                 dp.ignored = JDialogModelChecking.ignored;
                 b = gtm.checkTURTLEModeling(tclassesToValidate, dp, overideTifChecking);
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     ret = true;
                     setMode(MainGUI.MODEL_OK);
                     setMode(MainGUI.GEN_DESIGN_OK);
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
-                                                      "Syntax analysis successful on design diagrams",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
+                                "Syntax analysis successful on design diagrams",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The TURTLE Modeling contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The TURTLE Modeling contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
@@ -3447,21 +3447,23 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         } else if (tp instanceof DeploymentPanel) {
             DeploymentPanel dp = (DeploymentPanel) tp;
             b = gtm.translateDeployment(dp);
+            expandToWarnings();
+            expandToErrors();
             if (b) {
                 setMode(MainGUI.MODEL_OK);
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
-                                                  "Syntax analysis successful on deployment diagrams",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal (RT-LOTOS) specification or executable code (Java)",
+                            "Syntax analysis successful on deployment diagrams",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The TURTLE deployment contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The TURTLE deployment contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             }
 
@@ -3469,21 +3471,23 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         } else if (tp instanceof AttackTreePanel) {
             AttackTreePanel atp = (AttackTreePanel) tp;
             b = gtm.translateAttackTreePanel(atp);
+            expandToWarnings();
+            expandToErrors();
             if (b) {
                 setMode(MainGUI.ATTACKTREE_SYNTAXCHECKING_OK);
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s)",
-                                                  "Syntax analysis successful on attack tree",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s)",
+                            "Syntax analysis successful on attack tree",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The Attack tree contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The Attack tree contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             }
 
@@ -3491,10 +3495,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             // AVATAR
         } else if (tp instanceof AvatarDesignPanel) {
             //Design
-            AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+            AvatarDesignPanel adp = (AvatarDesignPanel) tp;
             //JDialogModelChecking.validated = adp.validated;
             //JDialogModelChecking.ignored = adp.ignored;
-            LinkedList<AvatarBDStateMachineOwner> blocksToValidate = new LinkedList<AvatarBDStateMachineOwner> ();
+            LinkedList<AvatarBDStateMachineOwner> blocksToValidate = new LinkedList<AvatarBDStateMachineOwner>();
             JDialogSelectAvatarBlock jdmc = new JDialogSelectAvatarBlock(frame, blocksToValidate, adp.getAvatarBDPanel().getFullStateMachineOwnerList(), "Choosing blocks to validate", adp.getValidated(), adp.getIgnored(), adp.getOptimized());
             if (!automatic) {
                 GraphicLib.centerOnParent(jdmc);
@@ -3519,6 +3523,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 /*adp.validated = JDialogModelChecking.validated;
                   adp.ignored = JDialogModelChecking.ignored;*/
                 b = gtm.checkAvatarDesign(blocksToValidate, adp, optimize);
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     ret = true;
                     setMode(MainGUI.AVATAR_SYNTAXCHECKING_OK);
@@ -3532,12 +3538,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                       }
                     */
                 } else {
-		    expandToErrors();
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The Avatar modeling contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.ERROR_MESSAGE);
+                                "The Avatar modeling contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.ERROR_MESSAGE);
                     }
                 }
             }
@@ -3553,7 +3558,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
             //JDialogModelChecking.validated = adp.validated;
             //JDialogModelChecking.ignored = adp.ignored;
-            LinkedList<AvatarBDStateMachineOwner> blocksToValidate = new LinkedList<AvatarBDStateMachineOwner> ();
+            LinkedList<AvatarBDStateMachineOwner> blocksToValidate = new LinkedList<AvatarBDStateMachineOwner>();
             JDialogSelectAvatarBlock jdmc = new JDialogSelectAvatarBlock(frame, blocksToValidate, adp.getAvatarBDPanel().getFullStateMachineOwnerList(), "Choosing blocks to validate", adp.getValidated(), adp.getIgnored(), adp.getOptimized());
             if (!automatic) {
                 GraphicLib.centerOnParent(jdmc);
@@ -3578,6 +3583,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 /*adp.validated = JDialogModelChecking.validated;
                   adp.ignored = JDialogModelChecking.ignored;*/
                 b = gtm.checkAvatarDesign(blocksToValidate, adp, optimize);
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     ret = true;
                     setMode(MainGUI.AVATAR_SYNTAXCHECKING_OK);
@@ -3593,9 +3600,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The Avatar modeling contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.ERROR_MESSAGE);
+                                "The Avatar modeling contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.ERROR_MESSAGE);
                     }
                 }
             }
@@ -3614,22 +3621,22 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s)",
-                                                  "Syntax analysis successful on NC diagram",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s)",
+                            "Syntax analysis successful on NC diagram",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The NC diagram contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The NC diagram contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             }
 
 
         } else if (tp instanceof TMLDesignPanel) {
-            TMLDesignPanel tmldp = (TMLDesignPanel)tp;
+            TMLDesignPanel tmldp = (TMLDesignPanel) tp;
             JDialogSelectTMLTask.validated = tmldp.validated;
             JDialogSelectTMLTask.ignored = tmldp.ignored;
             Vector<TGComponent> tmlTasksToValidate = new Vector<TGComponent>();
@@ -3644,6 +3651,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 tmldp.validated = JDialogSelectTMLTask.validated;
                 tmldp.ignored = JDialogSelectTMLTask.ignored;
                 b = gtm.translateTMLDesign(tmlTasksToValidate, tmldp, jdstmlt.getOptimize());
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     //setMode(MainGUI.MODEL_OK);
                     setMode(MainGUI.GEN_SYSTEMC_OK);
@@ -3651,21 +3660,21 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     ret = true;
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code",
-                                                      "Syntax analysis successful on TML designs",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code",
+                                "Syntax analysis successful on TML designs",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The TML design contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The TML design contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
         } else if (tp instanceof TMLComponentDesignPanel) {
-            TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel)tp;
+            TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) tp;
             JDialogSelectTMLComponent.validated = tmlcdp.validated;
             JDialogSelectTMLComponent.ignored = tmlcdp.ignored;
             Vector<TGComponent> tmlComponentsToValidate = new Vector<TGComponent>();
@@ -3680,6 +3689,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 tmlcdp.validated = JDialogSelectTMLComponent.validated;
                 tmlcdp.ignored = JDialogSelectTMLComponent.ignored;
                 b = gtm.translateTMLComponentDesign(tmlComponentsToValidate, tmlcdp, jdstmlc.getOptimize());
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     //setMode(MainGUI.MODEL_OK);
                     setMode(MainGUI.GEN_SYSTEMC_OK);
@@ -3687,26 +3698,26 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     ret = true;
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code",
-                                                      "Syntax analysis successful on TML designs",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate make proofs (safety, security and performance) or generate executable code",
+                                "Syntax analysis successful on TML designs",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The TML design contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The TML design contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
-        }  else if (tp instanceof SystemCAMSPanel) { //Ajout CD
+        } else if (tp instanceof SystemCAMSPanel) { //Ajout CD
 
-            SystemCAMSPanel camsp = (SystemCAMSPanel)tp;
+            SystemCAMSPanel camsp = (SystemCAMSPanel) tp;
             JDialogSelectSystemCAMSBlock.validated = camsp.validated;
             JDialogSelectSystemCAMSBlock.ignored = camsp.ignored;
             Vector<TGComponent> camsBlocksToValidate = new Vector<TGComponent>();
-            JDialogSelectSystemCAMSBlock jdsscb = new JDialogSelectSystemCAMSBlock(frame, camsBlocksToValidate, camsp.camsbdp.getComponentList(),"Block Parameter");
+            JDialogSelectSystemCAMSBlock jdsscb = new JDialogSelectSystemCAMSBlock(frame, camsBlocksToValidate, camsp.camsbdp.getComponentList(), "Block Parameter");
             if (!automatic) {
                 GraphicLib.centerOnParent(jdsscb);
                 jdsscb.setVisible(true);
@@ -3717,28 +3728,30 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             if (camsBlocksToValidate.size() > 0) {
                 camsp.validated = JDialogSelectSystemCAMSBlock.validated;
                 camsp.ignored = JDialogSelectSystemCAMSBlock.ignored;
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     setMode(MainGUI.GEN_SYSTEMC_OK);
                     setMode(MainGUI.MODEL_OK);
                     ret = true;
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
-                                                      "Syntax analysis successful on SystemC-AMS",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
+                                "Syntax analysis successful on SystemC-AMS",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The SystemC-AMS contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The SystemC-AMS contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
 
         } else if (tp instanceof TMLArchiPanel) {
-            tmlap = (TMLArchiPanel)tp;
+            tmlap = (TMLArchiPanel) tp;
             JDialogSelectTMLNodes.validated = tmlap.validated;
             JDialogSelectTMLNodes.ignored = tmlap.ignored;
             Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>();
@@ -3756,6 +3769,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 tmlap.ignored = JDialogSelectTMLNodes.ignored;
                 //TraceManager.addDev("Ready to generate TML mapping!");
                 b = gtm.checkSyntaxTMLMapping(tmlNodesToValidate, tmlap, jdstmln.getOptimize());
+                expandToWarnings();
+                expandToErrors();
                 if (b) {
                     //setMode(MainGUI.MODEL_OK);
                     setMode(MainGUI.GEN_SYSTEMC_OK);
@@ -3763,84 +3778,82 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     ret = true;
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
-                                                      "Syntax analysis successful on TML mapping",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
+                                "Syntax analysis successful on TML mapping",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     if (!automatic) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The TML mapping contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The TML mapping contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
-        }
-        else if( tp instanceof TMLCommunicationPatternPanel ) {
+        } else if (tp instanceof TMLCommunicationPatternPanel) {
             TMLCommunicationPatternPanel tmlcpp = (TMLCommunicationPatternPanel) tp;
-            JDialogSelectCPDiagrams.validated =  tmlcpp.validated;
-            JDialogSelectCPDiagrams.ignored =  tmlcpp.ignored;
+            JDialogSelectCPDiagrams.validated = tmlcpp.validated;
+            JDialogSelectCPDiagrams.ignored = tmlcpp.ignored;
             Vector<TGComponent> tmlDiagramsToValidate = new Vector<TGComponent>();
-            JDialogSelectCPDiagrams jdscpd = new JDialogSelectCPDiagrams( frame, tmlDiagramsToValidate, tmlcpp.tmlcpp.getComponentList(),
-                                                                          "Choosing Diagrams to validate" );
-            if( !automatic ) {
-                GraphicLib.centerOnParent( jdscpd );
-                jdscpd.setVisible( true ); // Blocked until dialog has been closed
-            }
-            else {
+            JDialogSelectCPDiagrams jdscpd = new JDialogSelectCPDiagrams(frame, tmlDiagramsToValidate, tmlcpp.tmlcpp.getComponentList(),
+                    "Choosing Diagrams to validate");
+            if (!automatic) {
+                GraphicLib.centerOnParent(jdscpd);
+                jdscpd.setVisible(true); // Blocked until dialog has been closed
+            } else {
                 jdscpd.closeDialog();
             }
-            if( tmlDiagramsToValidate.size() > 0 ) {
+            if (tmlDiagramsToValidate.size() > 0) {
                 tmlcpp.validated = JDialogSelectCPDiagrams.validated;
                 tmlcpp.ignored = JDialogSelectCPDiagrams.ignored;
                 TraceManager.addDev("Ready to generate TML code for Communication Patterns!");
-                b = gtm.checkSyntaxTMLCP( tmlDiagramsToValidate, tmlcpp, jdscpd.getOptimize() );    //Fills a data structure
+                b = gtm.checkSyntaxTMLCP(tmlDiagramsToValidate, tmlcpp, jdscpd.getOptimize());    //Fills a data structure
                 //translateTMLComponentDesign
                 //and should say if it is correct or contains error in the return variable b
-                if( b ) {
+                expandToWarnings();
+                expandToErrors();
+                if (b) {
                     //setMode(MainGUI.MODEL_OK);
-                    setMode( MainGUI.GEN_SYSTEMC_OK );
-                    setMode( MainGUI.MODEL_OK );
+                    setMode(MainGUI.GEN_SYSTEMC_OK);
+                    setMode(MainGUI.MODEL_OK);
                     ret = true;
-                    if( !automatic ) {
-                        JOptionPane.showMessageDialog( frame, "0 error, " + getCheckingWarnings().size() +
-                                                       " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
-                                                       "Syntax analysis successful on TML mapping",
-                                                       JOptionPane.INFORMATION_MESSAGE );
+                    if (!automatic) {
+                        JOptionPane.showMessageDialog(frame, "0 error, " + getCheckingWarnings().size() +
+                                        " warning(s). You can now perform verifications (safety, security, performance) or generate executable code",
+                                "Syntax analysis successful on TML mapping",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
-                }
-                else {
-                    if( !automatic ) {
-                        JOptionPane.showMessageDialog( frame, "The Communication Patterns design contains several errors", "Syntax analysis failed",
-                                                       JOptionPane.INFORMATION_MESSAGE );
+                } else {
+                    if (!automatic) {
+                        JOptionPane.showMessageDialog(frame, "The Communication Patterns design contains several errors", "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 }
             }
-        }
-        else if( tp instanceof RequirementPanel ) {
+        } else if (tp instanceof RequirementPanel) {
             TDiagramPanel tdp = getCurrentTDiagramPanel();
             if (!(tdp instanceof RequirementDiagramPanel)) {
                 if (tdp instanceof EBRDDPanel) {
 
-                    b = gtm.makeEBRDD((EBRDDPanel)tdp);
+                    b = gtm.makeEBRDD((EBRDDPanel) tdp);
                     if (b) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s).",
-                                                      "Syntax analysis successful on EBRDD",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "0 error, " + getCheckingWarnings().size() + " warning(s).",
+                                "Syntax analysis successful on EBRDD",
+                                JOptionPane.INFORMATION_MESSAGE);
                     } else {
                         JOptionPane.showMessageDialog(frame,
-                                                      "The EBRDD contains several errors",
-                                                      "Syntax analysis failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "The EBRDD contains several errors",
+                                "Syntax analysis failed",
+                                JOptionPane.INFORMATION_MESSAGE);
                     }
                 } else {
                     return ret;
                 }
                 //TraceManager.addDev("No syntax checking for EBRDD: not yet implemented");
             } else {
-                RequirementDiagramPanel rdp= (RequirementDiagramPanel)tdp;
+                RequirementDiagramPanel rdp = (RequirementDiagramPanel) tdp;
                 JDialogSelectRequirements.validated = rdp.validated;
                 JDialogSelectRequirements.ignored = rdp.ignored;
                 Vector<Requirement> reqsToValidate = new Vector<Requirement>();
@@ -3855,23 +3868,25 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     rdp.validated = JDialogSelectRequirements.validated;
                     rdp.ignored = JDialogSelectRequirements.ignored;
                     b = gtm.generateTMsForRequirementAnalysis(reqsToValidate, rdp);
+                    expandToWarnings();
+                    expandToErrors();
                     if (b) {
                         //setMode(MainGUI.GEN_SYSTEMC_OK);
                         setMode(MainGUI.REQ_OK);
                         ret = true;
                         if (!automatic) {
                             JOptionPane.showMessageDialog(frame,
-                                                          "0 error, " + getCheckingWarnings().size() + " warning(s). You can now verify requirements' satisfiability",
-                                                          "Syntax analysis successful on requirements",
-                                                          JOptionPane.INFORMATION_MESSAGE);
+                                    "0 error, " + getCheckingWarnings().size() + " warning(s). You can now verify requirements' satisfiability",
+                                    "Syntax analysis successful on requirements",
+                                    JOptionPane.INFORMATION_MESSAGE);
                         }
 
                     } else {
                         if (!automatic) {
                             JOptionPane.showMessageDialog(frame,
-                                                          "The requirement diagram contains several errors",
-                                                          "Syntax analysis failed",
-                                                          JOptionPane.INFORMATION_MESSAGE);
+                                    "The requirement diagram contains several errors",
+                                    "Syntax analysis failed",
+                                    JOptionPane.INFORMATION_MESSAGE);
                         }
                     }
                 }
@@ -3879,7 +3894,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         } else if (tp instanceof ProactiveDesignPanel) {
             // TraceManager.addDev("!!!!!!!!!!!!1");
             //newTurtleModeling();
-            b = gtm.translateProactiveDesign((ProactiveDesignPanel)tp);
+            b = gtm.translateProactiveDesign((ProactiveDesignPanel) tp);
+            expandToWarnings();
+            expandToErrors();
             if (b) {
                 //setMode(MainGUI.MODEL_OK);
                 //setMode(MainGUI.GEN_SYSTEMC_OK);
@@ -3887,39 +3904,41 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a LOTOS,specification",
-                                                  "Syntax analysis successful on Proactive design",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a LOTOS,specification",
+                            "Syntax analysis successful on Proactive design",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
 
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The Proactive design contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The Proactive design contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
 
             }
         } else if (tp instanceof TURTLEOSDesignPanel) {
             TraceManager.addDev("TURTLEOS Design Panel");
             //TURTLEOSDesignPanel tosdp = (TURTLEOSDesignPanel) tp;
-            b = gtm.translateTURTLEOSDesign((TURTLEOSDesignPanel)tp);
+            b = gtm.translateTURTLEOSDesign((TURTLEOSDesignPanel) tp);
+            expandToWarnings();
+            expandToErrors();
             if (b) {
                 setMode(MainGUI.MODEL_OK);
                 ret = true;
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal specification or executable code (Java)",
-                                                  "Syntax analysis successful on deployment diagrams",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "0 error, " + getCheckingWarnings().size() + " warning(s). You can now generate a corresponding formal specification or executable code (Java)",
+                            "Syntax analysis successful on deployment diagrams",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             } else {
                 if (!automatic) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "The TURTLE deployment contains several errors",
-                                                  "Syntax analysis failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "The TURTLE deployment contains several errors",
+                            "Syntax analysis failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                 }
             }
         }
@@ -3930,9 +3949,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public LinkedList<TAttribute> getAllAttributes() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        String name =  getCurrentTDiagramPanel().getName();
+        String name = getCurrentTDiagramPanel().getName();
 
-        return this.getAllAttributes (tp, name);
+        return this.getAllAttributes(tp, name);
     }
 
     public LinkedList<TAttribute> getAllAttributes(TURTLEPanel tp, String name) {
@@ -3943,7 +3962,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof AvatarDesignPanel)) {
             return null;
         }
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
 
         return adp.getAllAttributes(name);
     }
@@ -3958,17 +3977,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof AvatarDesignPanel)) {
             return null;
         }
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
 
-        String name =  getCurrentTDiagramPanel().getName();
+        String name = getCurrentTDiagramPanel().getName();
 
         return adp.getAllMethods(name);
     }
 
     public LinkedList<AvatarSignal> getAllSignals() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        String name =  getCurrentTDiagramPanel().getName();
-        return this.getAllSignals (tp, name);
+        String name = getCurrentTDiagramPanel().getName();
+        return this.getAllSignals(tp, name);
     }
 
     public LinkedList<AvatarSignal> getAllSignals(TURTLEPanel tp, String name) {
@@ -3979,26 +3998,26 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof AvatarDesignPanel)) {
             return null;
         }
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
 
         return adp.getAllSignals(name);
     }
 
 
-    public List<AvatarBDLibraryFunction> getAllLibraryFunctions () {
+    public List<AvatarBDLibraryFunction> getAllLibraryFunctions() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        return this.getAllLibraryFunctions (tp);
+        return this.getAllLibraryFunctions(tp);
     }
 
-    public List<AvatarBDLibraryFunction> getAllLibraryFunctions (TURTLEPanel tp) {
-        String name =  getCurrentTDiagramPanel().getName();
-        return this.getAllLibraryFunctions (tp, name);
+    public List<AvatarBDLibraryFunction> getAllLibraryFunctions(TURTLEPanel tp) {
+        String name = getCurrentTDiagramPanel().getName();
+        return this.getAllLibraryFunctions(tp, name);
     }
 
     /* Note that this is here for historical purpose : Now, any block can access library functions of any
      * other block.
      */
-    public List<AvatarBDLibraryFunction> getAllLibraryFunctions (TURTLEPanel tp, String name) {
+    public List<AvatarBDLibraryFunction> getAllLibraryFunctions(TURTLEPanel tp, String name) {
         if (tp == null) {
             return null;
         }
@@ -4006,7 +4025,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof AvatarDesignPanel)) {
             return null;
         }
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
 
         return adp.getAllLibraryFunctions(name);
     }
@@ -4020,17 +4039,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof TMLComponentDesignPanel)) {
             return null;
         }
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
 
-        String name =  getCurrentTDiagramPanel().getName();
+        String name = getCurrentTDiagramPanel().getName();
 
         return tmlcomp.getAllOutEvents(name);
     }
 
-    public ArrayList<TGComponent> getAllLatencyChecks(){
+    public ArrayList<TGComponent> getAllLatencyChecks() {
         TURTLEPanel tp;
         ArrayList<TGComponent> list = new ArrayList<TGComponent>();
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             tp.getAllLatencyChecks(list);
         }
@@ -4039,19 +4058,27 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public String[] getAllInEvents() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) {return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) {return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
-        String name =  getCurrentTDiagramPanel().getName();
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
+        String name = getCurrentTDiagramPanel().getName();
         return tmlcomp.getAllInEvents(name);
     }
 
     public String[] getAllOutChannels() {   //this routine can be called only from a TMLComponentDesignPanel
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) { return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) { return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
-        String name =  getCurrentTDiagramPanel().getName();
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
+        String name = getCurrentTDiagramPanel().getName();
         System.out.println("Name " + name);
         return tmlcomp.getAllOutChannels(name);
     }
@@ -4060,73 +4087,95 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public String[] getAllCompOutChannels() {   //this routine can be called only from a TMLComponentDesignPanel
         //List<String> chans = new ArrayList<String>();
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) { return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) { return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
         return tmlcomp.getCompOutChannels();
     }
 
     public String[] getAllCompInChannels() {   //this routine can be called only from a TMLComponentDesignPanel
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) { return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) { return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
         return tmlcomp.getCompInChannels();
     }
 
 
     public String[] getAllInChannels() {    //this routine can be called only from a TMLComponentDesignPanel
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) {return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) {return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
-        String name =  getCurrentTDiagramPanel().getName();
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
+        String name = getCurrentTDiagramPanel().getName();
         return tmlcomp.getAllInChannels(name);
     }
 
-    public Vector<String> getAllCryptoConfig(){
+    public Vector<String> getAllCryptoConfig() {
         TURTLEPanel tp;
         Vector<String> list = new Vector<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
-                for (String s: ((TMLComponentDesignPanel)tp).getAllCryptoConfig()){
-                    list.add(mainTabbedPane.getTitleAt(i)+"::"+s);
+                for (String s : ((TMLComponentDesignPanel) tp).getAllCryptoConfig()) {
+                    list.add(mainTabbedPane.getTitleAt(i) + "::" + s);
                 }
             }
         }
         return list;
     }
+
     public String[] getCurrentCryptoConfig() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) {return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) {return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
         List<String> strlist = tmlcomp.getAllCryptoConfig();
         String[] strarray = new String[strlist.size()];
         strlist.toArray(strarray);
         return strarray;
     }
-    public String[] getAllNonce(){
+
+    public String[] getAllNonce() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) {return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) {return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
         List<String> strlist = tmlcomp.getAllNonce();
         String[] strarray = new String[strlist.size()];
         strlist.toArray(strarray);
         return strarray;
     }
 
-    public ArrayList<String> getAllKeys(){
+    public ArrayList<String> getAllKeys() {
         TURTLEPanel tp;
         ArrayList<String> list = new ArrayList<String>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
-                for (String s:((TMLComponentDesignPanel)tp).getAllKeys()){
+                for (String s : ((TMLComponentDesignPanel) tp).getAllKeys()) {
                     list.add(s);
                 }
             }
@@ -4134,14 +4183,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return list;
     }
 
-    public ArrayList<TGComponent> getAllAttacks(){
+    public ArrayList<TGComponent> getAllAttacks() {
         TURTLEPanel tp;
         ArrayList<TGComponent> list = new ArrayList<TGComponent>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof AttackTreePanel) {
-                for (TGComponent s:((AttackTreePanel)tp).getAllAttacks()){
+                for (TGComponent s : ((AttackTreePanel) tp).getAllAttacks()) {
                     list.add(s);
                 }
             }
@@ -4150,14 +4199,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     }
 
-    public ArrayList<TGComponent> getAllFaults(){
+    public ArrayList<TGComponent> getAllFaults() {
         TURTLEPanel tp;
         ArrayList<TGComponent> list = new ArrayList<TGComponent>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof FaultTreePanel) {
-                for (TGComponent s:((FaultTreePanel)tp).getAllFaults()){
+                for (TGComponent s : ((FaultTreePanel) tp).getAllFaults()) {
                     list.add(s);
                 }
             }
@@ -4166,14 +4215,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     }
 
-    public ArrayList<TGComponent> getAllRequirements(){
+    public ArrayList<TGComponent> getAllRequirements() {
         TURTLEPanel tp;
         ArrayList<TGComponent> list = new ArrayList<TGComponent>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof AvatarRequirementPanel) {
-                for (TGComponent s:((AvatarRequirementPanel)tp).getAllRequirements()){
+                for (TGComponent s : ((AvatarRequirementPanel) tp).getAllRequirements()) {
                     list.add(s);
                 }
             }
@@ -4181,12 +4230,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return list;
 
     }
+
     public String[] getAllOutRequests() {
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp == null) {return null;}
-        if (!(tp instanceof TMLComponentDesignPanel)) {return null;}
-        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel)tp;
-        String name =  getCurrentTDiagramPanel().getName();
+        if (tp == null) {
+            return null;
+        }
+        if (!(tp instanceof TMLComponentDesignPanel)) {
+            return null;
+        }
+        TMLComponentDesignPanel tmlcomp = (TMLComponentDesignPanel) tp;
+        String name = getCurrentTDiagramPanel().getName();
         return tmlcomp.getAllOutRequests(name);
     }
 
@@ -4199,9 +4253,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (!(tp instanceof AvatarDesignPanel)) {
             return null;
         }
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
 
-        String name =  getCurrentTDiagramPanel().getName();
+        String name = getCurrentTDiagramPanel().getName();
 
         return adp.getAllTimers(name);
     }
@@ -4221,11 +4275,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         if (tp instanceof AvatarDesignPanel) {
-            AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+            AvatarDesignPanel adp = (AvatarDesignPanel) tp;
             adp.modelBacktracingProVerif(pvoa);
             getCurrentTDiagramPanel().repaint();
-        }
-        else if (tp instanceof TMLArchiPanel) {
+        } else if (tp instanceof TMLArchiPanel) {
             /*  for (int i=0; i<tabs.size(); i++){
                 tp = (TURTLEPanel)(tabs.elementAt(i));
                 if (tp instanceof TMLComponentDesignPanel) {
@@ -4236,8 +4289,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             gtm.getTMLMapping().getTMLModeling().backtrace(pvoa, getTabName(tp));
             gtm.getTML2Avatar().backtraceReachability(pvoa.getReachabilityResults());
             gtm.getTMLMapping().getTMLModeling().backtraceAuthenticity(pvoa.getAuthenticityResults(), getTabName(tp));
-        }
-        else if (tp instanceof TMLComponentDesignPanel){
+        } else if (tp instanceof TMLComponentDesignPanel) {
             gtm.getTMLMapping().getTMLModeling().clearBacktracing();
             gtm.getTMLMapping().getTMLModeling().backtrace(pvoa, "Default Mapping");
             gtm.getTML2Avatar().backtraceReachability(pvoa.getReachabilityResults());
@@ -4246,7 +4298,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return;
     }
 
-    public void modelBacktracingUPPAAL( Map<String, Integer> verifMap) {
+    public void modelBacktracingUPPAAL(Map<String, Integer> verifMap) {
         TURTLEPanel tp = getCurrentTURTLEPanel();
         if (tp == null) {
             return;
@@ -4256,7 +4308,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return;
         }
 
-        AvatarDesignPanel adp = (AvatarDesignPanel)tp;
+        AvatarDesignPanel adp = (AvatarDesignPanel) tp;
         adp.modelBacktracingUppaal(verifMap);
         getCurrentTDiagramPanel().repaint();
     }
@@ -4284,9 +4336,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
         if (!automatic) {
             JOptionPane.showMessageDialog(frame,
-                                          "RT-LOTOS specification generated",
-                                          "RT-LOTOS specification",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "RT-LOTOS specification generated",
+                    "RT-LOTOS specification",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
         dtree.toBeUpdated();
         return true;
@@ -4317,9 +4369,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             //TraceManager.addDev("LOTOS generated");
             if (!automatic) {
                 JOptionPane.showMessageDialog(frame,
-                                              "LOTOS specification generated (" + getCheckingWarnings().size() + " warning(s))",
-                                              "LOTOS specification",
-                                              JOptionPane.INFORMATION_MESSAGE);
+                        "LOTOS specification generated (" + getCheckingWarnings().size() + " warning(s))",
+                        "LOTOS specification",
+                        JOptionPane.INFORMATION_MESSAGE);
             }
         }
         setMode(MainGUI.RTLOTOS_OK);
@@ -4431,7 +4483,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         JMenu menu = jmenubarturtle.getJMenuGraph();
         menu.removeAll();
         String s;
-        for(int i=0; i<v.size(); i++) {
+        for (int i = 0; i < v.size(); i++) {
             s = v.elementAt(i);
             jmenubarturtle.addMenuItem(menu, s, this);
         }
@@ -4440,9 +4492,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void generateAUTS() {
         JDialogGenAUTS jdgauts = new JDialogGenAUTS(frame, this, "Generation of automata via LOTOS", gtm.getPathCaesar(),
-                                                    GTURTLEModeling.getPathBcgio(),
-                                                    REMOTE_RTL_LOTOS_FILE,
-                                                    GTURTLEModeling.getCaesarHost(), SpecConfigTTool.TGraphPath);
+                GTURTLEModeling.getPathBcgio(),
+                REMOTE_RTL_LOTOS_FILE,
+                GTURTLEModeling.getCaesarHost(), SpecConfigTTool.TGraphPath);
         //  jdgauts.setSize(450, 600);
         GraphicLib.centerOnParent(jdgauts, 450, 600);
         jdgauts.setVisible(true);
@@ -4475,34 +4527,34 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             formalValidation(true);
         } else {
             JOptionPane.showMessageDialog(frame,
-                                          "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated",
-                                          "Translation to UPPAAL failed",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "" + getCheckingErrors().size() + " errors, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated",
+                    "Translation to UPPAAL failed",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
     }
 
     public void avatarProVerifVerification() {
-        boolean limit=true;
+        boolean limit = true;
         TraceManager.addDev("Avatar proverif fv");
         TURTLEPanel tp = this.getCurrentTURTLEPanel();
         AvatarDesignPanel adp = null;
-        if (tp instanceof AvatarDesignPanel){
+        if (tp instanceof AvatarDesignPanel) {
             adp = (AvatarDesignPanel) tp;
-			limit=false;
-		}
-        JDialogProverifVerification jgen = new JDialogProverifVerification(frame, this, "Security verification with ProVerif", ConfigurationTTool.ProVerifVerifierHost, SpecConfigTTool.ProVerifCodeDirectory, ConfigurationTTool.ProVerifVerifierPath, adp,limit, gtm.getCPUTaskMap());
+            limit = false;
+        }
+        JDialogProverifVerification jgen = new JDialogProverifVerification(frame, this, "Security verification with ProVerif", ConfigurationTTool.ProVerifVerifierHost, SpecConfigTTool.ProVerifCodeDirectory, ConfigurationTTool.ProVerifVerifierPath, adp, limit, gtm.getCPUTaskMap());
         // jgen.setSize(500, 450);
         GraphicLib.centerOnParent(jgen, 600, 800);
         jgen.setVisible(true);
         dtree.toBeUpdated();
     }
 
-    public void dse(){
+    public void dse() {
         TraceManager.addDev("Design space exploration");
-        JDialogDSE jdse= new JDialogDSE(frame, this, "Design Space Exploration", SpecConfigTTool.SystemCCodeDirectory, SpecConfigTTool.TMLCodeDirectory);
+        JDialogDSE jdse = new JDialogDSE(frame, this, "Design Space Exploration", SpecConfigTTool.SystemCCodeDirectory, SpecConfigTTool.TMLCodeDirectory);
         //   jdse.setSize(600,800);
-        GraphicLib.centerOnParent(jdse, 600,800);
+        GraphicLib.centerOnParent(jdse, 600, 800);
         jdse.setVisible(true);
         dtree.toBeUpdated();
     }
@@ -4518,7 +4570,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void avatarExecutableCodeGeneration() {
         TraceManager.addDev("Avatar code generation");
-        JDialogAvatarExecutableCodeGeneration jgen = new JDialogAvatarExecutableCodeGeneration(frame, this, "Executable Code generation, compilation and execution", ConfigurationTTool.AVATARExecutableCodeHost, SpecConfigTTool.AVATARExecutableCodeDirectory,  SpecConfigTTool.AVATARExecutableCodeCompileCommand, SpecConfigTTool.AVATARExecutableCodeExecuteCommand, ConfigurationTTool.AVATARExecutableSoclibCodeCompileCommand, ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand,  ConfigurationTTool.AVATARExecutableSoclibTraceFile);
+        JDialogAvatarExecutableCodeGeneration jgen = new JDialogAvatarExecutableCodeGeneration(frame, this, "Executable Code generation, compilation and execution", ConfigurationTTool.AVATARExecutableCodeHost, SpecConfigTTool.AVATARExecutableCodeDirectory, SpecConfigTTool.AVATARExecutableCodeCompileCommand, SpecConfigTTool.AVATARExecutableCodeExecuteCommand, ConfigurationTTool.AVATARExecutableSoclibCodeCompileCommand, ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand, ConfigurationTTool.AVATARExecutableSoclibTraceFile);
         //   jgen.setSize(500, 450);
         GraphicLib.centerOnParent(jgen, 500, 450);
         jgen.setVisible(true);
@@ -4526,15 +4578,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     // DG
-    public void avatarddExecutableCodeGeneration(){
+    public void avatarddExecutableCodeGeneration() {
         TraceManager.addDev("Avatar code generation");
         JDialogAvatarddExecutableCodeGeneration jgen = new JDialogAvatarddExecutableCodeGeneration(frame, this, "Executable Code generation, compilation and execution",
-                                                                                                   ConfigurationTTool.AVATARExecutableCodeHost,
-                                                                                                   ConfigurationTTool.AVATARMPSoCCodeDirectory,
-                                                                                                   ConfigurationTTool.AVATARMPSoCCompileCommand,
-                                                                                                   ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand);
+                ConfigurationTTool.AVATARExecutableCodeHost,
+                ConfigurationTTool.AVATARMPSoCCodeDirectory,
+                ConfigurationTTool.AVATARMPSoCCompileCommand,
+                ConfigurationTTool.AVATARExecutableSoclibCodeExecuteCommand);
         // jgen.setSize(500, 450);
-        GraphicLib.centerOnParent(jgen, 500, 450 );
+        GraphicLib.centerOnParent(jgen, 500, 450);
         jgen.setVisible(true);
         dtree.toBeUpdated();
     }
@@ -4558,15 +4610,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                     TraceManager.addDev("4178");
                     if (result) {
                         JOptionPane.showMessageDialog(frame,
-                                                      "0 error, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification generated",
-                                                      "Successful translation to UPPAAL",
-                                                      JOptionPane.INFORMATION_MESSAGE);
-                    }
-                    else {
+                                "0 error, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification generated",
+                                "Successful translation to UPPAAL",
+                                JOptionPane.INFORMATION_MESSAGE);
+                    } else {
                         JOptionPane.showMessageDialog(frame,
-                                                      "" + getCheckingErrors().size() + " errors, " +getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated",
-                                                      "Translation to UPPAAL failed",
-                                                      JOptionPane.INFORMATION_MESSAGE);
+                                "" + getCheckingErrors().size() + " errors, " + getCheckingWarnings().size() + " warning(s). UPPAAL specification could NOT be generated",
+                                "Translation to UPPAAL failed",
+                                JOptionPane.INFORMATION_MESSAGE);
 
 
                     }
@@ -4575,13 +4626,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 if (!result) {
                     return;
                 }
-            }
-            else {
+            } else {
                 /*if (generateTURTLEModelingFromState(gtm.getTURTLEModelingState(), false, UPPAAL) == -1) {
                   TraceManager.addDev("4202 - UPPAAL generation failed");
                   return;
                   }*/
-                TraceManager.addDev( "About to open the window at line 4198" );
+                TraceManager.addDev("About to open the window at line 4198");
                 if (showWindow) {
                     TURTLEPanel tp = getCurrentTURTLEPanel();
                     boolean result = false;
@@ -4602,7 +4652,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             }
         }
 
-        TraceManager.addDev( "gtm.getTURTLEModelingState() <= 0)" );
+        TraceManager.addDev("gtm.getTURTLEModelingState() <= 0)");
         //TraceManager.addDev("After UPPAAL");
         if (showWindow) {
             JDialogUPPAALGeneration jgen = new JDialogUPPAALGeneration(frame, this, "UPPAAL code generation", SpecConfigTTool.UPPAALCodeDirectory, JDialogUPPAALGeneration.TURTLE_MODE);
@@ -4615,8 +4665,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void avatarModelChecker() {
         TraceManager.addDev("Execute avatar model checker");
-        gtm.generateAvatarFromTML(true,false);
-        if (gtm.getAvatarSpecification()==null){
+        gtm.generateAvatarFromTML(true, false);
+        if (gtm.getAvatarSpecification() == null) {
             TraceManager.addDev("Null avatar spec");
             return;
         }
@@ -4675,12 +4725,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp = getCurrentTURTLEPanel();
         if (tp instanceof AvatarDesignPanel) {
             avatarSimulation();
-        } else if ((tp instanceof TMLDesignPanel) || (tp instanceof TMLComponentDesignPanel) || (tp instanceof TMLArchiPanel))  {
+        } else if ((tp instanceof TMLDesignPanel) || (tp instanceof TMLComponentDesignPanel) || (tp instanceof TMLArchiPanel)) {
             JDialogSystemCGeneration jgen = new JDialogSystemCGeneration(frame, this, "Simulation Code Generation and Compilation",
-                                                                         ConfigurationTTool.SystemCHost, SpecConfigTTool.SystemCCodeDirectory, SpecConfigTTool.SystemCCodeCompileCommand,
-                                                                         SpecConfigTTool.SystemCCodeExecuteCommand, SpecConfigTTool.SystemCCodeInteractiveExecuteCommand, SpecConfigTTool.GGraphPath, _mode);
+                    ConfigurationTTool.SystemCHost, SpecConfigTTool.SystemCCodeDirectory, SpecConfigTTool.SystemCCodeCompileCommand,
+                    SpecConfigTTool.SystemCCodeExecuteCommand, SpecConfigTTool.SystemCCodeInteractiveExecuteCommand, SpecConfigTTool.GGraphPath, _mode);
             //jgen.setSize(500, 750);
-            GraphicLib.centerOnParent( jgen, 700, 750 );
+            GraphicLib.centerOnParent(jgen, 700, 750);
             jgen.setVisible(true);
             dtree.toBeUpdated();
 
@@ -4717,7 +4767,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         jfis.setIconImage(IconManager.img9);
         //jfis.setSize(1024, 900);
-        GraphicLib.centerOnParent( jfis, 1024, 900 );
+        GraphicLib.centerOnParent(jfis, 1024, 900);
         jfis.setVisible(true);
     }
 
@@ -4754,13 +4804,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
 
         if (tabs != null) {
-            for(int i=0; i<tabs.size(); i++) {
+            for (int i = 0; i < tabs.size(); i++) {
                 tp = tabs.elementAt(i);
                 if (tp instanceof TMLDesignPanel) {
-                    ((TMLDesignPanel)tp).getListOfBreakPoints(points);
+                    ((TMLDesignPanel) tp).getListOfBreakPoints(points);
                 }
                 if (tp instanceof TMLComponentDesignPanel) {
-                    ((TMLComponentDesignPanel)tp).getListOfBreakPoints(points);
+                    ((TMLComponentDesignPanel) tp).getListOfBreakPoints(points);
                 }
             }
         }
@@ -4789,10 +4839,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //        if( file != null ) {
         //            path = file.getAbsolutePath();
         //        }
-        JDialogCCodeGeneration jgen = new JDialogCCodeGeneration( frame, this, "Application code generation and compilation",
-                                                                  SpecConfigTTool.CCodeDirectory,
-                                                                  "make -C " + SpecConfigTTool.CCodeDirectory,
-                                                                  gtm );
+        JDialogCCodeGeneration jgen = new JDialogCCodeGeneration(frame, this, "Application code generation and compilation",
+                SpecConfigTTool.CCodeDirectory,
+                "make -C " + SpecConfigTTool.CCodeDirectory,
+                gtm);
         //   jgen.setSize(500, 750);
         GraphicLib.centerOnParent(jgen, 500, 750);
         jgen.setVisible(true);
@@ -4871,22 +4921,22 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void checkCode() {
         if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) {
             JDialogTextProcess jdtp = new JDialogTextProcess(frame,
-                                                             "Checking RT-LOTOS specification with RTL",
-                                                             gtm.getPathRTL() + " __FILENAME -max-spec-t-1",
-                                                             REMOTE_RTL_LOTOS_FILE,
-                                                             gtm.getLastRTLOTOSSpecification(),
-                                                             gtm.getHost());
+                    "Checking RT-LOTOS specification with RTL",
+                    gtm.getPathRTL() + " __FILENAME -max-spec-t-1",
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getLastRTLOTOSSpecification(),
+                    gtm.getHost());
             //jdtp.setSize(450, 600);
             GraphicLib.centerOnParent(jdtp, 450, 600);
             jdtp.setVisible(true);
             dtree.toBeUpdated();
         } else if (gtm.getLanguageID() == GTURTLEModeling.LOTOS) {
             JDialogLOTOSAnalysis jdla = new JDialogLOTOSAnalysis(frame,
-                                                                 this, "Checking LOTOS specification with CAESAR",
-                                                                 gtm.getPathCaesar(),
-                                                                 REMOTE_RTL_LOTOS_FILE,
-                                                                 gtm.getLastRTLOTOSSpecification(),
-                                                                 GTURTLEModeling.getCaesarHost());
+                    this, "Checking LOTOS specification with CAESAR",
+                    gtm.getPathCaesar(),
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getLastRTLOTOSSpecification(),
+                    GTURTLEModeling.getCaesarHost());
             //  jdla.setSize(450, 600);
             GraphicLib.centerOnParent(jdla, 450, 600);
             jdla.setVisible(true);
@@ -4898,12 +4948,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void simulation() {
         if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) {
             JDialogSimulation jds = new JDialogSimulation(frame,
-                                                          this,
-                                                          "Intensive simulation with RTL",
-                                                          gtm.getPathRTL(),
-                                                          REMOTE_RTL_LOTOS_FILE,
-                                                          gtm.getLastRTLOTOSSpecification(),
-                                                          gtm.getHost());
+                    this,
+                    "Intensive simulation with RTL",
+                    gtm.getPathRTL(),
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getLastRTLOTOSSpecification(),
+                    gtm.getHost());
             //jds.setSize(450, 600);
             GraphicLib.centerOnParent(jds, 450, 600);
             jds.setVisible(true);
@@ -4934,17 +4984,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void formalValidation(boolean automatic, TURTLEPanel _tp) {
         if (gtm.getLanguageID() == GTURTLEModeling.RT_LOTOS) {
             JDialogFormalValidation jdfv = new JDialogFormalValidation(frame,
-                                                                       this,
-                                                                       "Formal Validation with RTL",
-                                                                       gtm.getPathRTL(),
-                                                                       gtm.getPathDTA2DOT(),
-                                                                       gtm.getPathRGSTRAP(),
-                                                                       gtm.getPathRG2TLSA(),
-                                                                       REMOTE_RTL_LOTOS_FILE,
-                                                                       gtm.getLastRTLOTOSSpecification(),
-                                                                       gtm.getHost(),
-                                                                       GTURTLEModeling.getHostAldebaran(),
-                                                                       GTURTLEModeling.getPathBcgio());
+                    this,
+                    "Formal Validation with RTL",
+                    gtm.getPathRTL(),
+                    gtm.getPathDTA2DOT(),
+                    gtm.getPathRGSTRAP(),
+                    gtm.getPathRG2TLSA(),
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getLastRTLOTOSSpecification(),
+                    gtm.getHost(),
+                    GTURTLEModeling.getHostAldebaran(),
+                    GTURTLEModeling.getPathBcgio());
             jdfv.setAutomatic(automatic);
             //   jdfv.setSize(450, 600);
             GraphicLib.centerOnParent(jdfv, 450, 600);
@@ -4952,14 +5002,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             dtree.toBeUpdated();
         } else if (gtm.getLanguageID() == GTURTLEModeling.LOTOS) {
             JDialogLOTOSValidation jdla = new JDialogLOTOSValidation(frame,
-                                                                     this, "Generating RG with CAESAR",
-                                                                     gtm.getPathCaesar(),
-                                                                     gtm.getPathCaesarOpen(),
-                                                                     GTURTLEModeling.getPathBcgio(),
-                                                                     gtm.getPathBcgmerge(),
-                                                                     REMOTE_RTL_LOTOS_FILE,
-                                                                     gtm.getLastRTLOTOSSpecification(),
-                                                                     GTURTLEModeling.getCaesarHost());
+                    this, "Generating RG with CAESAR",
+                    gtm.getPathCaesar(),
+                    gtm.getPathCaesarOpen(),
+                    GTURTLEModeling.getPathBcgio(),
+                    gtm.getPathBcgmerge(),
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getLastRTLOTOSSpecification(),
+                    GTURTLEModeling.getCaesarHost());
             jdla.setAutomatic(automatic);
             // jdla.setSize(450, 600);
             GraphicLib.centerOnParent(jdla, 450, 600);
@@ -4967,30 +5017,30 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             dtree.toBeUpdated();
         } else if (gtm.getLanguageID() == GTURTLEModeling.UPPAAL) {
             JDialogUPPAALValidation jduv = new JDialogUPPAALValidation(frame,
-                                                                       this, "Formal Verification with UPPAAL",
-                                                                       gtm.getPathUPPAALVerifier(),
-                                                                       gtm.getPathUPPAALFile(),
-                                                                       REMOTE_UPPAAL_FILE,
-                                                                       gtm.getLastUPPAALSpecification().getStringSpec(),
-                                                                       gtm.getUPPAALVerifierHost(),
-                                                                       _tp);
+                    this, "Formal Verification with UPPAAL",
+                    gtm.getPathUPPAALVerifier(),
+                    gtm.getPathUPPAALFile(),
+                    REMOTE_UPPAAL_FILE,
+                    gtm.getLastUPPAALSpecification().getStringSpec(),
+                    gtm.getUPPAALVerifierHost(),
+                    _tp);
             // jduv.setSize(450, 600);
             GraphicLib.centerOnParent(jduv, 650, 600);
             jduv.setVisible(true);
             dtree.toBeUpdated();
         } else if (gtm.getLanguageID() == GTURTLEModeling.MATRIX) {
             JDialogTMatrixManagement jdfv = new JDialogTMatrixManagement(frame,
-                                                                         this,
-                                                                         "Observers's Based Formal Verification",
-                                                                         gtm.getRequirementModeling(),
-                                                                         gtm.getPathRTL(),
-                                                                         gtm.getPathDTA2DOT(),
-                                                                         gtm.getPathRGSTRAP(),
-                                                                         gtm.getPathRG2TLSA(),
-                                                                         REMOTE_RTL_LOTOS_FILE,
-                                                                         gtm.getHost(),
-                                                                         GTURTLEModeling.getHostAldebaran(),
-                                                                         GTURTLEModeling.getPathBcgio());
+                    this,
+                    "Observers's Based Formal Verification",
+                    gtm.getRequirementModeling(),
+                    gtm.getPathRTL(),
+                    gtm.getPathDTA2DOT(),
+                    gtm.getPathRGSTRAP(),
+                    gtm.getPathRG2TLSA(),
+                    REMOTE_RTL_LOTOS_FILE,
+                    gtm.getHost(),
+                    GTURTLEModeling.getHostAldebaran(),
+                    GTURTLEModeling.getPathBcgio());
             // jdfv.setSize(550, 600);
             jdfv.setIconImage(IconManager.img8);
             GraphicLib.centerOnParent(jdfv, 550, 600);
@@ -5002,19 +5052,19 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void projection() {
         TClassDiagramPanel tcdp = null;
         if (getCurrentTURTLEPanel() instanceof DesignPanel) {
-            tcdp = ((DesignPanel)(getCurrentTURTLEPanel())).tcdp;
+            tcdp = ((DesignPanel) (getCurrentTURTLEPanel())).tcdp;
         }
         JDialogProjection jdfv = new JDialogProjection(frame,
-                                                       this,
-                                                       tcdp,
-                                                       gtm.getTURTLEModeling(),
-                                                       GTURTLEModeling.getHostAldebaran(),
-                                                       GTURTLEModeling.getPathAldebaran(),
-                                                       gtm.getPathBcgmin(),
-                                                       GTURTLEModeling.getPathBcgio(),
-                                                       gtm.getLastRGAUT(),
-                                                       REMOTE_ALDEBARAN_AUT_FILE,
-                                                       "Minimization using Aldebaran");
+                this,
+                tcdp,
+                gtm.getTURTLEModeling(),
+                GTURTLEModeling.getHostAldebaran(),
+                GTURTLEModeling.getPathAldebaran(),
+                gtm.getPathBcgmin(),
+                GTURTLEModeling.getPathBcgio(),
+                gtm.getLastRGAUT(),
+                REMOTE_ALDEBARAN_AUT_FILE,
+                "Minimization using Aldebaran");
         // jdfv.setSize(900, 700);
         GraphicLib.centerOnParent(jdfv, 900, 700);
         jdfv.setVisible(true);
@@ -5022,21 +5072,21 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void modifyGraph() {
         JDialogGraphModification jdgm;
-        if (gtm == null ){
+        if (gtm == null) {
             jdgm = new JDialogGraphModification(frame,
-                                                GTURTLEModeling.getHostAldebaran(),
-                                                GTURTLEModeling.getPathBcgio(),
-                                                "graph",
-                                                "Minimization using Aldebaran",
-                                                null, null);
+                    GTURTLEModeling.getHostAldebaran(),
+                    GTURTLEModeling.getPathBcgio(),
+                    "graph",
+                    "Minimization using Aldebaran",
+                    null, null);
         } else {
             jdgm = new JDialogGraphModification(frame,
-                                                GTURTLEModeling.getHostAldebaran(),
-                                                GTURTLEModeling.getPathBcgio(),
-                                                "graph",
-                                                "Minimization using Aldebaran",
-                                                gtm.getLastRGAUT(),
-                                                gtm.getLastTextualRGAUTProj());
+                    GTURTLEModeling.getHostAldebaran(),
+                    GTURTLEModeling.getPathBcgio(),
+                    "graph",
+                    "Minimization using Aldebaran",
+                    gtm.getLastRGAUT(),
+                    gtm.getLastTextualRGAUTProj());
         }
         //jdgm.setSize(600, 500);
         GraphicLib.centerOnParent(jdgm, 600, 500);
@@ -5052,11 +5102,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void bisimulation() {
         JDialogBisimulation jdb = new JDialogBisimulation(frame,
-                                                          GTURTLEModeling.getHostAldebaran(),
-                                                          GTURTLEModeling.getPathAldebaran(),
-                                                          REMOTE_ALDEBARAN_BISIMU_FILE1,
-                                                          REMOTE_ALDEBARAN_BISIMU_FILE2,
-                                                          "Bisimulation using Aldebaran");
+                GTURTLEModeling.getHostAldebaran(),
+                GTURTLEModeling.getPathAldebaran(),
+                REMOTE_ALDEBARAN_BISIMU_FILE1,
+                REMOTE_ALDEBARAN_BISIMU_FILE2,
+                "Bisimulation using Aldebaran");
         //  jdb.setSize(650, 800);
         GraphicLib.centerOnParent(jdb, 650, 800);
         jdb.setVisible(true);
@@ -5065,12 +5115,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void bisimulationCADP() {
         JDialogBisimulationBisimulator jdb = new JDialogBisimulationBisimulator(frame,
-                                                                                GTURTLEModeling.getCaesarHost(),
-                                                                                GTURTLEModeling.getPathBisimulator(),
-                                                                                GTURTLEModeling.getPathBcgio(),
-                                                                                REMOTE_BISIMULATOR_FILE1,
-                                                                                REMOTE_BISIMULATOR_FILE2,
-                                                                                "Bisimulation using BISIMULATOR");
+                GTURTLEModeling.getCaesarHost(),
+                GTURTLEModeling.getPathBisimulator(),
+                GTURTLEModeling.getPathBcgio(),
+                REMOTE_BISIMULATOR_FILE1,
+                REMOTE_BISIMULATOR_FILE2,
+                "Bisimulation using BISIMULATOR");
         //   jdb.setSize(650, 800);
         GraphicLib.centerOnParent(jdb, 650, 800);
         jdb.setVisible(true);
@@ -5118,17 +5168,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         t.go();
     }
 
-    public void  showAUT(String title, String data, AUTGraph graph) {
+    public void showAUT(String title, String data, AUTGraph graph) {
         ThreadGUIElement t = new ThreadGUIElement(frame, 0, title, data, "Analyzing graph... Please wait", graph, null, true);
         t.go();
     }
 
-    public void  showAUTFromRG(String title, RG rg) {
+    public void showAUTFromRG(String title, RG rg) {
         ThreadGUIElement t = new ThreadGUIElement(frame, 0, title, rg.data, "Analyzing graph... Please wait", rg.graph, rg, true);
         t.go();
     }
 
-    public void  displayAUTFromRG(String title, RG rg) {
+    public void displayAUTFromRG(String title, RG rg) {
         ThreadGUIElement t = new ThreadGUIElement(frame, 0, title, rg.data, "Analyzing graph... Please wait", rg.graph, rg, false);
         t.go();
     }
@@ -5187,9 +5237,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void statAUTDiplodocus() {
         if (lastDiploRG == null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The file could not be loaded:",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The file could not be loaded:",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
         showAUTFromRG(lastDiploRG.name, lastDiploRG);
@@ -5350,14 +5400,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = gtm.showDTA();
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The DTA could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The DTA could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
     public void showWave() {
-        RemoteExecutionThread ret = new RemoteExecutionThread(ConfigurationTTool.SystemCHost, null, null, ConfigurationTTool.GTKWavePath  + " vcddump.vcd");
+        RemoteExecutionThread ret = new RemoteExecutionThread(ConfigurationTTool.SystemCHost, null, null, ConfigurationTTool.GTKWavePath + " vcddump.vcd");
         ret.start();
     }
 
@@ -5365,9 +5415,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = gtm.showRG();
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The RG could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The RG could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
@@ -5375,9 +5425,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = gtm.showTLSA();
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The TLSA could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The TLSA could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
@@ -5385,9 +5435,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = gtm.showRGAut();
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The RG could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The RG could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
@@ -5395,19 +5445,19 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = gtm.showRGAutProj();
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The RG could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The RG could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
     public void showRGDiplodocus() {
         if (lastDiploRG == null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The RG was not yet generated",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
-            return ;
+                    "The RG was not yet generated",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
+            return;
         }
         TraceManager.addDev("Showing diplo RG");
         displayAUTFromRG(lastDiploRG.name, lastDiploRG);
@@ -5418,9 +5468,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         String s = GTURTLEModeling.runDOTTY(modifiedautdot);
         if (s != null) {
             JOptionPane.showMessageDialog(frame,
-                                          "The RG could not be displayed: " + s,
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The RG could not be displayed: " + s,
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
@@ -5430,9 +5480,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             String s = GTURTLEModeling.showGGraph(graph[1]);
             if (s != null) {
                 JOptionPane.showMessageDialog(frame,
-                                              "The graph could not be displayed: " + s,
-                                              "Error",
-                                              JOptionPane.INFORMATION_MESSAGE);
+                        "The graph could not be displayed: " + s,
+                        "Error",
+                        JOptionPane.INFORMATION_MESSAGE);
             }
         }
     }
@@ -5444,9 +5494,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             String s = GTURTLEModeling.showGGraph(graph[1]);
             if (s != null) {
                 JOptionPane.showMessageDialog(frame,
-                                              "The graph could not be displayed: " + s,
-                                              "Error",
-                                              JOptionPane.INFORMATION_MESSAGE);
+                        "The graph could not be displayed: " + s,
+                        "Error",
+                        JOptionPane.INFORMATION_MESSAGE);
             }
         }
     }
@@ -5462,7 +5512,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //Select file
         File file = selectFileForCapture();
         if (file == null)
-        	return;
+            return;
 
         Toolkit toolkit = Toolkit.getDefaultToolkit();
         Dimension screenSize = toolkit.getScreenSize();
@@ -5483,9 +5533,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void diagramCapture() {
         if (tabs.size() < 1) {
             JOptionPane.showMessageDialog(frame,
-                                          "No diagram is under edition",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "No diagram is under edition",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
 
@@ -5506,9 +5556,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         if (tabs.size() < 1) {
             JOptionPane.showMessageDialog(frame,
-                                          "No diagram is under edition",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "No diagram is under edition",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
 
@@ -5524,24 +5574,24 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 FileUtils.saveFile(file.getAbsolutePath(), s);
             } catch (Exception e) {
                 JOptionPane.showMessageDialog(frame,
-                                              "File could not be saved: " + e.getMessage(),
-                                              "Error",
-                                              JOptionPane.INFORMATION_MESSAGE);
+                        "File could not be saved: " + e.getMessage(),
+                        "Error",
+                        JOptionPane.INFORMATION_MESSAGE);
                 return;
             }
             JOptionPane.showMessageDialog(frame,
-                                          "The capture was correctly performed and saved in " + file.getAbsolutePath(),
-                                          "Save in svg format ok",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The capture was correctly performed and saved in " + file.getAbsolutePath(),
+                    "Save in svg format ok",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
     }
 
     public void allDiagramCapture() {
         if (tabs.size() < 1) {
             JOptionPane.showMessageDialog(frame,
-                                          "No diagram is under edition",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "No diagram is under edition",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
 
@@ -5557,49 +5607,49 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         name = name.substring(0, name.length() - 4);
 
         //boolean actions;
-	for(int j=0; j<tabs.size(); j++) {
+        for (int j = 0; j < tabs.size(); j++) {
             tp = tabs.get(j);
-	    for(int i=0; i<tp.panels.size(); i++) {
-		tdp1 = tp.panels.elementAt(i) ;
-		tdp1.repaint();
-		image = tdp1.performMinimalCapture();
-		if (i < 10) {
-		    file1 = new File(name + "0" + i + "__" + tdp1.getName());
-		} else {
-		    file1 = new File(name + i + "__" + tdp1.getName());
-		}
-		file1 = FileUtils.addFileExtensionIfMissing(file1, TImgFilter.getExtension());
-		if (!writeImageCapture(image, file1, false)) {
-		    JOptionPane.showMessageDialog(frame,
-						  "Diagrams could NOT be captured in png format",
-						  "Capture failed",
-						  JOptionPane.INFORMATION_MESSAGE);
-		    return;
-		}
-		if (i ==0) {
-		    if (!writeImageCapture(image, file, false)) {
-			JOptionPane.showMessageDialog(frame,
-						      "Diagrams could NOT be captured in png format",
-						      "Capture failed",
-						      JOptionPane.INFORMATION_MESSAGE);
-			return;
-		    }
-		}
-	    }
+            for (int i = 0; i < tp.panels.size(); i++) {
+                tdp1 = tp.panels.elementAt(i);
+                tdp1.repaint();
+                image = tdp1.performMinimalCapture();
+                if (i < 10) {
+                    file1 = new File(name + "0" + i + "__" + tdp1.getName());
+                } else {
+                    file1 = new File(name + i + "__" + tdp1.getName());
+                }
+                file1 = FileUtils.addFileExtensionIfMissing(file1, TImgFilter.getExtension());
+                if (!writeImageCapture(image, file1, false)) {
+                    JOptionPane.showMessageDialog(frame,
+                            "Diagrams could NOT be captured in png format",
+                            "Capture failed",
+                            JOptionPane.INFORMATION_MESSAGE);
+                    return;
+                }
+                if (i == 0) {
+                    if (!writeImageCapture(image, file, false)) {
+                        JOptionPane.showMessageDialog(frame,
+                                "Diagrams could NOT be captured in png format",
+                                "Capture failed",
+                                JOptionPane.INFORMATION_MESSAGE);
+                        return;
+                    }
+                }
+            }
         }
 
         JOptionPane.showMessageDialog(frame,
-                                      "All diagrams were sucessfully captured in png format",
-                                      "Capture ok",
-                                      JOptionPane.INFORMATION_MESSAGE);
+                "All diagrams were sucessfully captured in png format",
+                "Capture ok",
+                JOptionPane.INFORMATION_MESSAGE);
     }
 
     public void allDiagramCaptureSvg() {
         if (tabs.size() < 1) {
             JOptionPane.showMessageDialog(frame,
-                                          "No diagram is under edition",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "No diagram is under edition",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
 
@@ -5615,9 +5665,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         name = name.substring(0, name.length() - 4);
 
         //boolean actions;
-        for(int j=0; j<tabs.size(); j++) {
+        for (int j = 0; j < tabs.size(); j++) {
             tp = tabs.get(j);
-            for(int i=0; i<tp.panels.size(); i++) {
+            for (int i = 0; i < tp.panels.size(); i++) {
                 tdp1 = tp.panels.elementAt(i);
                 tdp1.repaint();
 
@@ -5631,13 +5681,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 }
                 file1 = FileUtils.addFileExtensionIfMissing(file1, TSVGFilter.getExtension());
                 try {
-		    TraceManager.addDev("Saving in file:" + file1.getAbsolutePath());
+                    TraceManager.addDev("Saving in file:" + file1.getAbsolutePath());
                     FileUtils.saveFile(file1, svgImg);
-                } catch(Exception e) {
+                } catch (Exception e) {
                     JOptionPane.showMessageDialog(frame,
-                                                  "Diagrams could NOT be captured in svg format",
-                                                  "Capture failed",
-                                                  JOptionPane.INFORMATION_MESSAGE);
+                            "Diagrams could NOT be captured in svg format",
+                            "Capture failed",
+                            JOptionPane.INFORMATION_MESSAGE);
                     return;
                 }
 
@@ -5645,9 +5695,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         JOptionPane.showMessageDialog(frame,
-                                      "All diagrams were sucessfully captured in svg format",
-                                      "Capture ok",
-                                      JOptionPane.INFORMATION_MESSAGE);
+                "All diagrams were sucessfully captured in svg format",
+                "Capture ok",
+                JOptionPane.INFORMATION_MESSAGE);
     }
 
     public void selectedCapture() {
@@ -5663,18 +5713,18 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfcimg.setCurrentDirectory(new File(SpecConfigTTool.IMGPath));
         int returnVal = jfcimg.showSaveDialog(frame);
         if (returnVal == JFileChooser.CANCEL_OPTION)
-        	return null;
+            return null;
 
-        if(returnVal == JFileChooser.APPROVE_OPTION) {
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
             file = jfcimg.getSelectedFile();
             file = FileUtils.addFileExtensionIfMissing(file, TImgFilter.getExtension());
 
         }
-        if(!checkFileForSave(file)) {
+        if (!checkFileForSave(file)) {
             JOptionPane.showMessageDialog(frame,
-                                          "The capture could not be performed: invalid file",
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The capture could not be performed: invalid file",
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return null;
         }
         return file;
@@ -5685,25 +5735,25 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         jfcimgsvg.setCurrentDirectory(new File(SpecConfigTTool.IMGPath));
         int returnVal = jfcimgsvg.showSaveDialog(frame);
         if (returnVal == JFileChooser.CANCEL_OPTION)
-        	return null;
+            return null;
 
-        if(returnVal == JFileChooser.APPROVE_OPTION) {
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
             file = jfcimgsvg.getSelectedFile();
             file = FileUtils.addFileExtensionIfMissing(file, TSVGFilter.getExtension());
 
         }
-	if (checkForSave) {
-	    if(!checkFileForSave(file)) {
-		JOptionPane.showMessageDialog(frame,
-					      "The capture could not be performed: invalid file",
-					      "Error",
-					      JOptionPane.INFORMATION_MESSAGE);
-		return null;
-	    }
-	}
+        if (checkForSave) {
+            if (!checkFileForSave(file)) {
+                JOptionPane.showMessageDialog(frame,
+                        "The capture could not be performed: invalid file",
+                        "Error",
+                        JOptionPane.INFORMATION_MESSAGE);
+                return null;
+            }
+        }
         return file;
     }
-    
+
 
     public void performScreenCapture(Rectangle rect, File file) {
         frame.paint(frame.getGraphics());
@@ -5714,15 +5764,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             ImageIO.write(image, "png", file);
         } catch (Exception e) {
             JOptionPane.showMessageDialog(frame,
-                                          "The capture could not be performed:" + e.getMessage(),
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The capture could not be performed:" + e.getMessage(),
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return;
         }
         JOptionPane.showMessageDialog(frame,
-                                      "The capture was correctly performed",
-                                      "Screen capture ok",
-                                      JOptionPane.INFORMATION_MESSAGE);
+                "The capture was correctly performed",
+                "Screen capture ok",
+                JOptionPane.INFORMATION_MESSAGE);
         return;
     }
 
@@ -5733,23 +5783,23 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             ImageIO.write(image, "png", file);
         } catch (Exception e) {
             JOptionPane.showMessageDialog(frame,
-                                          "The capture could not be performed:" + e.getMessage(),
-                                          "Error",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The capture could not be performed:" + e.getMessage(),
+                    "Error",
+                    JOptionPane.INFORMATION_MESSAGE);
             return false;
         }
         if (info) {
             JOptionPane.showMessageDialog(frame,
-                                          "The capture was correctly performed and saved in " + file.getAbsolutePath(),
-                                          "Screen capture ok",
-                                          JOptionPane.INFORMATION_MESSAGE);
+                    "The capture was correctly performed and saved in " + file.getAbsolutePath(),
+                    "Screen capture ok",
+                    JOptionPane.INFORMATION_MESSAGE);
         }
         return true;
     }
 
     public void generateDocumentation() {
         //TraceManager.addDev("Documentation");
-        ThreadGUIElement t = new ThreadGUIElement(frame, 1, tabs, mainTabbedPane, SpecConfigTTool.DocGenPath, file.getName(),"Documentation", "Generating documentation ... Please wait");
+        ThreadGUIElement t = new ThreadGUIElement(frame, 1, tabs, mainTabbedPane, SpecConfigTTool.DocGenPath, file.getName(), "Documentation", "Generating documentation ... Please wait");
         t.go();
         /*DocumentationGenerator docgen = new DocumentationGenerator(tabs, mainTabbedPane, ConfigurationTTool.IMGPath, file.getName());
           docgen.setFirstHeadingNumber(2);
@@ -5773,9 +5823,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         GraphicLib.centerOnParent(jdrt);
         jdrt.setVisible(true);
         if (!jdrt.hasBeenCancelled()) {
-            Point [] pts = jdrt.getColumnsInfo();
+            Point[] pts = jdrt.getColumnsInfo();
             if (pts != null) {
-                for(int i=0; i<pts.length; i++) {
+                for (int i = 0; i < pts.length; i++) {
                     TraceManager.addDev("" + i + ": (" + pts[i].x + ", " + pts[i].y + ")");
                 }
 
@@ -5823,41 +5873,41 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return idButtonSelected;
     }
 
-    public void addTClass(TURTLEPanel tp, String s)     {
+    public void addTClass(TURTLEPanel tp, String s) {
         if (!(tp instanceof DesignPanel)) {
             return;
         }
 
-        ((DesignPanel)tp).addTActivityDiagram(s);
+        ((DesignPanel) tp).addTActivityDiagram(s);
         setPanelMode();
     }
 
-    public void addTOSClass(TURTLEPanel tp, String s)   {
+    public void addTOSClass(TURTLEPanel tp, String s) {
         if (!(tp instanceof TURTLEOSDesignPanel)) {
             return;
         }
 
-        ((TURTLEOSDesignPanel)tp).addTURTLEOSActivityDiagram(s);
+        ((TURTLEOSDesignPanel) tp).addTURTLEOSActivityDiagram(s);
         setPanelMode();
     }
 
-    public void addTMLTask(TURTLEPanel tp, String s)    {
+    public void addTMLTask(TURTLEPanel tp, String s) {
         //TraceManager.addDev("ADD TML Task=" + s);
         if (!(tp instanceof TMLDesignPanel)) {
             return;
         }
 
-        ((TMLDesignPanel)tp).addTMLActivityDiagram(s);
+        ((TMLDesignPanel) tp).addTMLActivityDiagram(s);
         setPanelMode();
     }
 
-    public void addTMLCPrimitiveComponent(TURTLEPanel tp, String s)     {
+    public void addTMLCPrimitiveComponent(TURTLEPanel tp, String s) {
         //TraceManager.addDev("ADD C Primitive Component=" + s);
         if (!(tp instanceof TMLComponentDesignPanel)) {
             return;
         }
 
-        ((TMLComponentDesignPanel)tp).addTMLActivityDiagram(s);
+        ((TMLComponentDesignPanel) tp).addTMLActivityDiagram(s);
         setPanelMode();
     }
 
@@ -5865,11 +5915,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         TMLActivityDiagramPanel tmladp;
         //TraceManager.addDev("global search for: " + name);
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
                 if (tp.hasTDiagramPanel(_tdp)) {
-                    tmladp = ((TMLComponentDesignPanel)tp).getTMLActivityDiagramPanel(name);
+                    tmladp = ((TMLComponentDesignPanel) tp).getTMLActivityDiagramPanel(name);
                     if (tmladp != null) {
                         //TraceManager.addDev("Found");
                         return tmladp;
@@ -5884,7 +5934,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public TURTLEPanel getTURTLEPanelOfTDiagramPanel(TDiagramPanel _tdp) {
         TURTLEPanel tp;
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
                 if (tp.hasTDiagramPanel(_tdp)) {
@@ -5900,10 +5950,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         ArrayList<EBRDDPanel> al = new ArrayList<EBRDDPanel>();
         //TraceManager.addDev("global search for: " + name);
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof RequirementPanel) {
-                ((RequirementPanel)tp).addAllEBRDDPanels(al);
+                ((RequirementPanel) tp).addAllEBRDDPanels(al);
             }
         }
 
@@ -5914,10 +5964,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         ArrayList<AvatarPDPanel> al = new ArrayList<AvatarPDPanel>();
         //TraceManager.addDev("global search for: " + name);
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof AvatarRequirementPanel) {
-                ((AvatarRequirementPanel)tp).addAllAvatarPDPanels(al);
+                ((AvatarRequirementPanel) tp).addAllAvatarPDPanels(al);
             }
         }
 
@@ -5928,23 +5978,23 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         List<TGComponent> ll = new LinkedList<TGComponent>();
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
 
             if (tp instanceof TMLComponentDesignPanel) {
-                ll.addAll(((TMLComponentDesignPanel)tp).tmlctdp.getComponentList());
+                ll.addAll(((TMLComponentDesignPanel) tp).tmlctdp.getComponentList());
             }
         }
 
         return ll;
     }
 
-    public void removeTClass(TURTLEPanel tp, String s)  {
+    public void removeTClass(TURTLEPanel tp, String s) {
         if (!(tp instanceof DesignPanel)) {
             return;
         }
 
-        for(int i = 0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 tp.tabbedPane.removeTabAt(i);
                 tp.panels.removeElementAt(i);
@@ -5954,13 +6004,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
     }
 
-    public void removeTOSClass(TURTLEPanel tp, String s)        {
+    public void removeTOSClass(TURTLEPanel tp, String s) {
         if (!(tp instanceof TURTLEOSDesignPanel)) {
             return;
         }
 
         TraceManager.addDev("Removing tab ...");
-        for(int i = 0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 tp.tabbedPane.removeTabAt(i);
                 tp.panels.removeElementAt(i);
@@ -5975,7 +6025,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return;
         }
 
-        for(int i = 0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 tp.tabbedPane.removeTabAt(i);
                 tp.panels.removeElementAt(i);
@@ -5985,11 +6035,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
     }
 
-    public void removeAvatarBlock (TURTLEPanel tp, String s) {
+    public void removeAvatarBlock(TURTLEPanel tp, String s) {
         if (!(tp instanceof AvatarDesignPanel))
             return;
 
-        for (int i=0; i<tp.tabbedPane.getTabCount(); i++)
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++)
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 tp.tabbedPane.removeTabAt(i);
                 tp.panels.removeElementAt(i);
@@ -5998,14 +6048,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             }
     }
 
-    public void removeTMLCPrimitiveComponent(TURTLEPanel tp, String s)  {
+    public void removeTMLCPrimitiveComponent(TURTLEPanel tp, String s) {
         //TraceManager.addDev("Removing panel 0:" + s);
         if (!(tp instanceof TMLComponentDesignPanel)) {
             return;
         }
 
         //TraceManager.addDev("Removing panel 1:" + s);
-        for(int i = 0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 tp.tabbedPane.removeTabAt(i);
                 tp.panels.removeElementAt(i);
@@ -6023,7 +6073,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public String getTabName(TURTLEPanel p) {
         int index = tabs.indexOf(p);
-        if (index<0) {
+        if (index < 0) {
             return "";
         }
         return mainTabbedPane.getTitleAt(index);
@@ -6032,7 +6082,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public int getMajorIndexOf(TDiagramPanel tdp) {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size();i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp.panels.contains(tdp)) {
                 return i;
@@ -6056,10 +6106,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TURTLEPanel tp;
         ArrayList<TMLComponentTaskDiagramPanel> foundPanels = new ArrayList<TMLComponentTaskDiagramPanel>();
 
-        for(int i=0; i<tabs.size();i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
-                ((TMLComponentDesignPanel)tp).tmlctdp.getPanelsUsingAComponent(tmlcc, foundPanels);
+                ((TMLComponentDesignPanel) tp).tmlctdp.getPanelsUsingAComponent(tmlcc, foundPanels);
             }
         }
 
@@ -6069,10 +6119,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void updateReferenceToTMLCCompositeComponent(TMLCCompositeComponent tmlcc) {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size();i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLComponentDesignPanel) {
-                ((TMLComponentDesignPanel)tp).tmlctdp.updateReferenceToTMLCCompositeComponent(tmlcc);
+                ((TMLComponentDesignPanel) tp).tmlctdp.updateReferenceToTMLCCompositeComponent(tmlcc);
             }
         }
     }
@@ -6084,7 +6134,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         String panelName = name.substring(0, index);
-        String componentName = name.substring(index+2, name.length());
+        String componentName = name.substring(index + 2, name.length());
 
         TURTLEPanel tp = getTURTLEPanel(panelName);
 
@@ -6093,7 +6143,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
 
-        return ((TMLComponentDesignPanel)(tp)).tmlctdp.getCompositeComponentByName(componentName);
+        return ((TMLComponentDesignPanel) (tp)).tmlctdp.getCompositeComponentByName(componentName);
     }
 
     public AvatarSMDPanel getAvatarSMDPanel(int indexDesign, String name) {
@@ -6104,7 +6154,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
         if (tp instanceof AvatarDesignPanel) {
-            return ((AvatarDesignPanel)tp).getAvatarSMDPanel(name);
+            return ((AvatarDesignPanel) tp).getAvatarSMDPanel(name);
         }
         TraceManager.addDev("null ADP :" + name);
         return null;
@@ -6116,7 +6166,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
         if (tp instanceof DesignPanel) {
-            return ((DesignPanel)tp).getActivityDiagramPanel(name);
+            return ((DesignPanel) tp).getActivityDiagramPanel(name);
         }
         return null;
     }
@@ -6127,7 +6177,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
         if (tp instanceof TURTLEOSDesignPanel) {
-            return ((TURTLEOSDesignPanel)tp).getTURTLEOSActivityDiagramPanel(name);
+            return ((TURTLEOSDesignPanel) tp).getTURTLEOSActivityDiagramPanel(name);
         }
         return null;
     }
@@ -6138,10 +6188,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
         if (tp instanceof TMLDesignPanel) {
-            return ((TMLDesignPanel)tp).getTMLActivityDiagramPanel(name);
+            return ((TMLDesignPanel) tp).getTMLActivityDiagramPanel(name);
         }
         if (tp instanceof TMLComponentDesignPanel) {
-            return ((TMLComponentDesignPanel)tp).getTMLActivityDiagramPanel(name);
+            return ((TMLComponentDesignPanel) tp).getTMLActivityDiagramPanel(name);
         }
         return null;
     }
@@ -6152,7 +6202,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
         if (tp instanceof ProactiveDesignPanel) {
-            return ((ProactiveDesignPanel)tp).getSMDPanel(name);
+            return ((ProactiveDesignPanel) tp).getSMDPanel(name);
         }
         return null;
     }
@@ -6161,10 +6211,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TDiagramPanel tdp;
         int cpt = 0;
 
-        for(int i = 0; i<getCurrentJTabbedPane().getTabCount(); i++) {
+        for (int i = 0; i < getCurrentJTabbedPane().getTabCount(); i++) {
             tdp = getCurrentTURTLEPanel().panels.elementAt(i);
             if (tdp instanceof TActivityDiagramPanel) {
-                cpt ++;
+                cpt++;
             }
         }
         return cpt;
@@ -6261,8 +6311,6 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
 
-
-
     // IOD, SD
 
     public boolean isSDCreated(int index, String s) {
@@ -6389,16 +6437,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createTMLCPSequenceDiagram(TURTLEPanel tp, String s) {
-        if(isSDCreated(tp, s)) {
+        if (isSDCreated(tp, s)) {
             return false;
         }
 
-        if (!(tp instanceof TMLCommunicationPatternPanel) ) {
+        if (!(tp instanceof TMLCommunicationPatternPanel)) {
             return false;
         }
 
 
-        ((TMLCommunicationPatternPanel)tp).addCPSequenceDiagram(s);
+        ((TMLCommunicationPatternPanel) tp).addCPSequenceDiagram(s);
 
         setPanelMode();
         return true;
@@ -6406,13 +6454,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean createUniqueTMLCPSequenceDiagram(TURTLEPanel tp, String s) {
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isTMLCPSDCreated(tp, s+i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isTMLCPSDCreated(tp, s + i)) {
                 break;
             }
         }
 
-        ((TMLCommunicationPatternPanel)tp).addCPSequenceDiagram(s+i);
+        ((TMLCommunicationPatternPanel) tp).addCPSequenceDiagram(s + i);
 
         setPanelMode();
         return true;
@@ -6423,7 +6471,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createTMLCPDiagram(TURTLEPanel tp, String s) {
-        if(isTMLCPCreated(tp, s)) {
+        if (isTMLCPCreated(tp, s)) {
             return false;
         }
 
@@ -6431,7 +6479,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((TMLCommunicationPatternPanel)tp).addCPDiagram(s);
+        ((TMLCommunicationPatternPanel) tp).addCPDiagram(s);
         setPanelMode();
         return true;
     }
@@ -6460,8 +6508,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public AttackTreeDiagramPanel getAttackTreeDiagramPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AttackTreeDiagramPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AttackTreeDiagramPanel) (tp.panelAt(indexTab));
         }
         return null;
         /*for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
@@ -6480,8 +6528,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public FaultTreeDiagramPanel getFaultTreeDiagramPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (FaultTreeDiagramPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (FaultTreeDiagramPanel) (tp.panelAt(indexTab));
         }
         return null;
         /*for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
@@ -6501,10 +6549,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public TMLCPPanel getTMLCPDiagramPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof TMLCPPanel)
-                    return  (TMLCPPanel)(tp.panelAt(i));
+                    return (TMLCPPanel) (tp.panelAt(i));
             }
         }
         return null;
@@ -6517,10 +6565,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public TMLSDPanel getTMLCPSDDiagramPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof TMLSDPanel)
-                    return  (TMLSDPanel)(tp.panelAt(i));
+                    return (TMLSDPanel) (tp.panelAt(i));
             }
         }
         return null;
@@ -6533,30 +6581,30 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public ui.sd.SequenceDiagramPanel getSequenceDiagramPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof ui.sd.SequenceDiagramPanel)
-                    return  (ui.sd.SequenceDiagramPanel)(tp.panelAt(i));
+                    return (ui.sd.SequenceDiagramPanel) (tp.panelAt(i));
             }
         }
         return null;
     }
 
     public ui.sd2.SequenceDiagramPanel getSequenceDiagramPanelZV(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof ui.sd2.SequenceDiagramPanel)
-                    return  (ui.sd2.SequenceDiagramPanel)(tp.panelAt(i));
+                    return (ui.sd2.SequenceDiagramPanel) (tp.panelAt(i));
             }
         }
         return null;
     }
 
     public InteractionOverviewDiagramPanel getIODiagramPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof InteractionOverviewDiagramPanel)
-                    return  (InteractionOverviewDiagramPanel)(tp.panelAt(i));
+                    return (InteractionOverviewDiagramPanel) (tp.panelAt(i));
             }
         }
         return null;
@@ -6569,8 +6617,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public UseCaseDiagramPanel getUseCaseDiagramPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (UseCaseDiagramPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (UseCaseDiagramPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -6580,7 +6628,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createSequenceDiagram(TURTLEPanel tp, String s) {
-        if(isSDCreated(tp, s)) {
+        if (isSDCreated(tp, s)) {
             return false;
         }
 
@@ -6589,19 +6637,20 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addSequenceDiagram(s);
+            ((AnalysisPanel) tp).addSequenceDiagram(s);
         } else if (tp instanceof AvatarAnalysisPanel) {
-            ((AvatarAnalysisPanel)tp).addSequenceDiagram(s);
+            ((AvatarAnalysisPanel) tp).addSequenceDiagram(s);
         }
         setPanelMode();
         return true;
     }
+
     public boolean createSequenceDiagramZV(int index, String s) {
         return createSequenceDiagramZV(tabs.elementAt(index), s);
     }
 
     public boolean createSequenceDiagramZV(TURTLEPanel tp, String s) {
-        if(isSDCreated(tp, s)) {
+        if (isSDCreated(tp, s)) {
             return false;
         }
 
@@ -6610,9 +6659,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addSequenceDiagramZV(s);
+            ((AnalysisPanel) tp).addSequenceDiagramZV(s);
         } else if (tp instanceof AvatarAnalysisPanel) {
-            ((AvatarAnalysisPanel)tp).addSequenceDiagramZV(s);
+            ((AvatarAnalysisPanel) tp).addSequenceDiagramZV(s);
         }
         setPanelMode();
         return true;
@@ -6620,16 +6669,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean createUniqueSequenceDiagram(TURTLEPanel tp, String s) {
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isSDCreated(tp, s+i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isSDCreated(tp, s + i)) {
                 break;
             }
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addSequenceDiagram(s+i);
+            ((AnalysisPanel) tp).addSequenceDiagram(s + i);
         } else if (tp instanceof AvatarAnalysisPanel) {
-            ((AvatarAnalysisPanel)tp).addSequenceDiagram(s+i);
+            ((AvatarAnalysisPanel) tp).addSequenceDiagram(s + i);
         }
 
         setPanelMode();
@@ -6639,16 +6688,16 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean createUniqueSequenceDiagramZV(TURTLEPanel tp, String s) {
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isSDCreated(tp, s+i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isSDCreated(tp, s + i)) {
                 break;
             }
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addSequenceDiagramZV(s+i);
+            ((AnalysisPanel) tp).addSequenceDiagramZV(s + i);
         } else if (tp instanceof AvatarAnalysisPanel) {
-            ((AvatarAnalysisPanel)tp).addSequenceDiagramZV(s+i);
+            ((AvatarAnalysisPanel) tp).addSequenceDiagramZV(s + i);
         }
 
         setPanelMode();
@@ -6660,27 +6709,26 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        if (! ((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel))) {
+        if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel))) {
             return false;
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addInstancesToLastSD(_ucdp);
+            ((AnalysisPanel) tp).addInstancesToLastSD(_ucdp);
         } else if (tp instanceof AvatarAnalysisPanel) {
-            ((AvatarAnalysisPanel)tp).addInstancesToLastSD(_ucdp);
+            ((AvatarAnalysisPanel) tp).addInstancesToLastSD(_ucdp);
         }
 
         return true;
     }
 
 
-
     public boolean createIODiagram(int index, String s) {
         return createIODiagram(tabs.elementAt(index), s);
     }
 
     public boolean createIODiagram(TURTLEPanel tp, String s) {
-        if(isIODCreated(tp, s)) {
+        if (isIODCreated(tp, s)) {
             return false;
         }
 
@@ -6688,7 +6736,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((AnalysisPanel)tp).addIODiagram(s);
+        ((AnalysisPanel) tp).addIODiagram(s);
         setPanelMode();
         return true;
     }
@@ -6698,35 +6746,35 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createUniqueUseCaseDiagram(TURTLEPanel tp, String s) {
-        if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel)))  {
+        if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel))) {
             return false;
         }
 
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isUseCaseDiagramCreated(tp, s + " " + i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isUseCaseDiagramCreated(tp, s + " " + i)) {
                 break;
             }
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addUseCaseDiagram(s + " " + i);
+            ((AnalysisPanel) tp).addUseCaseDiagram(s + " " + i);
         } else {
-            ((AvatarAnalysisPanel)tp).addUseCaseDiagram(s + " " + i);
+            ((AvatarAnalysisPanel) tp).addUseCaseDiagram(s + " " + i);
         }
         setPanelMode();
         return true;
     }
 
     public boolean createUseCaseDiagram(TURTLEPanel tp, String s) {
-        if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel)))  {
+        if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel))) {
             return false;
         }
 
         if (tp instanceof AnalysisPanel) {
-            ((AnalysisPanel)tp).addUseCaseDiagram(s);
+            ((AnalysisPanel) tp).addUseCaseDiagram(s);
         } else {
-            ((AvatarAnalysisPanel)tp).addUseCaseDiagram(s);
+            ((AvatarAnalysisPanel) tp).addUseCaseDiagram(s);
         }
         setPanelMode();
         return true;
@@ -6737,18 +6785,18 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createUniqueAvatarCD(TURTLEPanel tp, String s) {
-        if (!(tp instanceof AvatarAnalysisPanel))  {
+        if (!(tp instanceof AvatarAnalysisPanel)) {
             return false;
         }
 
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isAvatarCDCreated(tp, s + " " + i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isAvatarCDCreated(tp, s + " " + i)) {
                 break;
             }
         }
 
-        ((AvatarAnalysisPanel)tp).addAvatarContextDiagram(s + " " + i);
+        ((AvatarAnalysisPanel) tp).addAvatarContextDiagram(s + " " + i);
 
 
         setPanelMode();
@@ -6756,12 +6804,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public boolean createAvatarCD(TURTLEPanel tp, String s) {
-        if (!(tp instanceof AvatarAnalysisPanel))  {
+        if (!(tp instanceof AvatarAnalysisPanel)) {
             return false;
         }
 
 
-        ((AvatarAnalysisPanel)tp).addAvatarContextDiagram(s);
+        ((AvatarAnalysisPanel) tp).addAvatarContextDiagram(s);
 
 
         setPanelMode();
@@ -6778,13 +6826,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         int i;
-        for(i=0; i<1000; i++) {
-            if(!isAvatarADCreated(tp, s + " " + i)) {
+        for (i = 0; i < 1000; i++) {
+            if (!isAvatarADCreated(tp, s + " " + i)) {
                 break;
             }
         }
 
-        ((AvatarAnalysisPanel)tp).addAvatarActivityDiagram(s + " " + i);
+        ((AvatarAnalysisPanel) tp).addAvatarActivityDiagram(s + " " + i);
         setPanelMode();
         return true;
     }
@@ -6795,7 +6843,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
 
-        ((AvatarAnalysisPanel)tp).addAvatarActivityDiagram(s);
+        ((AvatarAnalysisPanel) tp).addAvatarActivityDiagram(s);
 
         setPanelMode();
         return true;
@@ -6804,8 +6852,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     //Changed by Solange from public boolean...
     public String createProActiveSMD(int index, String s) {
         //Adde by Solange String name at  the beginning
-        String name=createProActiveSMD(tabs.elementAt(index), s);
-        return(name); //changed from return true
+        String name = createProActiveSMD(tabs.elementAt(index), s);
+        return (name); //changed from return true
     }
 
     //Return changed by Solange from boolean to String
@@ -6813,14 +6861,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         //Added by Solange. It fills the lists of components, interfaces, etc
         TURTLEPanel tp2 = getCurrentTURTLEPanel();
-        gtm.generateLists((ProactiveDesignPanel)tp2);
+        gtm.generateLists((ProactiveDesignPanel) tp2);
         //
 
         if (!(tp instanceof ProactiveDesignPanel)) {
             return null; //Changed by Solange from return false
         }
 
-        s=((ProactiveDesignPanel)tp).addSMD(s);
+        s = ((ProactiveDesignPanel) tp).addSMD(s);
         //Added by Solange
         //  ProactiveSMDPanel temp=((ProactiveDesignPanel)tp).getSMDPanel(s);
         //Added by Solange
@@ -6844,7 +6892,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         */
         //
         setPanelMode();
-        return(s); //Changes by Solange from return true
+        return (s); //Changes by Solange from return true
     }
 
     public boolean createAvatarRD(int index, String s) {
@@ -6856,7 +6904,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((AvatarRequirementPanel)tp).addAvatarRD(s);
+        ((AvatarRequirementPanel) tp).addAvatarRD(s);
         setPanelMode();
         return true;
     }
@@ -6870,7 +6918,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((AvatarMADsPanel)tp).addAvatarMADPanel(s);
+        ((AvatarMADsPanel) tp).addAvatarMADPanel(s);
         setPanelMode();
         return true;
     }
@@ -6884,7 +6932,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((AvatarRequirementPanel)tp).addAvatarPD(s);
+        ((AvatarRequirementPanel) tp).addAvatarPD(s);
         setPanelMode();
         return true;
     }
@@ -6898,7 +6946,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((ADDPanel)tp).addDeploymentPanelDiagram(s);
+        ((ADDPanel) tp).addDeploymentPanelDiagram(s);
         setPanelMode();
         return true;
     }
@@ -6925,7 +6973,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((RequirementPanel)tp).addRequirementDiagram(s);
+        ((RequirementPanel) tp).addRequirementDiagram(s);
         setPanelMode();
         return true;
     }
@@ -6939,7 +6987,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((AttackTreePanel)tp).addAttackTreeDiagram(s);
+        ((AttackTreePanel) tp).addAttackTreeDiagram(s);
         setPanelMode();
         return true;
     }
@@ -6953,7 +7001,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((FaultTreePanel)tp).addFaultTreeDiagram(s);
+        ((FaultTreePanel) tp).addFaultTreeDiagram(s);
         setPanelMode();
         return true;
     }
@@ -6967,7 +7015,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return false;
         }
 
-        ((RequirementPanel)tp).addEBRDD(s);
+        ((RequirementPanel) tp).addEBRDD(s);
         setPanelMode();
         return true;
     }
@@ -6996,7 +7044,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void generateOntologyForAllDiagrams() {
         TraceManager.addDev("Ontology for all diagrams");
         try {
-            /*String modeling =*/ gtm.makeXMLFromTurtleModeling(-1);
+            /*String modeling =*/
+            gtm.makeXMLFromTurtleModeling(-1);
             TraceManager.addDev("Model made");
         } catch (Exception e) {
         }
@@ -7004,15 +7053,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
 
-
     public AvatarRDPanel getAvatarRDPanel(int index, int indexTab, String s) {
         TURTLEPanel tp = tabs.elementAt(index);
         return getAvatarRDPanel(tp, indexTab, s);
     }
 
     public AvatarRDPanel getAvatarRDPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AvatarRDPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AvatarRDPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7023,8 +7071,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public AvatarMADPanel getAvatarMADPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AvatarMADPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AvatarMADPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7046,17 +7094,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public AvatarPDPanel getAvatarPDPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AvatarPDPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AvatarPDPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
 
     public ADDDiagramPanel getAvatarADDPanel(TURTLEPanel tp, int indexTab, String s) {
-        TraceManager.addDev("index=" + indexTab + " s=" + s + "title=" +tp.tabbedPane.getTitleAt(indexTab));
+        TraceManager.addDev("index=" + indexTab + " s=" + s + "title=" + tp.tabbedPane.getTitleAt(indexTab));
 
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (ADDDiagramPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (ADDDiagramPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7065,7 +7113,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //TraceManager.addDev("index=" + indexTab + " s=" + s + "title=" +tp.tabbedPane.getTitleAt(indexTab));
 
         //if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-        return (ADDDiagramPanel)(tp.panelAt(indexTab));
+        return (ADDDiagramPanel) (tp.panelAt(indexTab));
         //}
 
     }
@@ -7077,8 +7125,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public AvatarCDPanel getAvatarCDPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AvatarCDPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AvatarCDPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7090,8 +7138,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public AvatarADPanel getAvatarADPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (AvatarADPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (AvatarADPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7103,10 +7151,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public RequirementDiagramPanel getRequirementDiagramPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof RequirementDiagramPanel)
-                    return  (RequirementDiagramPanel)(tp.panelAt(i));
+                    return (RequirementDiagramPanel) (tp.panelAt(i));
             }
         }
         return null;
@@ -7119,8 +7167,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public RequirementDiagramPanel getRequirementDiagramPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (RequirementDiagramPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (RequirementDiagramPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7132,10 +7180,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public EBRDDPanel getEBRDDPanel(TURTLEPanel tp, String s) {
-        for(int i=0; i<tp.tabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < tp.tabbedPane.getTabCount(); i++) {
             if (tp.tabbedPane.getTitleAt(i).equals(s)) {
                 if (tp.panelAt(i) instanceof EBRDDPanel)
-                    return  (EBRDDPanel)(tp.panelAt(i));
+                    return (EBRDDPanel) (tp.panelAt(i));
             }
         }
         return null;
@@ -7148,8 +7196,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
 
     public EBRDDPanel getEBRDDPanel(TURTLEPanel tp, int indexTab, String s) {
-        if(tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
-            return (EBRDDPanel)(tp.panelAt(indexTab));
+        if (tp.tabbedPane.getTitleAt(indexTab).equals(s)) {
+            return (EBRDDPanel) (tp.panelAt(indexTab));
         }
         return null;
     }
@@ -7157,19 +7205,19 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void alignInstances() {
         //TraceManager.addDev("Align instances");
         if (getCurrentTDiagramPanel() instanceof ui.sd.SequenceDiagramPanel) {
-            ((ui.sd.SequenceDiagramPanel)(getCurrentTDiagramPanel())).alignInstances();
+            ((ui.sd.SequenceDiagramPanel) (getCurrentTDiagramPanel())).alignInstances();
             changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT);
             getCurrentTDiagramPanel().repaint();
         }
 
         if (getCurrentTDiagramPanel() instanceof ui.sd2.SequenceDiagramPanel) {
-            ((ui.sd2.SequenceDiagramPanel)(getCurrentTDiagramPanel())).alignInstances();
+            ((ui.sd2.SequenceDiagramPanel) (getCurrentTDiagramPanel())).alignInstances();
             changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT);
             getCurrentTDiagramPanel().repaint();
         }
 
         if (getCurrentTDiagramPanel() instanceof TMLSDPanel) {
-            ((TMLSDPanel)(getCurrentTDiagramPanel())).alignInstances();
+            ((TMLSDPanel) (getCurrentTDiagramPanel())).alignInstances();
             changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT);
             getCurrentTDiagramPanel().repaint();
         }
@@ -7178,7 +7226,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void alignPartitions() {
         //TraceManager.addDev("Align instances");
         if (getCurrentTDiagramPanel() instanceof AvatarADPanel) {
-            ((AvatarADPanel)(getCurrentTDiagramPanel())).alignPartitions();
+            ((AvatarADPanel) (getCurrentTDiagramPanel())).alignPartitions();
             changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT);
             getCurrentTDiagramPanel().repaint();
         }
@@ -7210,13 +7258,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return tabs.elementAt(mainTabbedPane.getSelectedIndex()).tdp;
     }
 
-    public void selectDummyTab (int index) {
-        if (this.tabs.size () < index+1)
+    public void selectDummyTab(int index) {
+        if (this.tabs.size() < index + 1)
             return;
-        this.dummySelectedTab = this.tabs.elementAt (index);
+        this.dummySelectedTab = this.tabs.elementAt(index);
     }
 
-    public void forgetDummyTab () {
+    public void forgetDummyTab() {
         this.dummySelectedTab = null;
     }
 
@@ -7235,9 +7283,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void reinitCountOfPanels() {
         int i, j;
         TURTLEPanel tp;
-        for(i = 0; i<mainTabbedPane.getTabCount(); i++) {
+        for (i = 0; i < mainTabbedPane.getTabCount(); i++) {
             tp = tabs.elementAt(i);
-            for(j=0; j<tp.tabbedPane.getTabCount(); j++) {
+            for (j = 0; j < tp.tabbedPane.getTabCount(); j++) {
                 tp.panels.elementAt(j).count = 0;
             }
         }
@@ -7246,12 +7294,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void setPanelMode() {
         int index;
         TURTLEPanel tp = getCurrentTURTLEPanel();
-        if (tp==null){
+        if (tp == null) {
             return;
         }
         index = tp.tabbedPane.getSelectedIndex();
 
-        if (index < tp.panels.size() -1) {
+        if (index < tp.panels.size() - 1) {
             setMode(FORWARD_DIAG);
         } else {
             setMode(NO_FORWARD_DIAG);
@@ -7324,7 +7372,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void paneDiplodocusMethodologyAction(ChangeEvent e) {
         //TraceManager.addDev("Pane design action size=" + tabs.size());
         try {
-        	TDiagramPanel tdp1 = getCurrentTURTLEPanel().panels.elementAt(getCurrentJTabbedPane().getSelectedIndex());
+            TDiagramPanel tdp1 = getCurrentTURTLEPanel().panels.elementAt(getCurrentJTabbedPane().getSelectedIndex());
             //TraceManager.addDev("Pane design action 1");
             if (activetdp != null) {
 
@@ -7456,17 +7504,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     // nameTab : array of strings not to be removed
-    public void removeAnalysisDiagrams(String [] nameTab) {
+    public void removeAnalysisDiagrams(String[] nameTab) {
         int i, j;
         String value;
         boolean found;
 
-        for(i=1; i<getCurrentJTabbedPane().getTabCount(); i++) {
+        for (i = 1; i < getCurrentJTabbedPane().getTabCount(); i++) {
             value = getCurrentJTabbedPane().getTitleAt(i);
             found = false;
-            for(j=0; j<nameTab.length; j++) {
+            for (j = 0; j < nameTab.length; j++) {
                 if (nameTab[j] != null) {
-                    if (nameTab[j].compareTo(value) ==0) {
+                    if (nameTab[j].compareTo(value) == 0) {
                         found = true;
                         break;
                     }
@@ -7490,9 +7538,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         value = getCurrentJTabbedPane().getTitleAt(index);
 
         //String s = (String)JOptionPane.showInputDialog(this, "Name of the diagram:", JOptionPane.QUESTION_MESSAGE);
-        String s = (String)JOptionPane.showInputDialog(frame, "Name of the diagram:", "setting value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, null, value);
+        String s = (String) JOptionPane.showInputDialog(frame, "Name of the diagram:", "setting value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, null, value);
 
-        if ((s != null) && (s.length() > 0)){
+        if ((s != null) && (s.length() > 0)) {
             // name already in use?
             index1 = getCurrentJTabbedPane().indexOfTab(s);
             /*if (methoMode == METHO_ANALYSIS) {
@@ -7574,9 +7622,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
             if ((getCurrentTURTLEPanel() instanceof AvatarDesignPanel) || (getCurrentTURTLEPanel() instanceof AvatarRequirementPanel) || (getCurrentTURTLEPanel() instanceof AttackTreePanel) || (getCurrentTURTLEPanel() instanceof FaultTreePanel) || (getCurrentTURTLEPanel() instanceof ADDPanel)) {
                 mainBar.showAvatarActions(true);
-            } else if ((getCurrentTURTLEPanel() instanceof TMLDesignPanel) || (getCurrentTURTLEPanel() instanceof TMLComponentDesignPanel) || (getCurrentTURTLEPanel() instanceof TMLArchiPanel)){
+            } else if ((getCurrentTURTLEPanel() instanceof TMLDesignPanel) || (getCurrentTURTLEPanel() instanceof TMLComponentDesignPanel) || (getCurrentTURTLEPanel() instanceof TMLArchiPanel)) {
                 mainBar.showDiplodocusActions(true);
-            }  else {
+            } else {
                 mainBar.showAvatarActions(false);
             }
 
@@ -7597,20 +7645,20 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean newTClassName(TURTLEPanel tp, String old, String niou) {
         JTabbedPane jtp = tp.tabbedPane;
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             if (jtp.getTitleAt(i).equals(niou)) {
                 return false;
             }
         }
         //TraceManager.addDev("old " + old + " niou " + niou);
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             //TraceManager.addDev("Tab " + i + " = " + mainTabbedPane.getTitleAt(i));
             if (jtp.getTitleAt(i).equals(old)) {
                 jtp.setTitleAt(i, niou);
                 jtp.setToolTipTextAt(i, "Opens the activity diagram of " + niou);
                 TDiagramPanel tdp;
                 //change panel name
-                for(int j=0; j<tp.panels.size(); j++) {
+                for (int j = 0; j < tp.panels.size(); j++) {
                     tdp = tp.panels.elementAt(j);
                     if (tdp.getName().equals(old)) {
                         tdp.setName(niou);
@@ -7627,20 +7675,20 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean newTOSClassName(TURTLEPanel tp, String old, String niou) {
         JTabbedPane jtp = tp.tabbedPane;
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             if (jtp.getTitleAt(i).equals(niou)) {
                 return false;
             }
         }
         //TraceManager.addDev("old " + old + " niou " + niou);
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             //TraceManager.addDev("Tab " + i + " = " + mainTabbedPane.getTitleAt(i));
             if (jtp.getTitleAt(i).equals(old)) {
                 jtp.setTitleAt(i, niou);
                 jtp.setToolTipTextAt(i, "Opens the TURTLE-OS activity diagram of " + niou);
                 TDiagramPanel tdp;
                 //change panel name
-                for(int j=0; j<tp.panels.size(); j++) {
+                for (int j = 0; j < tp.panels.size(); j++) {
                     tdp = tp.panels.elementAt(j);
                     if (tdp.getName().equals(old)) {
                         tdp.setName(niou);
@@ -7658,14 +7706,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public boolean newTMLTaskName(TURTLEPanel tp, String old, String niou) {
         //TraceManager.addDev("Panel=" + tp + " Old  task name = " + old + " New task name=" + niou);
         JTabbedPane jtp = tp.tabbedPane;
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             //TraceManager.addDev("jtp  = " + jtp.getTitleAt(i));
             if (jtp.getTitleAt(i).equals(niou)) {
                 return false;
             }
         }
         //TraceManager.addDev("old " + old + " niou " + niou);
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             //TraceManager.addDev("Tab " + i + " = " + mainTabbedPane.getTitleAt(i));
             //TraceManager.addDev("jtp  = " + jtp.getTitleAt(i));
             if (jtp.getTitleAt(i).equals(old)) {
@@ -7673,7 +7721,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 jtp.setToolTipTextAt(i, "Opens the TML activity diagram of " + niou);
                 TDiagramPanel tdp;
                 //change panel name
-                for(int j=0; j<tp.panels.size(); j++) {
+                for (int j = 0; j < tp.panels.size(); j++) {
                     tdp = tp.panels.elementAt(j);
                     if (tdp.getName().equals(old)) {
                         tdp.setName(niou);
@@ -7691,7 +7739,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean nameComponentInUse(TURTLEPanel tp, String old, String niou) {
         JTabbedPane jtp = tp.tabbedPane;
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             if (jtp.getTitleAt(i).equals(niou)) {
                 return true;
             }
@@ -7701,20 +7749,20 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public boolean newTMLComponentTaskName(TURTLEPanel tp, String old, String niou) {
         JTabbedPane jtp = tp.tabbedPane;
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             if (jtp.getTitleAt(i).equals(niou)) {
                 return false;
             }
         }
         TraceManager.addDev("old " + old + " niou " + niou);
-        for(int i = 0; i<jtp.getTabCount(); i++) {
+        for (int i = 0; i < jtp.getTabCount(); i++) {
             TraceManager.addDev("Tab " + i + " = " + mainTabbedPane.getTitleAt(i));
             if (jtp.getTitleAt(i).equals(old)) {
                 jtp.setTitleAt(i, niou);
                 jtp.setToolTipTextAt(i, "Opens the TML activity diagram of " + niou);
                 TDiagramPanel tdp;
                 //change panel name
-                for(int j=0; j<tp.panels.size(); j++) {
+                for (int j = 0; j < tp.panels.size(); j++) {
                     tdp = tp.panels.elementAt(j);
                     if (tdp.getName().equals(old)) {
                         tdp.setName(niou);
@@ -7740,10 +7788,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
     }
-    public void cloneRenameTab(int index, String s){
+
+    public void cloneRenameTab(int index, String s) {
         cloneTab(index);
-        mainTabbedPane.setTitleAt(tabs.size()-1, mainTabbedPane.getTitleAt(index)+"_"+s);
+        mainTabbedPane.setTitleAt(tabs.size() - 1, mainTabbedPane.getTitleAt(index) + "_" + s);
     }
+
     public void requestRemoveTab(int index) {
         if (index >= tabs.size()) {
             return;
@@ -7756,7 +7806,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void requestMoveRightTab(int index) {
         //TraceManager.addDev("Move right");
-        if (index > tabs.size()-2) {
+        if (index > tabs.size() - 2) {
             return;
         }
         requestMoveTabFromTo(index, index + 1);
@@ -7768,7 +7818,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         if (index < 1) {
             return;
         }
-        requestMoveTabFromTo(index, index-1);
+        requestMoveTabFromTo(index, index - 1);
         changeMade(null, -1);
     }
 
@@ -7809,8 +7859,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void requestRenameTab(int index) {
         String oldName = mainTabbedPane.getTitleAt(index);
-        String s = (String)JOptionPane.showInputDialog(frame, "Name: ", "Renaming a tab", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, null, mainTabbedPane.getTitleAt(index));
-        if ((s != null) && (s.length() > 0)){
+        String s = (String) JOptionPane.showInputDialog(frame, "Name: ", "Renaming a tab", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, null, mainTabbedPane.getTitleAt(index));
+        if ((s != null) && (s.length() > 0)) {
             // name already in use?
             if (s.compareTo(oldName) != 0) {
                 if (isAValidTabName(s) && (!isTabNameUsed(s))) {
@@ -7833,9 +7883,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     /**
      * Check if a name is already used by another TURTLEPanel tab
-     * @author Fabien Tessier
+     *
      * @param name
      * @return true if the name matches another tab name
+     * @author Fabien Tessier
      */
     public boolean isTabNameUsed(String name) {
         for (int i = 0; i < mainTabbedPane.getTabCount(); i++) {
@@ -7847,16 +7898,17 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     /**
      * Rename reference to the tab in Diplodocus Methodology
-     * @author Fabien Tessier
+     *
      * @param oldname
      * @param newname
+     * @author Fabien Tessier
      */
     public void renameInMethodo(String oldname, String newname) {
-        for (TURTLEPanel tp: tabs) {
+        for (TURTLEPanel tp : tabs) {
             if (tp instanceof DiplodocusMethodologyPanel) {
                 DiplodocusMethodologyDiagramPanel dmdp = (DiplodocusMethodologyDiagramPanel) tp.tdp;
-                for (TGComponent tgc: dmdp.componentList)
-                    for (TGComponent tgc2: tgc.tgcomponent) {
+                for (TGComponent tgc : dmdp.componentList)
+                    for (TGComponent tgc2 : tgc.tgcomponent) {
                         if (tgc2.getValue().equals(oldname))
                             tgc2.setValue(newname);
                     }
@@ -7867,10 +7919,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void renameMapping(String oldName, String newName) {
         TURTLEPanel tp;
 
-        for(int i = 0; i<mainTabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < mainTabbedPane.getTabCount(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof TMLArchiPanel) {
-                ((TMLArchiPanel)tp).renameMapping(oldName, newName);
+                ((TMLArchiPanel) tp).renameMapping(oldName, newName);
             }
         }
 
@@ -7879,10 +7931,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void renameDeployment(String oldName, String newName) {
         TURTLEPanel tp;
 
-        for(int i = 0; i<mainTabbedPane.getTabCount(); i++) {
+        for (int i = 0; i < mainTabbedPane.getTabCount(); i++) {
             tp = tabs.elementAt(i);
             if (tp instanceof ADDPanel) {
-                ((ADDPanel)tp).renameDeployment(oldName, newName);
+                ((ADDPanel) tp).renameDeployment(oldName, newName);
             }
         }
 
@@ -7900,7 +7952,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             mainTabbedPane.setSelectedIndex(index1);
         }
 
-        for(j=0; j<tp.tabbedPane.getTabCount(); j++) {
+        for (j = 0; j < tp.tabbedPane.getTabCount(); j++) {
             if (tp.tabbedPane.getTitleAt(j).equals(s)) {
                 tp.tabbedPane.setSelectedIndex(j);
                 return true;
@@ -7978,7 +8030,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         int index;
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             index = tp.panels.indexOf(tdp);
             if (index > -1) {
@@ -7999,7 +8051,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             TURTLEPanel tp = tabs.elementAt(index);
 
             if (tp instanceof DesignPanel) {
-                return (DesignPanel)tp;
+                return (DesignPanel) tp;
             } else {
                 return null;
             }
@@ -8011,25 +8063,25 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     // return current deployment panel
 
     public ADDDiagramPanel getDeploymentPanel() {
-        ADDDiagramPanel deploymentDiagram =  null ; //(ADDDiagramPanel)activetdp;
+        ADDDiagramPanel deploymentDiagram = null; //(ADDDiagramPanel)activetdp;
         TURTLEPanel tp = getCurrentTURTLEPanel();
         Vector<TDiagramPanel> ps = tp.panels;
-        for(TDiagramPanel panel : ps ){
-            if (panel instanceof ADDDiagramPanel){
-                deploymentDiagram = (ADDDiagramPanel)panel;
+        for (TDiagramPanel panel : ps) {
+            if (panel instanceof ADDDiagramPanel) {
+                deploymentDiagram = (ADDDiagramPanel) panel;
             }
         }
-        if(deploymentDiagram == null)
+        if (deploymentDiagram == null)
             System.err.println("No ADDDiagramPanel found : MainGUI.getDeploymentPanel()");
         return deploymentDiagram;
     }
 
 
-    public ADDDiagramPanel getFirstAvatarDeploymentPanelFound(){
+    public ADDDiagramPanel getFirstAvatarDeploymentPanelFound() {
         ADDDiagramPanel adp = null;
-        for(int i =0 ; i<tabs.size();i++)
-            if(tabs.get(i) instanceof ADDPanel){
-                adp = ((ADDPanel)tabs.get(i)).tmladd;
+        for (int i = 0; i < tabs.size(); i++)
+            if (tabs.get(i) instanceof ADDPanel) {
+                adp = ((ADDPanel) tabs.get(i)).tmladd;
             }
         if (adp == null)
             System.err.println("No AvatarDeployment Panel Found : MainGUI.getFirstAvatarDeploymentPanelFound()");
@@ -8039,11 +8091,11 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     // find the first Design Panel in MainGUI.tabs
 
-    public AvatarDesignPanel getFirstAvatarDesignPanelFound(){
+    public AvatarDesignPanel getFirstAvatarDesignPanelFound() {
         AvatarDesignPanel adp = null;
-        for(int i =0 ; i<tabs.size();i++)
-            if(tabs.get(i) instanceof AvatarDesignPanel){
-                adp = (AvatarDesignPanel)tabs.get(i);
+        for (int i = 0; i < tabs.size(); i++)
+            if (tabs.get(i) instanceof AvatarDesignPanel) {
+                adp = (AvatarDesignPanel) tabs.get(i);
             }
         if (adp == null)
             System.err.println("No AvatarDesign Panel Found : MainGUI.getFirstAvatarDesignPanel()");
@@ -8051,18 +8103,20 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
 
-    public void extracDeploymentDiagramToFile(){
+    public void extracDeploymentDiagramToFile() {
 
         ADDDiagramPanel deploymentDiagramPanel = getDeploymentPanel();
         AvatarDesignPanel designDiagramPanel = getFirstAvatarDesignPanelFound();
 
         AvatarDeploymentPanelTranslator avdeploymenttranslator = new AvatarDeploymentPanelTranslator(deploymentDiagramPanel);
-        /*AvatarddSpecification avddspec =*/ avdeploymenttranslator.getAvatarddSpecification();
+        /*AvatarddSpecification avddspec =*/
+        avdeploymenttranslator.getAvatarddSpecification();
 
 
-        AvatarDesignPanelTranslator avdesigntranslator = new AvatarDesignPanelTranslator( designDiagramPanel);
-        List<AvatarBDStateMachineOwner> adp =  designDiagramPanel.getAvatarBDPanel().getFullStateMachineOwnerList();
-        /*AvatarSpecification avaspec =*/ avdesigntranslator.generateAvatarSpecification(adp);
+        AvatarDesignPanelTranslator avdesigntranslator = new AvatarDesignPanelTranslator(designDiagramPanel);
+        List<AvatarBDStateMachineOwner> adp = designDiagramPanel.getAvatarBDPanel().getFullStateMachineOwnerList();
+        /*AvatarSpecification avaspec =*/
+        avdesigntranslator.generateAvatarSpecification(adp);
 
         //DG
         //LinkedList<AvatarComponent> components = AvatarddSpecification.getComponents();
@@ -8071,7 +8125,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //tofile.extracParamToFile();
     }
 
-    public void avatarToSoclib(){
+    public void avatarToSoclib() {
         //DG 6.2. appelee nulle part?
 
         ADDDiagramPanel deploymentDiagramPanel = getDeploymentPanel();
@@ -8081,19 +8135,19 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         AvatarddSpecification avddspec = avdeploymenttranslator.getAvatarddSpecification();
 
 
-        AvatarDesignPanelTranslator avdesigntranslator = new AvatarDesignPanelTranslator( designDiagramPanel);
+        AvatarDesignPanelTranslator avdesigntranslator = new AvatarDesignPanelTranslator(designDiagramPanel);
 
-        LinkedList<AvatarBDStateMachineOwner> adp =  designDiagramPanel.getAvatarBDPanel().getFullStateMachineOwnerList();
+        LinkedList<AvatarBDStateMachineOwner> adp = designDiagramPanel.getAvatarBDPanel().getFullStateMachineOwnerList();
         AvatarSpecification avaspec = avdesigntranslator.generateAvatarSpecification(adp);
 
         // Generator for block tasks and application main file
 
-        TasksAndMainGenerator gene = new TasksAndMainGenerator(avddspec,avaspec);
-        gene.generateSoclib(false,false);
-        try{
+        TasksAndMainGenerator gene = new TasksAndMainGenerator(avddspec, avaspec);
+        gene.generateSoclib(false, false);
+        try {
             //System.err.println("ok");
             gene.saveInFiles(TasksAndMainGenerator.getGeneratedPath());
-        }catch(FileException e){
+        } catch (FileException e) {
             System.err.println("FileException : MainGUI.avatarToSoclib()");
         }
 
@@ -8103,7 +8157,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public boolean selectMainTab(String id) {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             if (getTabName(tp).compareTo(id) == 0) {
                 selectTab(tp);
@@ -8123,7 +8177,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         int index;
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             index = tp.panels.indexOf(tdp);
             if (index > -1) {
@@ -8135,9 +8189,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleAttributes() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)) {
             //TraceManager.addDev("Toggle attributes");
-            TClassDiagramPanel tdcp = (TClassDiagramPanel)tdp;
+            TClassDiagramPanel tdcp = (TClassDiagramPanel) tdp;
             tdcp.setAttributesVisible(!tdcp.areAttributesVisible());
             tdcp.checkAllMySize();
             tdcp.repaint();
@@ -8163,7 +8217,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     public void resetAllDIPLOIDs() {
         TURTLEPanel tp;
 
-        for(int i=0; i<tabs.size(); i++) {
+        for (int i = 0; i < tabs.size(); i++) {
             tp = tabs.elementAt(i);
             tp.resetAllDIPLOIDs();
         }
@@ -8182,7 +8236,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public int isRunningAvatarComponent(TGComponent _tgc) {
-        if(jfais.isVisible()) {
+        if (jfais.isVisible()) {
             if (jfais.isRunningComponent(_tgc)) {
                 return 1;
             }
@@ -8194,7 +8248,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public String[] hasMessageInformationForAvatarConnector(AvatarBDPortConnector _conn) {
-        if(jfais.isVisible()) {
+        if (jfais.isVisible()) {
             return jfais.getFirstMessagesOnEachConnectorSide(_conn);
         }
         return null;
@@ -8245,7 +8299,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             return null;
         }
 
-        for(RunningInfo ri: runningIDs) {
+        for (RunningInfo ri : runningIDs) {
             if (ri.id == id) {
                 return ri;
             }
@@ -8253,7 +8307,8 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         return null;
     }
-    public synchronized ArrayList<SimulationTransaction> getTransactions(int id){
+
+    public synchronized ArrayList<SimulationTransaction> getTransactions(int id) {
         if (transactionMap == null) {
             return null;
         }
@@ -8261,10 +8316,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return transactionMap.get(id);
     }
 
-    public synchronized void addLatencyVals(int id, String[] latency){
-        if (latencyMap!=null){
+    public synchronized void addLatencyVals(int id, String[] latency) {
+        if (latencyMap != null) {
             //System.out.println("Adding latency...");
-            if (!latencyMap.containsKey(id)){
+            if (!latencyMap.containsKey(id)) {
                 ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>();
                 latencyMap.put(id, map);
             }
@@ -8274,14 +8329,15 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         //      System.out.println(latencyMap);
     }
 
-    public synchronized ConcurrentHashMap<String, String> getLatencyVals(int id){
+    public synchronized ConcurrentHashMap<String, String> getLatencyVals(int id) {
         //      System.out.println(id + " " + latencyMap);
-        if (latencyMap!=null){
+        if (latencyMap != null) {
             return latencyMap.get(id);
         }
         return null;
     }
-    public synchronized ConcurrentHashMap<String,String> getStatus(int id){
+
+    public synchronized ConcurrentHashMap<String, String> getStatus(int id) {
         if (statusMap == null) {
             return null;
         }
@@ -8289,18 +8345,19 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         return statusMap;
     }
 
-    public String getStatus(String s){
-        if (statusMap==null){
+    public String getStatus(String s) {
+        if (statusMap == null) {
             return null;
         }
         return statusMap.get(s);
     }
+
     public synchronized LoadInfo isLoadID(int id) {
         if (loadIDs == null) {
             return null;
         }
 
-        for(LoadInfo li: loadIDs) {
+        for (LoadInfo li : loadIDs) {
             if (li.id == id) {
                 return li;
             }
@@ -8330,6 +8387,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             tdp.repaint();
         }
     }
+
     public synchronized void resetTransactions() {
         transactionMap.clear();
         TDiagramPanel tdp = getCurrentTDiagramPanel();
@@ -8337,6 +8395,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             tdp.repaint();
         }
     }
+
     public synchronized void resetStatus() {
         statusMap.clear();
         TDiagramPanel tdp = getCurrentTDiagramPanel();
@@ -8354,7 +8413,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             _state = "unknown";
         }
 
-        for(RunningInfo ri: runningIDs) {
+        for (RunningInfo ri : runningIDs) {
             if (ri.id == _id) {
                 ri.state = _state.toLowerCase();
                 //TraceManager.addDev("Updated state on UML diagram");
@@ -8391,13 +8450,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             tdp.repaint();
         }
     }
-    public synchronized void addTransaction(int _id, SimulationTransaction st){
-        if (transactionMap.containsKey(_id)){
-            if (!transactionMap.get(_id).contains(st)){
+
+    public synchronized void addTransaction(int _id, SimulationTransaction st) {
+        if (transactionMap.containsKey(_id)) {
+            if (!transactionMap.get(_id).contains(st)) {
                 transactionMap.get(_id).add(st);
             }
-        }
-        else {
+        } else {
             ArrayList<SimulationTransaction> ts = new ArrayList<SimulationTransaction>();
             ts.add(st);
             transactionMap.put(_id, ts);
@@ -8408,7 +8467,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
     }
 
-    public synchronized void addStatus(String task, String stat){
+    public synchronized void addStatus(String task, String stat) {
         statusMap.put(task, stat);
         TDiagramPanel tdp = getCurrentTDiagramPanel();
         if (tdp != null) {
@@ -8436,10 +8495,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public synchronized void removeRunningId(Integer id) {
         if (runningIDs == null) {
-            return ;
+            return;
         }
 
-        for(RunningInfo ri: runningIDs) {
+        for (RunningInfo ri : runningIDs) {
             if (ri.id == id.intValue()) {
                 runningIDs.remove(ri);
                 //TraceManager.addDev("Running id " + i +  " removed");
@@ -8451,10 +8510,10 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public synchronized void removeLoadId(int _id) {
         if (loadIDs == null) {
-            return ;
+            return;
         }
 
-        for(LoadInfo li: loadIDs) {
+        for (LoadInfo li : loadIDs) {
             if (li.id == _id) {
                 loadIDs.remove(li);
                 //TraceManager.addDev("Running id " + i +  " removed");
@@ -8466,9 +8525,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleGates() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)) {
             //TraceManager.addDev("Toggle gates");
-            TClassDiagramPanel tdcp = (TClassDiagramPanel)tdp;
+            TClassDiagramPanel tdcp = (TClassDiagramPanel) tdp;
             tdcp.setGatesVisible(!tdcp.areGatesVisible());
             tdcp.checkAllMySize();
             tdcp.repaint();
@@ -8478,9 +8537,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleSynchro() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TClassDiagramPanel)) {
             //TraceManager.addDev("Toggle synchro");
-            TClassDiagramPanel tdcp = (TClassDiagramPanel)tdp;
+            TClassDiagramPanel tdcp = (TClassDiagramPanel) tdp;
             tdcp.setSynchroVisible(!tdcp.areSynchroVisible());
             tdcp.checkAllMySize();
             tdcp.repaint();
@@ -8490,9 +8549,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleJava() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TActivityDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TActivityDiagramPanel)) {
             //TraceManager.addDev("Toggle synchro");
-            TActivityDiagramPanel tadp = (TActivityDiagramPanel)tdp;
+            TActivityDiagramPanel tadp = (TActivityDiagramPanel) tdp;
             tadp.setJavaVisible(!tadp.isJavaVisible());
             tadp.checkAllMySize();
             tadp.repaint();
@@ -8512,7 +8571,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleAttr() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if (tdp != null){
+        if (tdp != null) {
             //TraceManager.addDev("Toggle attributes");
             tdp.setAttributes((tdp.getAttributeState() + 1) % 3);
             tdp.checkAllMySize();
@@ -8523,9 +8582,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleChannels() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)) {
             //TraceManager.addDev("Toggle attributes");
-            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel)tdp;
+            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel) tdp;
             tmltdp.setChannelsVisible(!tmltdp.areChannelsVisible());
             tmltdp.checkAllMySize();
             tmltdp.repaint();
@@ -8535,9 +8594,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleEvents() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)) {
             //TraceManager.addDev("Toggle attributes");
-            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel)tdp;
+            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel) tdp;
             tmltdp.setEventsVisible(!tmltdp.areEventsVisible());
             tmltdp.checkAllMySize();
             tmltdp.repaint();
@@ -8547,9 +8606,9 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     public void toggleRequests() {
         TDiagramPanel tdp = getCurrentTDiagramPanel();
-        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)){
+        if ((tdp != null) && (tdp instanceof TMLTaskDiagramPanel)) {
             //TraceManager.addDev("Toggle attributes");
-            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel)tdp;
+            TMLTaskDiagramPanel tmltdp = (TMLTaskDiagramPanel) tdp;
             tmltdp.setRequestsVisible(!tmltdp.areRequestsVisible());
             tmltdp.checkAllMySize();
             tmltdp.repaint();
@@ -8562,7 +8621,6 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
 
-
     public void windowClosing(WindowEvent e) {
         //frame.setVisible(false);
         quitApplication();
@@ -8601,7 +8659,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         TraceManager.addDev("KEY RELEASED: ");
     }
 
-    public void actionPerformed(ActionEvent evt)  {
+    public void actionPerformed(ActionEvent evt) {
         String command = evt.getActionCommand();
         //TraceManager.addDev("Command:" + command);
         TDiagramPanel tdp1 = getCurrentTDiagramPanel();
@@ -8615,12 +8673,12 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
     }
 
-    private  class PopupListener extends MouseAdapter /* popup menus onto tabs */ {
+    private class PopupListener extends MouseAdapter /* popup menus onto tabs */ {
         private MainGUI mgui;
         private JPopupMenu menu;
 
         private JMenuItem rename, remove, moveRight, moveLeft, newDesign, newAnalysis, newDeployment, newRequirement/*, newTMLDesign*/, newTMLComponentDesign, newTMLArchi, newProactiveDesign, newTURTLEOSDesign,
-            newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSystemCAMS;
+                newNCDesign, sort, clone, newAttackTree, newFaultTree, newAVATARBD, newAVATARRequirement, newMAD, newTMLCP, newTMLMethodo, newAvatarMethodo, newAVATARDD, newSysmlsecMethodo, newSystemCAMS;
         private JMenuItem newAVATARAnalysis;
 
         public PopupListener(MainGUI _mgui) {
@@ -8633,11 +8691,13 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 activetdp.tdmm.setSelection(-1, -1);
             checkForPopup(e);
         }
+
         public void mouseReleased(MouseEvent e) {
             if (activetdp != null)
                 activetdp.tdmm.setSelection(-1, -1);
             checkForPopup(e);
         }
+
         public void mouseClicked(MouseEvent e) {
             if (activetdp != null)
                 activetdp.tdmm.setSelection(-1, -1);
@@ -8645,7 +8705,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
         private void checkForPopup(MouseEvent e) {
-            if(e.isPopupTrigger()) {
+            if (e.isPopupTrigger()) {
                 Component c = e.getComponent();
                 //TraceManager.addDev("e =" + e + " Component=" + c);
                 updateMenu(mgui.getCurrentSelectedIndex());
@@ -8665,13 +8725,14 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             newDeployment = createMenuItem("New TURTLE Deployment");
 
             newAttackTree = createMenuItem("New Attack Tree");
-	    newFaultTree = createMenuItem("New Fault Tree");
+            newFaultTree = createMenuItem("New Fault Tree");
 
             newRequirement = createMenuItem("New TURTLE Requirement Diagram");
 
             newTMLMethodo = createMenuItem("New DIPLODOCUS Methodology");
 
-            /*newTMLDesign =*/ createMenuItem("New Partitioning - Design");
+            /*newTMLDesign =*/
+            createMenuItem("New Partitioning - Design");
             newTMLComponentDesign = createMenuItem("New Partitioning - Functional view");
             newTMLArchi = createMenuItem("New Partitioning - Architecture and Mapping");
             newTMLCP = createMenuItem("New Partitioning - Communication Pattern");
@@ -8737,7 +8798,6 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
             }
 
 
-
             // Methodologies
             if (!avatarOnly) {
                 if (systemcOn) {
@@ -8775,7 +8835,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
                 menu.add(newMAD);
                 menu.add(newAVATARRequirement);
                 menu.add(newAttackTree);
-		menu.add(newFaultTree);
+                menu.add(newFaultTree);
                 menu.add(newAVATARAnalysis);
                 menu.add(newAVATARBD);
                 if (experimentalOn) {
@@ -8786,7 +8846,6 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
         }
 
 
-
         private JMenuItem createMenuItem(String s) {
             JMenuItem item = new JMenuItem(s);
             item.setActionCommand(s);
@@ -8827,105 +8886,106 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
 
         private Action listener = new AbstractAction() {
 
-                /**
-                 *
-                 */
-                private static final long serialVersionUID = -3632935027104753332L;
-
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                    JMenuItem item = (JMenuItem)e.getSource();
-                    String ac = item.getActionCommand();
-                    if(ac.equals("Rename")) {
-                        mgui.requestRenameTab(mainTabbedPane.getSelectedIndex());
-                    } else if (ac.equals("Remove")) {
-                        mgui.requestRemoveTab(mainTabbedPane.getSelectedIndex());
-                    } else if (ac.equals("Move to the left")) {
-                        mgui.requestMoveLeftTab(mainTabbedPane.getSelectedIndex());
-                    } else if (ac.equals("Move to the right")) {
-                        mgui.requestMoveRightTab(mainTabbedPane.getSelectedIndex());
-                    } else if (ac.equals("Sort")) {
-                        GraphicLib.sortJTabbedPane(mgui.mainTabbedPane, mgui.tabs, 0, mgui.mainTabbedPane.getTabCount());
-                        mgui.changeMade(null, -1);
-                    } else if (ac.equals("Clone")) {
-                        mgui.cloneTab(mainTabbedPane.getSelectedIndex());
-                    } else if (ac.equals("New TURTLE Analysis")) {
-                        mgui.newAnalysis();
-                    } else if (ac.equals("New TURTLE Design")) {
-                        mgui.newDesign();
-                    } else if (ac.equals("New TURTLE Deployment")) {
-                        mgui.newDeployment();
-                    } else if (e.getSource() == newAttackTree) {
-                        mgui.newAttackTree();
-		    } else if (e.getSource() == newFaultTree) {
-                        mgui.newFaultTree();
-                    } else if (ac.equals("New TURTLE Requirement Diagram")) {
-                        mgui.newRequirement();
-                    }    else if (e.getSource() == newTMLMethodo) {
-                        mgui.newDiplodocusMethodology();
-                    }    else if (e.getSource() == newAvatarMethodo) {
-                        mgui.newAvatarMethodology();
-                    }    else if (e.getSource() == newSysmlsecMethodo) {
-                        mgui.newSysmlsecMethodology();
-                    } else if (ac.equals("New DIPLODOCUS Design")) {
-                        mgui.newTMLDesign();
-                    } else if (e.getSource() == newTMLComponentDesign) {
-                        mgui.newTMLComponentDesign();
-                    } else if (e.getSource() == newTMLCP) {
-                        mgui.newTMLCP();
-                    } else if (e.getSource() == newTMLArchi) {
-                        mgui.newTMLArchi();
-                    } else if (ac.equals("New Proactive Design")) {
-                        mgui.newProactiveDesign();
-                    } else if (ac.equals("New TURTLE-OS Design")) {
-                        mgui.newTURTLEOSDesign();
-                    } else if (e.getSource() == newNCDesign) {
-                        mgui.newNCDesign();
-                    } else if (e.getSource() == newAVATARBD) {
-                        mgui.newAvatarBD();
-                    } else if (e.getSource() == newAVATARDD) {
-                        mgui.newADD();
-                    } else if (e.getSource() == newAVATARRequirement) {
-                        mgui.newAvatarRequirement();
-                    } else if (e.getSource() == newMAD) {
-                        mgui.newAvatarMADs();
-                    } else if (e.getSource() == newAVATARAnalysis) {
-                        mgui.newAvatarAnalysis();
-                    }  else if (e.getSource() == newSystemCAMS) { //ajout CD
-                        mgui.newSystemCAMS();
-                    }
+            /**
+             *
+             */
+            private static final long serialVersionUID = -3632935027104753332L;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                JMenuItem item = (JMenuItem) e.getSource();
+                String ac = item.getActionCommand();
+                if (ac.equals("Rename")) {
+                    mgui.requestRenameTab(mainTabbedPane.getSelectedIndex());
+                } else if (ac.equals("Remove")) {
+                    mgui.requestRemoveTab(mainTabbedPane.getSelectedIndex());
+                } else if (ac.equals("Move to the left")) {
+                    mgui.requestMoveLeftTab(mainTabbedPane.getSelectedIndex());
+                } else if (ac.equals("Move to the right")) {
+                    mgui.requestMoveRightTab(mainTabbedPane.getSelectedIndex());
+                } else if (ac.equals("Sort")) {
+                    GraphicLib.sortJTabbedPane(mgui.mainTabbedPane, mgui.tabs, 0, mgui.mainTabbedPane.getTabCount());
+                    mgui.changeMade(null, -1);
+                } else if (ac.equals("Clone")) {
+                    mgui.cloneTab(mainTabbedPane.getSelectedIndex());
+                } else if (ac.equals("New TURTLE Analysis")) {
+                    mgui.newAnalysis();
+                } else if (ac.equals("New TURTLE Design")) {
+                    mgui.newDesign();
+                } else if (ac.equals("New TURTLE Deployment")) {
+                    mgui.newDeployment();
+                } else if (e.getSource() == newAttackTree) {
+                    mgui.newAttackTree();
+                } else if (e.getSource() == newFaultTree) {
+                    mgui.newFaultTree();
+                } else if (ac.equals("New TURTLE Requirement Diagram")) {
+                    mgui.newRequirement();
+                } else if (e.getSource() == newTMLMethodo) {
+                    mgui.newDiplodocusMethodology();
+                } else if (e.getSource() == newAvatarMethodo) {
+                    mgui.newAvatarMethodology();
+                } else if (e.getSource() == newSysmlsecMethodo) {
+                    mgui.newSysmlsecMethodology();
+                } else if (ac.equals("New DIPLODOCUS Design")) {
+                    mgui.newTMLDesign();
+                } else if (e.getSource() == newTMLComponentDesign) {
+                    mgui.newTMLComponentDesign();
+                } else if (e.getSource() == newTMLCP) {
+                    mgui.newTMLCP();
+                } else if (e.getSource() == newTMLArchi) {
+                    mgui.newTMLArchi();
+                } else if (ac.equals("New Proactive Design")) {
+                    mgui.newProactiveDesign();
+                } else if (ac.equals("New TURTLE-OS Design")) {
+                    mgui.newTURTLEOSDesign();
+                } else if (e.getSource() == newNCDesign) {
+                    mgui.newNCDesign();
+                } else if (e.getSource() == newAVATARBD) {
+                    mgui.newAvatarBD();
+                } else if (e.getSource() == newAVATARDD) {
+                    mgui.newADD();
+                } else if (e.getSource() == newAVATARRequirement) {
+                    mgui.newAvatarRequirement();
+                } else if (e.getSource() == newMAD) {
+                    mgui.newAvatarMADs();
+                } else if (e.getSource() == newAVATARAnalysis) {
+                    mgui.newAvatarAnalysis();
+                } else if (e.getSource() == newSystemCAMS) { //ajout CD
+                    mgui.newSystemCAMS();
                 }
-            };
+            }
+        };
     }
 
 
     /**
      * This adapter is constructed to handle mouse over component events.
      */
-    private class MouseHandler extends MouseAdapter  {
+    private class MouseHandler extends MouseAdapter {
 
         private JLabel label;
 
         /**
          * ctor for the adapter.
+         *
          * @param label the JLabel which will recieve value of the
          *              Action.LONG_DESCRIPTION key.
          */
-        public MouseHandler(JLabel label)  {
+        public MouseHandler(JLabel label) {
             setLabel(label);
         }
 
-        public void setLabel(JLabel label)  {
+        public void setLabel(JLabel label) {
             this.label = label;
         }
 
         @Override
-        public void mouseEntered(MouseEvent evt)  {
-            if (evt.getSource() instanceof AbstractButton)  {
-                AbstractButton button = (AbstractButton)evt.getSource();
+        public void mouseEntered(MouseEvent evt) {
+            if (evt.getSource() instanceof AbstractButton) {
+                AbstractButton button = (AbstractButton) evt.getSource();
                 Action action = button.getAction();
-                if (action != null)  {
-                    String message = (String)action.getValue(Action.LONG_DESCRIPTION);
+                if (action != null) {
+                    String message = (String) action.getValue(Action.LONG_DESCRIPTION);
                     label.setText(message);
                 }
             }