diff --git a/Makefile b/Makefile
index 1263dd6820041412acedb39efd1fba9dd65efb60..e9ef46e23d2fa2b5ede73fc9f09eac1a966c4572 100755
--- a/Makefile
+++ b/Makefile
@@ -300,7 +300,7 @@ stdrelease:
 	cp $(TTOOL_DOC)/README_proverif $(TTOOL_TARGET)/proverif
 # Graphs
 	mkdir -p $(TTOOL_TARGET)/graphs
-	cp $(TTOOL_DOC)/README_graph $(TTOOL_TARGET)/graph
+	cp $(TTOOL_DOC)/README_graph $(TTOOL_TARGET)/graphs/
 # Figure
 	mkdir -p $(TTOOL_TARGET)/figures
 	cp $(TTOOL_DOC)/README_figure $(TTOOL_TARGET)/figures
@@ -426,8 +426,8 @@ define functionCommonPreinstall
 	mkdir -p $(1)/TTool/graphs
 	cp $(TTOOL_DOC)/README_graph $(1)/TTool/graphs
 # Figure
-	mkdir -p $(1)/TTool/figure
-	cp $(TTOOL_DOC)/README_figure $(1)/TTool/figure
+	mkdir -p $(1)/TTool/figures
+	cp $(TTOOL_DOC)/README_figure $(1)/TTool/figures
 # VCD
 	mkdir -p $(1)/TTool/vcd
 	cp $(TTOOL_DOC)/README_vcd $(1)/TTool/vcd
diff --git a/bin/config.xml b/bin/config.xml
index b985a70af7a27a70211c1c01158b8fb53078174b..d3d6c5cd16fb90cd74d1aa58869bb67a99c54e21 100755
--- a/bin/config.xml
+++ b/bin/config.xml
@@ -18,7 +18,7 @@
 <CaesarOpenPath data="/packages/cadp/com/caesar.open" />
 <FILEPath data="../modeling" />
 <LIBPath data="../lib" />
-<IMGPath data="../figure" />
+<IMGPath data="../figures" />
 <LOTOSPath data="../lotos" />
 <GGraphPath data="../graphs" />
 <TGraphPath data="../graphs" />
@@ -71,4 +71,4 @@
 
 
 <ProVerifHash data=""/>
-</TURTLECONFIGURATION>
\ No newline at end of file
+</TURTLECONFIGURATION>
diff --git a/build.txt b/build.txt
index c1440a2a61de66b7808e0561a2d464907508d331..ec67edc072549c57b4e30a85ccd1ffe0edca052b 100644
--- a/build.txt
+++ b/build.txt
@@ -1 +1 @@
-12180
\ No newline at end of file
+12182
\ No newline at end of file
diff --git a/doc/config_linux.xml b/doc/config_linux.xml
index 8719d08d7fb1b0423c0c81406bdb2df61af61b4a..7bd465be9516ded7d0d2875b52d8e43072373f30 100755
--- a/doc/config_linux.xml
+++ b/doc/config_linux.xml
@@ -5,7 +5,7 @@
 <DOTTYHost data="localhost" />
 <FILEPath data="../modeling/" />
 <LIBPath data="../lib" />
-<IMGPath data="../figure" />
+<IMGPath data="../figures" />
 <LOTOSPath data="../lotos/" />
 <GGraphPath data="../graphs" />
 <TGraphPath data="../graphs" />
diff --git a/doc/config_macosx.xml b/doc/config_macosx.xml
index 367f350dd69fc613d63115779876bbb4f79afa1b..5f17e22a9ea9b2ff51ee361154f3eed756ace302 100755
--- a/doc/config_macosx.xml
+++ b/doc/config_macosx.xml
@@ -5,7 +5,7 @@
 <DOTTYHost data="localhost" />
 <FILEPath data="../modeling/" />
 <LIBPath data="../lib" />
-<IMGPath data="../figure" />
+<IMGPath data="../figures" />
 <LOTOSPath data="../lotos/" />
 <GGraphPath data="../graphs" />
 <TGraphPath data="../graphs" />
diff --git a/doc/config_windows.xml b/doc/config_windows.xml
index 10c0e6dbe0aa7dac47656423c07a706a8341dfd4..a05f8eae43211852510a764b436a63dc13faa85a 100755
--- a/doc/config_windows.xml
+++ b/doc/config_windows.xml
@@ -5,7 +5,7 @@
 <DOTTYHost data="localhost" />
 <FILEPath data="../modeling/" />
 <LIBPath data="../lib" />
-<IMGPath data="../figure" />
+<IMGPath data="../figures" />
 <LOTOSPath data="../lotos/" />
 <GGraphPath data="../graphs" />
 <TGraphPath data="../graphs" />
diff --git a/modeling/SysMLSec/at_zeuszitmo.xml b/modeling/SysMLSec/at_zeuszitmo.xml
index 7546ac72d3ddbcfa685aadc9cbe1dd1ee412360e..f0feeacf2eef0a609e426d5569a8bf112a5c424e 100644
--- a/modeling/SysMLSec/at_zeuszitmo.xml
+++ b/modeling/SysMLSec/at_zeuszitmo.xml
@@ -1,48 +1,57 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
-<TURTLEGMODELING version="0.94-beta2">
+<TURTLEGMODELING version="0.99-beta2">
 
 <Modeling type="AttackTree" nameTab="Attack Trees" >
 <AttackTreeDiagramPanel name="Attack Tree" minX="10" maxX="1900" minY="10" maxY="1900" zoom="1.0000000000000016" >
 <CONNECTOR type="133" id="2" >
+<cdparam x="645" y="785" />
+<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
+<infoparam name="connector" value="" />
+<TGConnectingPoint num="0" id="1" />
+<P1  x="663" y="785" id="231" />
+<P2  x="757" y="658" id="167" />
+<AutomaticDrawing  data="true" />
+</CONNECTOR>
+<CONNECTOR type="133" id="4" >
 <cdparam x="262" y="1202" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="1" />
-<P1  x="288" y="937" id="53" />
+<TGConnectingPoint num="0" id="3" />
+<P1  x="290" y="937" id="53" />
 <P2  x="280" y="906" id="180" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="4" >
+<CONNECTOR type="133" id="6" >
 <cdparam x="415" y="453" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="3" />
-<P1  x="568" y="361" id="98" />
+<TGConnectingPoint num="0" id="5" />
+<P1  x="581" y="361" id="98" />
 <P2  x="757" y="623" id="164" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="6" >
+<CONNECTOR type="133" id="8" >
 <cdparam x="1033" y="642" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="5" />
-<P1  x="910" y="416" id="446" />
-<P2  x="943" y="381" id="462" />
+<TGConnectingPoint num="0" id="7" />
+<P1  x="938" y="416" id="459" />
+<P2  x="937" y="382" id="449" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="10" >
+<CONNECTOR type="133" id="12" >
 <cdparam x="1016" y="560" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a2" />
-<TGConnectingPoint num="0" id="8" />
-<TGConnectingPoint num="1" id="9" />
-<P1  x="943" y="346" id="459" />
-<P2  x="915" y="314" id="444" />
+<infoparam name="connector from TGComponent to TGComponent" value="2" />
+<TGConnectingPoint num="0" id="10" />
+<TGConnectingPoint num="1" id="11" />
+<P1  x="937" y="347" id="446" />
+<P2  x="892" y="314" id="483" />
 <Point x="931" y="331" />
 <AutomaticDrawing  data="true" />
-</CONNECTOR><SUBCOMPONENT type="-1" id="7" >
-<father id="10" num="0" />
+</CONNECTOR><SUBCOMPONENT type="-1" id="9" >
+<father id="12" num="0" />
 <cdparam x="931" y="331" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
@@ -50,130 +59,121 @@
 <infoparam name="point " value="null" />
 </SUBCOMPONENT>
 
-<CONNECTOR type="133" id="12" >
+<CONNECTOR type="133" id="14" >
 <cdparam x="916" y="476" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="11" />
-<P1  x="884" y="279" id="433" />
-<P2  x="831" y="250" id="488" />
+<TGConnectingPoint num="0" id="13" />
+<P1  x="861" y="279" id="472" />
+<P2  x="821" y="250" id="423" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="14" >
+<CONNECTOR type="133" id="16" >
 <cdparam x="831" y="1116" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a2" />
-<TGConnectingPoint num="0" id="13" />
-<P1  x="659" y="840" id="231" />
+<infoparam name="connector from TGComponent to TGComponent" value="1" />
+<TGConnectingPoint num="0" id="15" />
+<P1  x="663" y="840" id="192" />
 <P2  x="726" y="814" id="161" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="16" >
+<CONNECTOR type="133" id="18" >
 <cdparam x="1122" y="893" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="15" />
-<P1  x="903" y="783" id="271" />
+<TGConnectingPoint num="0" id="17" />
+<P1  x="893" y="783" id="297" />
 <P2  x="917" y="682" id="148" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="18" >
+<CONNECTOR type="133" id="20" >
 <cdparam x="1138" y="973" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="17" />
+<TGConnectingPoint num="0" id="19" />
 <P1  x="819" y="805" id="160" />
-<P2  x="852" y="800" id="268" />
+<P2  x="838" y="800" id="294" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="20" >
+<CONNECTOR type="133" id="22" >
 <cdparam x="1098" y="980" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="19" />
+<TGConnectingPoint num="0" id="21" />
 <P1  x="948" y="647" id="138" />
-<P2  x="950" y="613" id="283" />
+<P2  x="955" y="613" id="283" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="22" >
+<CONNECTOR type="133" id="24" >
 <cdparam x="1239" y="878" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
-<TGConnectingPoint num="0" id="21" />
-<P1  x="972" y="720" id="298" />
+<TGConnectingPoint num="0" id="23" />
+<P1  x="983" y="720" id="272" />
 <P2  x="979" y="682" id="149" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="24" >
+<CONNECTOR type="133" id="26" >
 <cdparam x="484" y="806" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a1" />
-<TGConnectingPoint num="0" id="23" />
+<infoparam name="connector from TGComponent to TGComponent" value="0" />
+<TGConnectingPoint num="0" id="25" />
 <P1  x="788" y="658" id="175" />
 <P2  x="788" y="779" id="156" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
-<CONNECTOR type="133" id="26" >
-<cdparam x="919" y="515" />
-<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a1" />
-<TGConnectingPoint num="0" id="25" />
-<P1  x="731" y="347" id="476" />
-<P2  x="853" y="314" id="443" />
-<AutomaticDrawing  data="true" />
-</CONNECTOR>
 <CONNECTOR type="133" id="28" >
-<cdparam x="1010" y="578" />
+<cdparam x="919" y="515" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a1" />
+<infoparam name="connector from TGComponent to TGComponent" value="1" />
 <TGConnectingPoint num="0" id="27" />
-<P1  x="844" y="433" id="422" />
-<P2  x="849" y="433" id="447" />
+<P1  x="711" y="347" id="437" />
+<P2  x="830" y="314" id="482" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="30" >
-<cdparam x="296" y="769" />
+<cdparam x="1010" y="578" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="" />
+<infoparam name="connector from TGComponent to TGComponent" value="0" />
 <TGConnectingPoint num="0" id="29" />
-<P1  x="283" y="643" id="387" />
-<P2  x="491" y="589" id="531" />
+<P1  x="805" y="435" id="487" />
+<P2  x="877" y="433" id="460" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="32" >
-<cdparam x="1291" y="918" />
+<cdparam x="296" y="769" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="a0" />
+<infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="31" />
-<P1  x="950" y="578" id="280" />
-<P2  x="910" y="451" id="449" />
+<P1  x="289" y="643" id="387" />
+<P2  x="491" y="589" id="531" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="34" >
-<cdparam x="540" y="630" />
+<cdparam x="1291" y="918" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
-<infoparam name="connector from TGComponent to TGComponent" value="" />
+<infoparam name="connector from TGComponent to TGComponent" value="1" />
 <TGConnectingPoint num="0" id="33" />
-<P1  x="641" y="563" id="528" />
-<P2  x="699" y="373" id="480" />
+<P1  x="955" y="578" id="280" />
+<P2  x="938" y="451" id="462" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="36" >
-<cdparam x="622" y="860" />
+<cdparam x="540" y="630" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="35" />
-<P1  x="661" y="648" id="127" />
-<P2  x="696" y="649" id="172" />
+<P1  x="653" y="563" id="528" />
+<P2  x="676" y="373" id="441" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="38" >
-<cdparam x="704" y="1069" />
+<cdparam x="622" y="860" />
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="37" />
-<P1  x="757" y="658" id="167" />
-<P2  x="645" y="776" id="197" />
+<P1  x="671" y="648" id="127" />
+<P2  x="696" y="649" id="172" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="40" >
@@ -181,7 +181,7 @@
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="39" />
-<P1  x="587" y="733" id="205" />
+<P1  x="600" y="733" id="218" />
 <P2  x="726" y="658" id="174" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
@@ -190,7 +190,7 @@
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="41" />
-<P1  x="395" y="888" id="217" />
+<P1  x="395" y="888" id="204" />
 <P2  x="342" y="888" id="179" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
@@ -199,7 +199,7 @@
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="43" />
-<P1  x="241" y="830" id="347" />
+<P1  x="244" y="830" id="334" />
 <P2  x="249" y="871" id="181" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
@@ -209,7 +209,7 @@
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="45" />
 <P1  x="311" y="871" id="182" />
-<P2  x="299" y="773" id="340" />
+<P2  x="299" y="773" id="353" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <CONNECTOR type="133" id="48" >
@@ -217,15 +217,15 @@
 <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <infoparam name="connector from TGComponent to TGComponent" value="" />
 <TGConnectingPoint num="0" id="47" />
-<P1  x="249" y="747" id="331" />
-<P2  x="255" y="678" id="385" />
+<P1  x="249" y="747" id="344" />
+<P2  x="259" y="678" id="385" />
 <AutomaticDrawing  data="true" />
 </CONNECTOR>
 <COMPONENT type="1400" id="86" >
 <cdparam x="192" y="936" />
-<sizeparam width="247" height="83" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="247" height="83" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block4" value="OtherSoftwareApplications" />
 <TGConnectingPoint num="0" id="62" />
 <TGConnectingPoint num="1" id="63" />
@@ -255,9 +255,10 @@
 <SUBCOMPONENT type="1401" id="61" >
 <father id="86" num="0" />
 <cdparam x="256" y="937" />
-<sizeparam width="130" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="137" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="117" minY="0" maxY="48" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="110" minY="0" maxY="48" />
 <infoparam name="TGComponent" value="ExploitVulnerability" />
 <TGConnectingPoint num="0" id="49" />
 <TGConnectingPoint num="1" id="50" />
@@ -278,9 +279,9 @@
 
 <COMPONENT type="1400" id="124" >
 <cdparam x="392" y="279" />
-<sizeparam width="247" height="108" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="247" height="108" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block6" value="AttackerWebServer" />
 <TGConnectingPoint num="0" id="100" />
 <TGConnectingPoint num="1" id="101" />
@@ -310,9 +311,10 @@
 <SUBCOMPONENT type="1401" id="99" >
 <father id="124" num="0" />
 <cdparam x="439" y="326" />
-<sizeparam width="173" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="190" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="74" minY="0" maxY="73" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="57" minY="0" maxY="73" />
 <infoparam name="TGComponent" value="GenerateFakeBankWebsite" />
 <TGConnectingPoint num="0" id="87" />
 <TGConnectingPoint num="1" id="88" />
@@ -333,9 +335,10 @@
 
 <COMPONENT type="1401" id="137" >
 <cdparam x="491" y="631" />
-<sizeparam width="170" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="180" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<enabled value="true" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="TGComponent" value="ControlFakeHTTPBankURL" />
 <TGConnectingPoint num="0" id="125" />
 <TGConnectingPoint num="1" id="126" />
@@ -356,9 +359,9 @@
 
 <COMPONENT type="1402" id="150" >
 <cdparam x="887" y="647" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="TGComponent" value="&lt;&lt;AND&gt;&gt;" />
 <TGConnectingPoint num="0" id="138" />
 <TGConnectingPoint num="1" id="139" />
@@ -379,9 +382,9 @@
 
 <COMPONENT type="1402" id="163" >
 <cdparam x="696" y="779" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="TGComponent" value="&lt;&lt;SEQUENCE&gt;&gt;" />
 <TGConnectingPoint num="0" id="151" />
 <TGConnectingPoint num="1" id="152" />
@@ -396,15 +399,15 @@
 <TGConnectingPoint num="10" id="161" />
 <TGConnectingPoint num="11" id="162" />
 <extraparam>
-<info equation="t(a1)&lt;t(a2)" />
+<info equation="" />
 </extraparam>
 </COMPONENT>
 
 <COMPONENT type="1402" id="176" >
 <cdparam x="696" y="623" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="TGComponent" value="&lt;&lt;AND&gt;&gt;" />
 <TGConnectingPoint num="0" id="164" />
 <TGConnectingPoint num="1" id="165" />
@@ -425,9 +428,9 @@
 
 <COMPONENT type="1402" id="189" >
 <cdparam x="219" y="871" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="TGComponent" value="&lt;&lt;OR&gt;&gt;" />
 <TGConnectingPoint num="0" id="177" />
 <TGConnectingPoint num="1" id="178" />
@@ -448,9 +451,9 @@
 
 <COMPONENT type="1400" id="266" >
 <cdparam x="360" y="683" />
-<sizeparam width="303" height="240" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="303" height="240" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block3" value="Browser" />
 <TGConnectingPoint num="0" id="242" />
 <TGConnectingPoint num="1" id="243" />
@@ -479,11 +482,12 @@
 </COMPONENT>
 <SUBCOMPONENT type="1401" id="202" >
 <father id="266" num="0" />
-<cdparam x="371" y="768" />
-<sizeparam width="274" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="340" y="823" />
+<sizeparam width="323" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="29" minY="0" maxY="205" />
-<infoparam name="TGComponent" value="RedirectHTTPRequestFromBankToFakeBank" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="-20" minY="0" maxY="205" />
+<infoparam name="TGComponent" value="RequestUserToInstallMobileFakeBankApplication" />
 <TGConnectingPoint num="0" id="190" />
 <TGConnectingPoint num="1" id="191" />
 <TGConnectingPoint num="2" id="192" />
@@ -502,11 +506,12 @@
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="215" >
 <father id="266" num="1" />
-<cdparam x="448" y="716" />
-<sizeparam width="139" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="395" y="871" />
+<sizeparam width="134" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="164" minY="0" maxY="205" />
-<infoparam name="TGComponent" value="InstallMaliciousPlugin" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="169" minY="0" maxY="205" />
+<infoparam name="TGComponent" value="ExploitVunerability" />
 <TGConnectingPoint num="0" id="203" />
 <TGConnectingPoint num="1" id="204" />
 <TGConnectingPoint num="2" id="205" />
@@ -525,11 +530,12 @@
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="228" >
 <father id="266" num="2" />
-<cdparam x="395" y="871" />
-<sizeparam width="127" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="448" y="716" />
+<sizeparam width="152" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="176" minY="0" maxY="205" />
-<infoparam name="TGComponent" value="ExploitVunerability" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="151" minY="0" maxY="205" />
+<infoparam name="TGComponent" value="InstallMaliciousPlugin" />
 <TGConnectingPoint num="0" id="216" />
 <TGConnectingPoint num="1" id="217" />
 <TGConnectingPoint num="2" id="218" />
@@ -548,11 +554,12 @@
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="241" >
 <father id="266" num="3" />
-<cdparam x="361" y="823" />
-<sizeparam width="298" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="370" y="768" />
+<sizeparam width="293" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="5" minY="0" maxY="205" />
-<infoparam name="TGComponent" value="RequestUserToInstallMobileFakeBankApplication" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="10" minY="0" maxY="205" />
+<infoparam name="TGComponent" value="RedirectHTTPRequestFromBankToFakeBank" />
 <TGConnectingPoint num="0" id="229" />
 <TGConnectingPoint num="1" id="230" />
 <TGConnectingPoint num="2" id="231" />
@@ -572,9 +579,9 @@
 
 <COMPONENT type="1400" id="330" >
 <cdparam x="837" y="531" />
-<sizeparam width="224" height="331" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="224" height="331" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block2" value="UserMobilePhone_Android" />
 <TGConnectingPoint num="0" id="306" />
 <TGConnectingPoint num="1" id="307" />
@@ -603,11 +610,12 @@
 </COMPONENT>
 <SUBCOMPONENT type="1401" id="279" >
 <father id="330" num="0" />
-<cdparam x="852" y="783" />
-<sizeparam width="204" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="873" y="720" />
+<sizeparam width="147" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="20" minY="0" maxY="296" />
-<infoparam name="TGComponent" value="UserInstallsFakeBankApplication" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="77" minY="0" maxY="296" />
+<infoparam name="TGComponent" value="SilentlyInterceptSMS" />
 <TGConnectingPoint num="0" id="267" />
 <TGConnectingPoint num="1" id="268" />
 <TGConnectingPoint num="2" id="269" />
@@ -627,9 +635,10 @@
 <SUBCOMPONENT type="1401" id="292" >
 <father id="330" num="1" />
 <cdparam x="871" y="578" />
-<sizeparam width="159" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="169" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="65" minY="0" maxY="296" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="55" minY="0" maxY="296" />
 <infoparam name="TGComponent" value="RetrieveTransactionTAN" />
 <TGConnectingPoint num="0" id="280" />
 <TGConnectingPoint num="1" id="281" />
@@ -649,11 +658,12 @@
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="305" >
 <father id="330" num="2" />
-<cdparam x="873" y="720" />
-<sizeparam width="132" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="838" y="783" />
+<sizeparam width="223" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="92" minY="0" maxY="296" />
-<infoparam name="TGComponent" value="SilentlyInterceptSMS" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="1" minY="0" maxY="296" />
+<infoparam name="TGComponent" value="UserInstallsFakeBankApplication" />
 <TGConnectingPoint num="0" id="293" />
 <TGConnectingPoint num="1" id="294" />
 <TGConnectingPoint num="2" id="295" />
@@ -673,9 +683,9 @@
 
 <COMPONENT type="1400" id="381" >
 <cdparam x="176" y="714" />
-<sizeparam width="144" height="128" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="144" height="128" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block1" value="Windows_Win32" />
 <TGConnectingPoint num="0" id="357" />
 <TGConnectingPoint num="1" id="358" />
@@ -704,11 +714,12 @@
 </COMPONENT>
 <SUBCOMPONENT type="1401" id="343" >
 <father id="381" num="0" />
-<cdparam x="199" y="747" />
-<sizeparam width="100" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="176" y="795" />
+<sizeparam width="137" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="44" minY="0" maxY="93" />
-<infoparam name="TGComponent" value="InstallTrojan" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="7" minY="0" maxY="93" />
+<infoparam name="TGComponent" value="ExploitVulnerability" />
 <TGConnectingPoint num="0" id="331" />
 <TGConnectingPoint num="1" id="332" />
 <TGConnectingPoint num="2" id="333" />
@@ -727,11 +738,12 @@
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="356" >
 <father id="381" num="1" />
-<cdparam x="176" y="795" />
-<sizeparam width="130" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="199" y="747" />
+<sizeparam width="100" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="14" minY="0" maxY="93" />
-<infoparam name="TGComponent" value="ExploitVulnerability" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="44" minY="0" maxY="93" />
+<infoparam name="TGComponent" value="InstallTrojan" />
 <TGConnectingPoint num="0" id="344" />
 <TGConnectingPoint num="1" id="345" />
 <TGConnectingPoint num="2" id="346" />
@@ -751,9 +763,9 @@
 
 <COMPONENT type="1400" id="419" >
 <cdparam x="167" y="611" />
-<sizeparam width="503" height="418" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="503" height="418" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block0" value="UserPC" />
 <TGConnectingPoint num="0" id="395" />
 <TGConnectingPoint num="1" id="396" />
@@ -783,9 +795,10 @@
 <SUBCOMPONENT type="1401" id="394" >
 <father id="419" num="0" />
 <cdparam x="199" y="643" />
-<sizeparam width="113" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="121" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="390" minY="0" maxY="383" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="382" minY="0" maxY="383" />
 <infoparam name="TGComponent" value="InstallKeyLogger" />
 <TGConnectingPoint num="0" id="382" />
 <TGConnectingPoint num="1" id="383" />
@@ -805,10 +818,10 @@
 </SUBCOMPONENT>
 
 <COMPONENT type="1400" id="522" >
-<cdparam x="688" y="176" />
-<sizeparam width="368" height="299" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="665" y="176" />
+<sizeparam width="391" height="299" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block5" value="AttackerPC" />
 <TGConnectingPoint num="0" id="498" />
 <TGConnectingPoint num="1" id="499" />
@@ -837,11 +850,12 @@
 </COMPONENT>
 <SUBCOMPONENT type="1401" id="432" >
 <father id="522" num="0" />
-<cdparam x="720" y="416" />
-<sizeparam width="124" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="668" y="215" />
+<sizeparam width="306" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="244" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="SendTANToServer" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="85" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="IllegalBankAccountTransactionBasedOnToken" />
 <TGConnectingPoint num="0" id="420" />
 <TGConnectingPoint num="1" id="421" />
 <TGConnectingPoint num="2" id="422" />
@@ -855,16 +869,17 @@
 <TGConnectingPoint num="10" id="430" />
 <TGConnectingPoint num="11" id="431" />
 <extraparam>
-<info description="blah blah blah" root="false" />
+<info description="blah blah blah" root="true" />
 </extraparam>
 </SUBCOMPONENT>
-<SUBCOMPONENT type="1402" id="445" >
+<SUBCOMPONENT type="1401" id="445" >
 <father id="522" num="1" />
-<cdparam x="823" y="279" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="676" y="347" />
+<sizeparam width="141" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="245" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="&lt;&lt;SEQUENCE&gt;&gt;" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="250" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="LogOnBankAccount" />
 <TGConnectingPoint num="0" id="433" />
 <TGConnectingPoint num="1" id="434" />
 <TGConnectingPoint num="2" id="435" />
@@ -878,16 +893,17 @@
 <TGConnectingPoint num="10" id="443" />
 <TGConnectingPoint num="11" id="444" />
 <extraparam>
-<info equation="t(a1)&lt;t(a2)" />
+<info description="blah blah blah" root="false" />
 </extraparam>
 </SUBCOMPONENT>
-<SUBCOMPONENT type="1402" id="458" >
+<SUBCOMPONENT type="1401" id="458" >
 <father id="522" num="2" />
-<cdparam x="849" y="416" />
-<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="818" y="347" />
+<sizeparam width="238" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="245" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="&lt;&lt;BEFORE&gt;&gt;" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="153" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="PerformTokenBasedAuthentication" />
 <TGConnectingPoint num="0" id="446" />
 <TGConnectingPoint num="1" id="447" />
 <TGConnectingPoint num="2" id="448" />
@@ -900,17 +916,18 @@
 <TGConnectingPoint num="9" id="455" />
 <TGConnectingPoint num="10" id="456" />
 <TGConnectingPoint num="11" id="457" />
+<latencyCheck />
 <extraparam>
-<info equation="t(a1) &lt; t(a0)+120s" />
+<info description="blah blah blah" root="false" />
 </extraparam>
 </SUBCOMPONENT>
-<SUBCOMPONENT type="1401" id="471" >
+<SUBCOMPONENT type="1402" id="471" >
 <father id="522" num="3" />
-<cdparam x="834" y="346" />
-<sizeparam width="218" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="877" y="416" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="150" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="PerformTokenBasedAuthentication" />
+<cdrectangleparam minX="0" maxX="245" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="&lt;&lt;BEFORE&gt;&gt;" />
 <TGConnectingPoint num="0" id="459" />
 <TGConnectingPoint num="1" id="460" />
 <TGConnectingPoint num="2" id="461" />
@@ -924,16 +941,16 @@
 <TGConnectingPoint num="10" id="469" />
 <TGConnectingPoint num="11" id="470" />
 <extraparam>
-<info description="blah blah blah" root="false" />
+<info equation="120" />
 </extraparam>
 </SUBCOMPONENT>
-<SUBCOMPONENT type="1401" id="484" >
+<SUBCOMPONENT type="1402" id="484" >
 <father id="522" num="4" />
-<cdparam x="699" y="347" />
-<sizeparam width="129" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="800" y="279" />
+<sizeparam width="123" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="239" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="LogOnBankAccount" />
+<cdrectangleparam minX="0" maxX="245" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="&lt;&lt;SEQUENCE&gt;&gt;" />
 <TGConnectingPoint num="0" id="472" />
 <TGConnectingPoint num="1" id="473" />
 <TGConnectingPoint num="2" id="474" />
@@ -947,16 +964,17 @@
 <TGConnectingPoint num="10" id="482" />
 <TGConnectingPoint num="11" id="483" />
 <extraparam>
-<info description="blah blah blah" root="false" />
+<info equation="" />
 </extraparam>
 </SUBCOMPONENT>
 <SUBCOMPONENT type="1401" id="497" >
 <father id="522" num="5" />
-<cdparam x="691" y="215" />
-<sizeparam width="280" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<cdparam x="674" y="418" />
+<sizeparam width="131" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="88" minY="0" maxY="264" />
-<infoparam name="TGComponent" value="IllegalBankAccountTransactionBasedOnToken" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="260" minY="0" maxY="264" />
+<infoparam name="TGComponent" value="SendTANToServer" />
 <TGConnectingPoint num="0" id="485" />
 <TGConnectingPoint num="1" id="486" />
 <TGConnectingPoint num="2" id="487" />
@@ -970,15 +988,15 @@
 <TGConnectingPoint num="10" id="495" />
 <TGConnectingPoint num="11" id="496" />
 <extraparam>
-<info description="blah blah blah" root="true" />
+<info description="blah blah blah" root="false" />
 </extraparam>
 </SUBCOMPONENT>
 
 <COMPONENT type="1400" id="560" >
 <cdparam x="160" y="515" />
-<sizeparam width="912" height="528" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="912" height="528" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block9" value="AttackedSystem" />
 <TGConnectingPoint num="0" id="536" />
 <TGConnectingPoint num="1" id="537" />
@@ -1008,9 +1026,10 @@
 <SUBCOMPONENT type="1401" id="535" >
 <father id="560" num="0" />
 <cdparam x="491" y="563" />
-<sizeparam width="201" height="35" minWidth="100" minHeight="0" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="217" height="35" minWidth="100" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="0" maxX="711" minY="0" maxY="493" />
+<enabled value="true" />
+<cdrectangleparam minX="0" maxX="695" minY="0" maxY="493" />
 <infoparam name="TGComponent" value="RetrieveUserLoginAndPassword" />
 <TGConnectingPoint num="0" id="523" />
 <TGConnectingPoint num="1" id="524" />
@@ -1031,9 +1050,9 @@
 
 <COMPONENT type="1400" id="585" >
 <cdparam x="160" y="171" />
-<sizeparam width="908" height="320" minWidth="5" minHeight="2" maxWidth="1280" maxHeight="2880" minDesiredWidth="0" minDesiredHeight="0" />
+<sizeparam width="908" height="320" minWidth="5" minHeight="2" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" />
 <hidden value="false" />
-<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="1900" />
+<cdrectangleparam minX="10" maxX="1901" minY="10" maxY="1901" />
 <infoparam name="Block8" value="AttackerSystem" />
 <TGConnectingPoint num="0" id="561" />
 <TGConnectingPoint num="1" id="562" />
diff --git a/src/Test.java b/src/Test.java
index 72b732be97bb4e89c626a82acdbd3a2f2ab4642b..9d61fdb80fdd85f4123398ffb8368c0257f30c14 100755
--- a/src/Test.java
+++ b/src/Test.java
@@ -108,6 +108,12 @@ public class Test  {
 	nbOfPb += evalBoolInt("(1+2)==3", true, false);
 	nbOfPb += evalBoolInt("3==1+2", true, false);
     	nbOfPb += evalBoolInt("1+2==3", true, false);
+	nbOfPb += evalBoolInt("1+2+3+4+5==3+7", false, false);
+	nbOfPb += evalBoolInt("(1+2==3)==(8==4+5)", false, false);
+	nbOfPb += evalBoolInt("2*3==6", true, false);
+	nbOfPb += evalBoolInt("1*4+2==6", true, false);
+	nbOfPb += evalBoolInt("2+1*4==6", true, false);
+	//nbOfPb += evalBoolInt("1+2==3", true, false);
     	
     	System.out.println("Nb of problems found:" + nbOfPb);
 	
@@ -122,13 +128,15 @@ public class Test  {
     	
     	if ((val != expectedValue) || (err != expectedError)) {
     	
-    	System.out.println("\nUnexpected result or error-------------------->Result of " + s + " =" + val);
-    	if (bee.hasError()) {
+	    System.out.println("\nUnexpected result or error-------------------->Result of " + s + " =" + val);
+	    if (bee.hasError()) {
     		System.out.println("Error = " + bee.getFullError());
-    	}
-    	System.out.println("\n\n");
-    	return 1;
-    	}
+	    }
+	    System.out.println("\n\n");
+	    return 1;
+    	} else {
+	    System.out.println("all ok\n\n");
+	}
     	
     	return 0;
     	
diff --git a/src/avatartranslator/AvatarStateMachine.java b/src/avatartranslator/AvatarStateMachine.java
index 77fc44eec864d2428cfcfddd6e8f650a235098c5..fdff5e572e924d5204de93963049960c41f88035 100644
--- a/src/avatartranslator/AvatarStateMachine.java
+++ b/src/avatartranslator/AvatarStateMachine.java
@@ -91,8 +91,14 @@ public class AvatarStateMachine extends AvatarElement {
     }
 
     public void addElement(AvatarStateMachineElement _element) {
+		if (_element!=null){
         elements.add(_element);
+		//TraceManager.addDev("Adding element " + _element);
         states = null;
+		}
+		else {
+		TraceManager.addDev("NULL element found " + _element);
+		}
     }
 
     public void removeElement(AvatarStateMachineElement _element) {
diff --git a/src/myutil/BoolExpressionEvaluator.java b/src/myutil/BoolExpressionEvaluator.java
index a90f47e773a7acbc8b9737a4130b2be3d65fdcb6..b339a950adf8f472ddead46be1313389e98c3ea6 100755
--- a/src/myutil/BoolExpressionEvaluator.java
+++ b/src/myutil/BoolExpressionEvaluator.java
@@ -57,9 +57,9 @@ public class BoolExpressionEvaluator {
         public static final int INT_BINARY_OP = 3;
         public static final int BOOL_BINARY_OP = 4;
         public static final int BOOL_UNARY_OP = 5;
-	public static final int OPEN_PARENTHESIS = 6;
+        public static final int OPEN_PARENTHESIS = 6;
 
-	public int id = (int)(Math.ceil(Math.random() * 10000000));
+        public int id = (int)(Math.ceil(Math.random() * 10000000));
         public int i = -18;
         public boolean b;
         public int res; //-1: available, 0:int, 2:bool, 3:ko, others : OPs
@@ -126,34 +126,34 @@ public class BoolExpressionEvaluator {
             return news;
         }
 
-	public IntBoolRes addOpenParenthesis() {
-	    if ((left != null) && (right != null)) {
-		return null;
-	    }
+        public IntBoolRes addOpenParenthesis() {
+            if ((left != null) && (right != null)) {
+                return null;
+            }
 
-	    if ((left != null) && (op == 0)) {
-		return null;
-	    }
+            if ((left != null) && (op == 0)) {
+                return null;
+            }
 
-	    IntBoolRes newE = new IntBoolRes(OPEN_PARENTHESIS, OPEN_PAR_TOKEN, this);
+            IntBoolRes newE = new IntBoolRes(OPEN_PARENTHESIS, OPEN_PAR_TOKEN, this);
 
-	    if (left == null) {
-		left = newE;
-	    } else {
-		right = newE;
-	    }
+            if (left == null) {
+                left = newE;
+            } else {
+                right = newE;
+            }
 
-	    
-	    IntBoolRes topPar = new IntBoolRes();
-	    topPar.father = newE;
-	    newE.left = topPar;
-	    
-	    return topPar;
-	    
-	}
 
+            IntBoolRes topPar = new IntBoolRes();
+            topPar.father = newE;
+            newE.left = topPar;
 
-	public IntBoolRes addIntOperator(int _op) {
+            return topPar;
+
+        }
+
+
+        public IntBoolRes addIntOperator(int _op) {
             // Must have at least one right operator
             TraceManager.addDev("Add int op");
             if (left == null) {
@@ -164,10 +164,12 @@ public class BoolExpressionEvaluator {
             if (right != null) {
                 // Must change the tree structure according to the operator priority
                 IntBoolRes newE = new IntBoolRes(INT_BINARY_OP, _op, this);
-                newE.left = right;
+		return addBinaryChangeTreeStruct(newE);
+                /*newE.left = right;
+                newE.father = right.father;
                 right.father = newE;
-		this.right = newE;
-                return newE;
+                this.right = newE;
+                return newE;*/
             }
 
 
@@ -176,6 +178,7 @@ public class BoolExpressionEvaluator {
             if (!isAvailable()) {
                 return null;
             }
+	    
             res = INT_BINARY_OP;
             op = _op;
             return this;
@@ -192,57 +195,82 @@ public class BoolExpressionEvaluator {
             if (right != null) {
                 // Must change the tree structure accoding to the operator priority
                 IntBoolRes newE = new IntBoolRes(BOOL_BINARY_OP, _op, this);
+                return addBinaryChangeTreeStruct(newE);
 
-		// Look for the father
-		if (isABinaryOperator() && (newE.getPriority()>=getPriority())) {
-		     newE.left = right;
-		     right.father = newE;
-		     this.right = newE;
-		     return newE;
-		} else {
-		    // We must find the father where to ad the operator
-		    // We thus look for the first father with no binary operator
-		    // or with a binary operator that has a higher priority
-		    IntBoolRes targetF = this.father;
-
-		    boolean go = true;
-		    while(go == true) {
-			if (targetF == null) {
-			    go = false;
-			}
-			if (!(targetF.isABinaryOperator())) {
-			    go = false;
-			} else if (targetF.hasAHigherPriorityThan(newE)) {
-			    targetF = targetF.father;
-			}
-		    }
-
-		    if (targetF == null) {
-			newE.left = top;
-			top = newE;
-			return top;
-		    }
-
-		    
-		    
-		    
-		    
-		}
-		
-                
             }
 
-
             // Element added at the root of the current
-            // If the current has not type ..
+            // If the current has no type ..
             if (!isAvailable()) {
                 return null;
             }
+	    
             res = BOOL_BINARY_OP;
             op = _op;
             return this;
         }
 
+        public IntBoolRes addBinaryChangeTreeStruct(IntBoolRes newE) {
+
+            // Look for the father
+            if (isABinaryOperator() && (newE.getPriority()>=getPriority())) {
+                newE.left = right;
+                right.father = newE;
+                this.right = newE;
+                return newE;
+            } else {
+                // We must find the father where to add the operator
+                // We thus look for the first father with no binary operator
+                // or with a binary operator that has a higher priority
+                TraceManager.addDev("----- Must find a target");
+                IntBoolRes targetF = this.father;
+
+                boolean go = true;
+                while(go == true) {
+		    TraceManager.addDev("in loop targetF=" + targetF);
+                    if (targetF == null) {
+                        go = false;
+                    } else {
+                        if (!(targetF.isABinaryOperator())) {
+                            go = false;
+                        } else if (targetF.hasAHigherPriorityThan(newE)) {
+			    IntBoolRes nexT = targetF.father;
+			    if (nexT == targetF) {
+				go = false;
+			    }
+			    targetF = nexT;
+                        } else {
+			    go = false;
+			}
+                    }
+                }
+
+                TraceManager.addDev("**************** Considering targetF=" + targetF);
+
+                if (targetF == null) {
+                    newE.left = top;
+                    top.father = newE;
+		    newE.father = null;
+                    top = newE;
+                    return top;
+                } else {
+                    if (targetF.isABinaryOperator()) {
+                        newE.right = targetF.left;
+                        targetF.left = newE;
+                        newE.father = targetF.father;
+                        targetF.father = newE;
+                        return newE;
+                    } else {
+                        TraceManager.addDev("Unaryoperator");
+                        newE.left = targetF.left;
+                        targetF.left = newE;
+                        newE.father = targetF;
+                        return newE;
+                    }
+                }
+            }
+        }
+
 
         public boolean isAvailable() {
             return res == AVAILABLE;
@@ -260,44 +288,45 @@ public class BoolExpressionEvaluator {
             return (res == INT_TERM) || (res == BOOL_TERM);
         }
 
-	public boolean isRight() {
-	    if (father != null) {
-		return father.right == this;
-	    }
-	    return false;
-	}
-
-	public boolean isLeft() {
-	    if (father != null) {
-		return father.left == this;
-	    }
-	    return false;
-	}
-
-	public boolean isABinaryOperator(){
-	    return (res == INT_BINARY_OP) || (res == BOOL_BINARY_OP);
-	}
-
-	public boolean hasAHigherPriorityThan(IntBoolRes _other) {
-	    return (getPriority() > _other.getPriority());
-	}
-
-	public int getPriority() {
-	    if (res == BOOL_BINARY_OP) {
-		return 1;
-	    }
-
-	    if (res == INT_BINARY_OP) {
-		if ((op == PLUS_TOKEN) || (op == MINUS_TOKEN))
-		    return 2;
-		else {
-		    return 3;
-		}
-	    }
-
-	    return 0;
-	}
-	
+        public boolean isRight() {
+            if (father != null) {
+                return father.right == this;
+            }
+            return false;
+        }
+
+        public boolean isLeft() {
+            if (father != null) {
+                return father.left == this;
+            }
+            return false;
+        }
+
+        public boolean isABinaryOperator(){
+            return (res == INT_BINARY_OP) || (res == BOOL_BINARY_OP);
+        }
+
+        public boolean hasAHigherPriorityThan(IntBoolRes _other) {
+            return (getPriority() > _other.getPriority());
+        }
+
+        public int getPriority() {
+            if (res == BOOL_BINARY_OP) {
+                return 1;
+            }
+
+            if (res == INT_BINARY_OP) {
+                if ((op == PLUS_TOKEN) || (op == MINUS_TOKEN))
+                    return 2;
+                else {
+                    TraceManager.addDev("HAVE PRIORITY 3");
+                    return 3;
+                }
+            }
+
+            return 0;
+        }
+
 
         public String getValueString() {
             if (res == 0) {
@@ -337,11 +366,23 @@ public class BoolExpressionEvaluator {
             return null;
         }
 
-	private Integer makeIntegerOp(int op, int elt1, int elt2) {
+        private Integer makeIntegerOp(int op, int elt1, int elt2) {
             if (op == PLUS_TOKEN) {
                 return new Integer(elt1 + elt2);
             }
 
+            if (op == MINUS_TOKEN) {
+                return new Integer(elt1 - elt2);
+            }
+
+            if (op == MULT_TOKEN) {
+                return new Integer(elt1 * elt2);
+            }
+
+            if (op == DIV_TOKEN) {
+                return new Integer(elt1 / elt2);
+            }
+
             return null;
         }
 
@@ -370,19 +411,19 @@ public class BoolExpressionEvaluator {
                 }
             }
 
-	    if (res == INT_BINARY_OP) {
-		TraceManager.addDev("Found binary int expr");
+            if (res == INT_BINARY_OP) {
+                TraceManager.addDev("Found binary int expr");
                 if ((right == null) || (left == null)) {
                     errorMessage = "Badly formatted binary int operator";
-		    TraceManager.addDev("Found binary int expr in null");
+                    TraceManager.addDev("Found binary int expr in null");
                     return null;
                 }
                 Object ob1 = right.computeValue();
                 Object ob2 = left.computeValue();
                 if ((ob1 == null) || (ob2 == null)) {
-		    TraceManager.addDev("Found binary int expr in null elt");
+                    TraceManager.addDev("Found binary int expr in null elt");
                     return null;
-		}
+                }
                 if ((ob1 instanceof Integer) && (ob2 instanceof Integer)) {
                     int elt1 = analysisArg(ob1);
                     int elt2 = analysisArg(ob2);
@@ -391,62 +432,62 @@ public class BoolExpressionEvaluator {
                     TraceManager.addDev("Result int=" + result);
                     return result;
                 } else {
-		    errorMessage = "Invalid operands in integer operations";
-		    return null;
-		}
+                    errorMessage = "Invalid operands in integer operations";
+                    return null;
+                }
             }
 
-            
-	    if (res == OPEN_PARENTHESIS) {
-		if (left == null) {
-		    return null;
-		}
-		return left.computeValue();
-	    }
 
-	    errorMessage = "Badly formatted expression from:" + this;
-	    
+            if (res == OPEN_PARENTHESIS) {
+                if (left == null) {
+                    return null;
+                }
+                return left.computeValue();
+            }
+
+            errorMessage = "Badly formatted expression from:" + this;
+
             return null;
         }
 
 
-	public String toString() {
-	    return toString(0);
-	}
-
-	public String toString(int dec) {
-	    String s = "\n" + newLine(dec);
-	    if (isRight()) {
-		s += "R->";
-	    }
-	    if (isLeft()) {
-		s += "L->";
-	    }
-	    s += id;
-	    if (father == null) {
-		s += " father= no";
-	    } else {
-		s += " father=" + id;
-	    }
-	    s += " type=" + res + " op=" + op + " int=" + i + " bool=" + b;
-	    
-	    if (left != null) {
-		s += left.toString(dec+1);
-	    }
-	    if (right != null) {
-		s += right.toString(dec+1);
-	    }
-	    return s;
-	}
-
-	private String newLine(int dec) {
-	    String s = "";
-	    for (int i=0; i<dec; i++) {
-		s += "\t";
-	    }
-	    return s;
-	}
-	
+        public String toString() {
+            return toString(0);
+        }
+
+        public String toString(int dec) {
+            String s = "\n" + newLine(dec);
+            if (isRight()) {
+                s = s + "R->";
+            }
+            if (isLeft()) {
+                s = s + "L->";
+            }
+            s += id;
+            if (father == null) {
+                s += " father= no";
+            } else {
+                s += " father=" + id;
+            }
+            s += " type:" + res + " op:" + toStringAction(op) + " int:" + i + " bool:" + b;
+
+            if (left != null) {
+                s += left.toString(dec+1);
+            }
+            if (right != null) {
+                s += right.toString(dec+1);
+            }
+            return s;
+        }
+
+        private String newLine(int dec) {
+            String s = "";
+            for (int i=0; i<dec; i++) {
+                s += "\t";
+            }
+            return s;
+        }
+
     }
 
     //  ----------------------------------------
@@ -457,6 +498,8 @@ public class BoolExpressionEvaluator {
     public static final int TRUE_VALUE = 1;
     public static final int FALSE_VALUE = 0;
 
+
+
     public static final int NUMBER_TOKEN = -1;
     public static final int BOOL_TOKEN = -2;
     public static final int EQUAL_TOKEN = -3;
@@ -477,6 +520,17 @@ public class BoolExpressionEvaluator {
     public static final int DIV_TOKEN = -17;
     public static final int MULT_TOKEN = -18;
 
+    public static final String [] VAL_S = {"true", "false", "nb", "bool", "==", "<", ">", "not", "or", "and", "=<", ">=", "eol", "(", ")", " ", "!=", "-", "/", "*", "+"};
+
+    public static String toStringAction(int val) {
+        if (val >= 0) {
+            return VAL_S[val];
+        }
+
+        return VAL_S[Math.abs(val) + 1];
+    }
+
+
     public static int ID = 0;
 
     // PARSING_STAGE
@@ -1470,18 +1524,18 @@ public class BoolExpressionEvaluator {
             return false;
         }
 
-	
-	TraceManager.addDev("Tree of " + _expr + ": " + resIBR.toString() + "\nEnd of tree");
+
+        TraceManager.addDev("Tree of " + _expr + ": " + resIBR.toString() + "\nEnd of tree");
 
 
         Object res = resIBR.computeValue();
 
-	if (res == null) {
+        if (res == null) {
             return false;
         }
 
-	TraceManager.addDev("Tree of " + _expr + ": " + resIBR.toString() + "\nEnd of tree");
-	
+        TraceManager.addDev("Tree of " + _expr + ": " + resIBR.toString() + "\nEnd of tree");
+
         if(res instanceof Integer) {
             errorMessage = "Integer expression. Was expecting a boolean expression";
         }
@@ -1490,13 +1544,13 @@ public class BoolExpressionEvaluator {
             TraceManager.addDev("Error: " + getError());
         }
 
-	if (res instanceof Boolean) {
-	    boolean result = ((Boolean)(res)).booleanValue();
-	    return result;
-	}
+        if (res instanceof Boolean) {
+            boolean result = ((Boolean)(res)).booleanValue();
+            return result;
+        }
+
+        errorMessage = "Invalid boolean expression";
 
-	errorMessage = "Invalid boolean expression";
- 
         return false;
     }
 
@@ -1536,11 +1590,11 @@ public class BoolExpressionEvaluator {
     }
 
     public IntBoolRes parseAndMakeTree(IntBoolRes current, String token) {
-	ID = 0;
+        ID = 0;
         IntBoolRes newElt;
 
-	TraceManager.addDev("Dealing with token=" + token + " with current=" + current);
-	
+        TraceManager.addDev("<><><><><><> Dealing with token:" + token);
+
 
         char c1 = token.charAt(0);
 
@@ -1575,102 +1629,88 @@ public class BoolExpressionEvaluator {
 
         }
 
-	// INT BINARY OP
-	if (c1 == '+') {
+        // INT BINARY OP
+        if (c1 == '+') {
             newElt = current.addIntOperator(PLUS_TOKEN);
             if (newElt == null) {
-                errorMessage = "Badly placed bool operator:" + token;
+                errorMessage = "Badly placed int operator:" + token;
                 return null;
             }
             return newElt;
         }
 
-        // BOOL BINARY OP
-        if (c1 == '=') {
-            newElt = current.addBinaryOperator(EQUAL_TOKEN);
+        if (c1 == '-') {
+            newElt = current.addIntOperator(MINUS_TOKEN);
             if (newElt == null) {
-                errorMessage = "Badly placed bool operator:" + token;
+                errorMessage = "Badly placed int operator:" + token;
                 return null;
             }
             return newElt;
         }
 
-	// PARENTHESIS
-	if (c1 == '(') {
-	    
-	    newElt = current.addOpenParenthesis();
+        if (c1 == '*') {
+            newElt = current.addIntOperator(MULT_TOKEN);
             if (newElt == null) {
-                errorMessage = "Badly placed parenthesis:";
+                errorMessage = "Badly placed int operator:" + token;
                 return null;
             }
             return newElt;
-	}
-
-
-	if (c1 == ')') {
-	    // Must find corresponding parenthesis
-	    // Looking for father of the correspoing parenthesis;
-	    IntBoolRes father = current.father;
-	    while(father != null) {
-		if (father.op == OPEN_PAR_TOKEN) {
-		    break;
-		}
-	    }
-	    if (father == null) {
-		return null;
-	    }
-	    return father.father;
-	    
-	}
-
-
-        return null;
-
-
-    }
-
-    /*public IntBoolRes findValueFromExpr() {
-      String s = getNextToken();
-      if (s == null) {
-      return null;
-      }
+        }
 
-      // Space symbol
-      if (c1 == ' ') {
-      return findValueFromExpr();
-      }
+        if (c1 == '/') {
+            newElt = current.addIntOperator(DIV_TOKEN);
+            if (newElt == null) {
+                errorMessage = "Badly placed int operator:" + token;
+                return null;
+            }
+            return newElt;
+        }
 
-      // Terminal symbol
-      if (Character.isDigit(c1)) {
-      try {
-      return new IntBoolRes(Integer.valueOf(s).intValue());
-      } catch (NumberFormatException x) {
-      errorMessage = "Illegal format for a number.";
-      return null;
-      }
-      }
 
-      if (c1 == 't') {
+        // BOOL BINARY OP
+        if (c1 == '=') {
+            newElt = current.addBinaryOperator(EQUAL_TOKEN);
+            if (newElt == null) {
+                errorMessage = "Badly placed bool operator:" + token;
+                return null;
+            }
+            return newElt;
+        }
 
-      return IntBoolRes(true);
-      }
+        // PARENTHESIS
+        if (c1 == '(') {
 
-      if (c1 == 'f') {
-      return IntBoolRes(false);
-      }
+            newElt = current.addOpenParenthesis();
+            if (newElt == null) {
+                errorMessage = "Badly placed parenthesis:";
+                return null;
+            }
+            return newElt;
+        }
 
-      // int operator
-      if (c1 == '+') {
-      return IntBoolRes(IntBoolRes.INT_OP, PLUS, c1);
-      }
 
+        if (c1 == ')') {
+            // Must find corresponding parenthesis
+            // Looking for father of the correspoing parenthesis;
+            IntBoolRes father = current.father;
+            while(father != null) {
+                if (father.op == OPEN_PAR_TOKEN) {
+                    break;
+                }
+                father = father.father;
+            }
+            if (father == null) {
+                return null;
+            }
+            return father.father;
 
+        }
 
 
-      return null;
-      }*/
+        return null;
 
 
+    }
 
 
 }
diff --git a/src/tmltranslator/toavatar/TML2Avatar.java b/src/tmltranslator/toavatar/TML2Avatar.java
index f38b2690d645e597ea96c9e6ccb2bc737f70ebfc..20d0712a1315a17910e0a84d37b4af3b7e05ff6e 100644
--- a/src/tmltranslator/toavatar/TML2Avatar.java
+++ b/src/tmltranslator/toavatar/TML2Avatar.java
@@ -2032,8 +2032,8 @@ public class TML2Avatar {
 	AvatarActionOnSignal writeAction= new AvatarActionOnSignal("write", write, null);	
 	
 	AvatarStateMachine asm = fifo.getStateMachine();
-	asm.setStartState(start);
 	asm.addElement(start);
+	asm.setStartState(start);
 	asm.addElement(afterStart);
 	asm.addElement(root);
 	asm.addElement(toRead);
diff --git a/src/ui/ADDPanel.java b/src/ui/ADDPanel.java
index e4f99484a478d62ffc879a26fc6ab3ee5891b9f4..2007521124e7343687ca3497631e76f741136c18 100755
--- a/src/ui/ADDPanel.java
+++ b/src/ui/ADDPanel.java
@@ -98,8 +98,11 @@ public class ADDPanel extends TURTLEPanel {
         return true;
     }
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"ADD\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"ADD\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"ADD\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/AnalysisPanel.java b/src/ui/AnalysisPanel.java
index e1c337f714ab5ad7a3bc0bc427b5e7ba6cf6f9d2..d8400451a4bfca79c326eb9f02ee51c7ada44231 100755
--- a/src/ui/AnalysisPanel.java
+++ b/src/ui/AnalysisPanel.java
@@ -245,8 +245,11 @@ public class AnalysisPanel extends TURTLEPanel {
       }*/
 
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Analysis\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Analysis\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Analysis\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/AttackTreePanel.java b/src/ui/AttackTreePanel.java
index 3825bfe93e7a82ad3dff9d2a64a1267267dbbe44..8243a898e81d21e1735c4c3722282a8dd6eeb545 100755
--- a/src/ui/AttackTreePanel.java
+++ b/src/ui/AttackTreePanel.java
@@ -112,9 +112,11 @@ public class AttackTreePanel extends TURTLEPanel {
         return true;
     }
 
-
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"AttackTree\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"AttackTree\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"AttackTree\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/AvatarAnalysisPanel.java b/src/ui/AvatarAnalysisPanel.java
index a286eb445bc674f285daf58ab507f93357b01af2..d71622d6469a52b51f319a0ccfe71f6730293087 100755
--- a/src/ui/AvatarAnalysisPanel.java
+++ b/src/ui/AvatarAnalysisPanel.java
@@ -199,8 +199,12 @@ public class AvatarAnalysisPanel extends TURTLEPanel {
     }
 
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Avatar Analysis\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Avatar Analysis\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Avatar Analysis\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
+	
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/AvatarDesignPanel.java b/src/ui/AvatarDesignPanel.java
index 825fbd3ac8daa88e0da77238ca4238a47da5b443..daa5a61fb0fae5c60eb45c9e1dbd8fcfad4b85b7 100644
--- a/src/ui/AvatarDesignPanel.java
+++ b/src/ui/AvatarDesignPanel.java
@@ -202,9 +202,12 @@ public class AvatarDesignPanel extends TURTLEPanel {
     public LinkedList<String> getAllTimers(String _name) {
         return abdp.getAllTimersOfBlock(_name);
     }
-
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"AVATAR Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"AVATAR Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"AVATAR Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/AvatarMADsPanel.java b/src/ui/AvatarMADsPanel.java
index 3be35dd185385be7ffb2ceaf2717eed5195f124d..f3591db9c5a0ec5444460020142d60e606008b6d 100644
--- a/src/ui/AvatarMADsPanel.java
+++ b/src/ui/AvatarMADsPanel.java
@@ -132,9 +132,12 @@ public class AvatarMADsPanel extends TURTLEPanel {
  
     }
 	
-    
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Avatar MAD\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Avatar MAD\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Avatar MAD\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
     
     public String saveTailInXml() {
diff --git a/src/ui/AvatarMethodologyPanel.java b/src/ui/AvatarMethodologyPanel.java
index ec1eb3e178d828792f0d0dbcc0e27b1a9a75cfff..b1de004ee3c4512b0d6e99b56240945d1ef2510f 100755
--- a/src/ui/AvatarMethodologyPanel.java
+++ b/src/ui/AvatarMethodologyPanel.java
@@ -1,48 +1,48 @@
 /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
 
-ludovic.apvrille AT enst.fr
-
-This software is a computer program whose purpose is to allow the 
-edition of TURTLE analysis, design and deployment diagrams, to 
-allow the generation of RT-LOTOS or Java code from this diagram, 
-and at last to allow the analysis of formal validation traces 
-obtained from external tools, e.g. RTL from LAAS-CNRS and CADP 
-from INRIA Rhone-Alpes.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-
-/**
- * Class AvatarMethodologyPanel
- * Managenemt of the avatar methodology panels
- * Creation: 27/08/2014
- * @version 1.1 27/08/2014
- * @author Ludovic APVRILLE
- * @see MainGUI
- */
+   ludovic.apvrille AT enst.fr
+
+   This software is a computer program whose purpose is to allow the
+   edition of TURTLE analysis, design and deployment diagrams, to
+   allow the generation of RT-LOTOS or Java code from this diagram,
+   and at last to allow the analysis of formal validation traces
+   obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+   from INRIA Rhone-Alpes.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+
+   /**
+   * Class AvatarMethodologyPanel
+   * Managenemt of the avatar methodology panels
+   * Creation: 27/08/2014
+   * @version 1.1 27/08/2014
+   * @author Ludovic APVRILLE
+   * @see MainGUI
+   */
 
 package ui;
 
@@ -56,174 +56,176 @@ import java.util.*;
 
 public class AvatarMethodologyPanel extends TURTLEPanel {
     public AvatarMethodologyDiagramPanel dmd;
-    
+
     public AvatarMethodologyPanel(MainGUI _mgui) {
         super(_mgui);
-		
+
         tabbedPane = new JTabbedPane();
-		UIManager.put("TabbedPane.tabAreaBackground", _mgui.BACK_COLOR);
-		UIManager.put("TabbedPane.selected", _mgui.BACK_COLOR);
-		SwingUtilities.updateComponentTreeUI(tabbedPane);
-		//tabbedPane.setOpaque(true);
-		
+        UIManager.put("TabbedPane.tabAreaBackground", _mgui.BACK_COLOR);
+        UIManager.put("TabbedPane.selected", _mgui.BACK_COLOR);
+        SwingUtilities.updateComponentTreeUI(tabbedPane);
+        //tabbedPane.setOpaque(true);
+
         cl = new ChangeListener() {
-            public void stateChanged(ChangeEvent e){
-                mgui.paneDiplodocusMethodologyAction(e);
-            }
-        };
+                public void stateChanged(ChangeEvent e){
+                    mgui.paneDiplodocusMethodologyAction(e);
+                }
+            };
         tabbedPane.addChangeListener(cl);
         tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui));
-		
+
     }
-    
+
     // Put the methodology
     public void initElements() {
-    	 TGComponent tgc1 = dmd.addComponent(150, 100, TGComponentManager.AVATARMETHODOLOGY_REF_ASSUMPTIONS, false);
-    	 TGComponent tgc2 = dmd.addComponent(250, 200, TGComponentManager.AVATARMETHODOLOGY_REF_REQUIREMENT, false);
-    	 TGComponent tgc3 = dmd.addComponent(350, 300, TGComponentManager.AVATARMETHODOLOGY_REF_ANALYSIS, false);   
-    	 TGComponent tgc4 = dmd.addComponent(450, 400, TGComponentManager.AVATARMETHODOLOGY_REF_DESIGN, false);
-    	 TGComponent tgc5 = dmd.addComponent(550, 500, TGComponentManager.AVATARMETHODOLOGY_REF_PROTOTYPE, false);
-    	 TGComponent tgc6 = dmd.addComponent(200, 400, TGComponentManager.AVATARMETHODOLOGY_REF_PROPERTIES, false);
-    	 
-    	 
-    	 //Connectors
-    	 
-    	 // Assumptions -> reqs
-    	 TGConnectingPoint p1, p2;
-    	 p1 = tgc1.getTGConnectingPointAtIndex(0);
-    	 p2 = tgc2.getTGConnectingPointAtIndex(0);
-    	 Vector listPoint = new Vector();
-    	 Point p = new Point(210, 235);
-    	 listPoint.add(p);
-    	 TGConnector tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
-    	 p1.setFree(false);
-    	 p2.setFree(false);
-    	 dmd.getComponentList().add(0, tgco);
-    	 
-    	 // Reqs -> Analysis
-    	 p1 = tgc2.getTGConnectingPointAtIndex(1);
-    	 p2 = tgc3.getTGConnectingPointAtIndex(0);
-    	 listPoint = new Vector();
-    	 p = new Point(310, 335);
-    	 listPoint.add(p);
-    	 tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
-    	 p1.setFree(false);
-    	 p2.setFree(false);
-    	 dmd.getComponentList().add(0, tgco);    
-    	 
-    	 // Analysis -> Design
-    	 p1 = tgc3.getTGConnectingPointAtIndex(1);
-    	 p2 = tgc4.getTGConnectingPointAtIndex(0);
-    	 listPoint = new Vector();
-    	 p = new Point(410, 435);
-    	 listPoint.add(p);
-    	 tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
-    	 p1.setFree(false);
-    	 p2.setFree(false);
-    	 dmd.getComponentList().add(0, tgco);      
-    	 
-    	 // Design -> Prototyping
-    	 p1 = tgc4.getTGConnectingPointAtIndex(1);
-    	 p2 = tgc5.getTGConnectingPointAtIndex(0);
-    	 listPoint = new Vector();
-    	 p = new Point(510, 535);
-    	 listPoint.add(p);
-    	 tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
-    	 p1.setFree(false);
-    	 p2.setFree(false);
-    	 dmd.getComponentList().add(0, tgco);
-    	 
-    	 // Reqs -> Prop
-    	 p1 = tgc2.getTGConnectingPointAtIndex(2);
-    	 p2 = tgc6.getTGConnectingPointAtIndex(0);
-    	 listPoint = new Vector();
-    	 tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
-    	 p1.setFree(false);
-    	 p2.setFree(false);
-    	 dmd.getComponentList().add(0, tgco);
-    	 
-    	 
+        TGComponent tgc1 = dmd.addComponent(150, 100, TGComponentManager.AVATARMETHODOLOGY_REF_ASSUMPTIONS, false);
+        TGComponent tgc2 = dmd.addComponent(250, 200, TGComponentManager.AVATARMETHODOLOGY_REF_REQUIREMENT, false);
+        TGComponent tgc3 = dmd.addComponent(350, 300, TGComponentManager.AVATARMETHODOLOGY_REF_ANALYSIS, false);
+        TGComponent tgc4 = dmd.addComponent(450, 400, TGComponentManager.AVATARMETHODOLOGY_REF_DESIGN, false);
+        TGComponent tgc5 = dmd.addComponent(550, 500, TGComponentManager.AVATARMETHODOLOGY_REF_PROTOTYPE, false);
+        TGComponent tgc6 = dmd.addComponent(200, 400, TGComponentManager.AVATARMETHODOLOGY_REF_PROPERTIES, false);
+
+
+        //Connectors
+
+        // Assumptions -> reqs
+        TGConnectingPoint p1, p2;
+        p1 = tgc1.getTGConnectingPointAtIndex(0);
+        p2 = tgc2.getTGConnectingPointAtIndex(0);
+        Vector listPoint = new Vector();
+        Point p = new Point(210, 235);
+        listPoint.add(p);
+        TGConnector tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
+        p1.setFree(false);
+        p2.setFree(false);
+        dmd.getComponentList().add(0, tgco);
+
+        // Reqs -> Analysis
+        p1 = tgc2.getTGConnectingPointAtIndex(1);
+        p2 = tgc3.getTGConnectingPointAtIndex(0);
+        listPoint = new Vector();
+        p = new Point(310, 335);
+        listPoint.add(p);
+        tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
+        p1.setFree(false);
+        p2.setFree(false);
+        dmd.getComponentList().add(0, tgco);
+
+        // Analysis -> Design
+        p1 = tgc3.getTGConnectingPointAtIndex(1);
+        p2 = tgc4.getTGConnectingPointAtIndex(0);
+        listPoint = new Vector();
+        p = new Point(410, 435);
+        listPoint.add(p);
+        tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
+        p1.setFree(false);
+        p2.setFree(false);
+        dmd.getComponentList().add(0, tgco);
+
+        // Design -> Prototyping
+        p1 = tgc4.getTGConnectingPointAtIndex(1);
+        p2 = tgc5.getTGConnectingPointAtIndex(0);
+        listPoint = new Vector();
+        p = new Point(510, 535);
+        listPoint.add(p);
+        tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
+        p1.setFree(false);
+        p2.setFree(false);
+        dmd.getComponentList().add(0, tgco);
+
+        // Reqs -> Prop
+        p1 = tgc2.getTGConnectingPointAtIndex(2);
+        p2 = tgc6.getTGConnectingPointAtIndex(0);
+        listPoint = new Vector();
+        tgco = TGComponentManager.addConnector(p1.getX(), p1.getY(), TGComponentManager.AVATARMETHODOLOGY_CONNECTOR, dmd, p1, p2, listPoint);
+        p1.setFree(false);
+        p2.setFree(false);
+        dmd.getComponentList().add(0, tgco);
+
+
     }
-    
+
     public void init() {
-    	init("Avatar methodology");
+        init("Avatar methodology");
     }
-    
+
     public void init(String name) {
         addAvatarMethodologyDiagram(name);
-       
+
         // Requirement Diagram toolbar
         //addRequirementDiagram("Requirement Diagram");
-        
+
         //jsp.setVisible(true);
     }
-    
+
     public boolean addAvatarMethodologyDiagram(String s) {
         AvatarMethodologyDiagramToolbar dmdt = new AvatarMethodologyDiagramToolbar(mgui);
         toolbars.add(dmdt);
-        
+
         toolBarPanel = new JPanel();
-		//toolBarPanel.setBackground(Color.red);
+        //toolBarPanel.setBackground(Color.red);
         toolBarPanel.setLayout(new BorderLayout());
-		//toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
-        
-        //Class	diagram
+        //toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
+
+        //Class diagram
         dmd = new AvatarMethodologyDiagramPanel(mgui, dmdt);
         dmd.setName(s);
         dmd.tp = this;
         tdp = dmd;
         panels.add(dmd);
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(dmd);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(dmd);
         dmd.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT);
         toolBarPanel.add(dmdt, BorderLayout.NORTH);
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         tabbedPane.addTab(s, IconManager.imgic99, toolBarPanel, "Opens avatar methodology");
-        tabbedPane.setSelectedIndex(0); 
+        tabbedPane.setSelectedIndex(0);
         JPanel toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-        
+
         //TGComponent tgc = TGComponentManager.addComponent(100, 100, TGComponentManager.DIPLODODUSMETHODOLOGY_REF_APPLICATION, dmd);
         mgui.changeMade(dmd, TDiagramPanel.NEW_COMPONENT);
-        
+
         return true;
     }
-	
 
-	
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Avatar Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Avatar Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Avatar Methodology\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
-    
+
     public String saveTailInXml() {
         return "</Modeling>\n\n\n";
     }
-    
+
     public String toString() {
         return mgui.getTitleAt(this) + " (Avatar Methodology)";
     }
-    
+
     public boolean removeEnabled(int index) {
         if (panels.size() > 1) {
             return true;
         }
         return false;
     }
-    
+
     public boolean renameEnabled(int index) {
         if (panels.size() == 0) {
             return false;
         }
-        
-		
+
+
         return true;
     }
-	
-	public boolean isAvatarMethodologyEnabled() {
-		return true;
-	}
-    
 
-}
\ No newline at end of file
+    public boolean isAvatarMethodologyEnabled() {
+        return true;
+    }
+
+
+}
diff --git a/src/ui/AvatarRequirementPanel.java b/src/ui/AvatarRequirementPanel.java
index 74d76a28a627078d439a7976190dd105f0e20c80..7bdd7d2f82de589ddad5b66810bf1874a1bae47e 100755
--- a/src/ui/AvatarRequirementPanel.java
+++ b/src/ui/AvatarRequirementPanel.java
@@ -145,9 +145,11 @@ public class AvatarRequirementPanel extends TURTLEPanel {
         return true;
     }
 
-
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Avatar Requirement\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+        if (extensionToName == null) {
+            return "<Modeling type=\"Avatar Requirement\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+        }
+        return "<Modeling type=\"Avatar Requirement\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/CheckableLatency.java b/src/ui/CheckableLatency.java
new file mode 100644
index 0000000000000000000000000000000000000000..3ae2e02b96eae7ada7f75686da895ce4bb30e3e6
--- /dev/null
+++ b/src/ui/CheckableLatency.java
@@ -0,0 +1,52 @@
+/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
+
+ludovic.apvrille AT enst.fr
+
+This software is a computer program whose purpose is to allow the 
+edition of TURTLE analysis, design and deployment diagrams, to 
+allow the generation of RT-LOTOS or Java code from this diagram, 
+and at last to allow the analysis of formal validation traces 
+obtained from external tools, e.g. RTL from LAAS-CNRS and CADP 
+from INRIA Rhone-Alpes.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+
+/**
+ * Class CheckableLatency
+ * Components which can be set as a latency checkpoint
+ * Creation: 4/04/2017
+ * @version 1.0 4/04/2017
+ * @author Ludovic APVRILLE
+ * @see
+ */
+
+
+package ui;
+
+public interface CheckableLatency  {
+
+}
diff --git a/src/ui/DefaultText.java b/src/ui/DefaultText.java
index 3eb62c4151fee6c25e2208c5b17b9bdba7bd929e..98926bc087947960000a1cd2ccdcf81a4847419e 100755
--- a/src/ui/DefaultText.java
+++ b/src/ui/DefaultText.java
@@ -49,8 +49,8 @@ package ui;
 
 public class DefaultText  {
 
-    public static String BUILD = "12179";
-    public static String DATE = "2017/04/03 02:01:03 CET";
+    public static String BUILD = "12181";
+    public static String DATE = "2017/04/05 02:01:03 CET";
     
     
     public static StringBuffer sbAbout = makeAbout();
diff --git a/src/ui/DeploymentPanel.java b/src/ui/DeploymentPanel.java
index 71998c44abd1e11c9f40898b705a9ad925a917e0..5da70b25339270387a19248a3de6d3615450ef67 100755
--- a/src/ui/DeploymentPanel.java
+++ b/src/ui/DeploymentPanel.java
@@ -97,8 +97,12 @@ public class DeploymentPanel extends TURTLEPanel {
  
     }
     
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Deployment\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Deployment\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Deployment\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
+	
     }
     
     public String saveTailInXml() {
diff --git a/src/ui/DesignPanel.java b/src/ui/DesignPanel.java
index 054630708d2e2a439e62c3158ee5dc9e32ff69ca..2378089435aa561f8fa783ca121ad3abefa932c8 100755
--- a/src/ui/DesignPanel.java
+++ b/src/ui/DesignPanel.java
@@ -141,9 +141,13 @@ public class DesignPanel extends TURTLEPanel implements TURTLEDesignPanelInterfa
         //jsp.setVisible(true);
  
     }
-    
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
+	
     }
     
     public String saveTailInXml() {
diff --git a/src/ui/DiplodocusMethodologyPanel.java b/src/ui/DiplodocusMethodologyPanel.java
index 80d1507cada225c4f8ad0f24afe512f127ad8410..323b0d7cccbddb1ced632de9b32a34be4edc6a06 100755
--- a/src/ui/DiplodocusMethodologyPanel.java
+++ b/src/ui/DiplodocusMethodologyPanel.java
@@ -163,9 +163,11 @@ public class DiplodocusMethodologyPanel extends TURTLEPanel {
 
 
 
-
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Diplodocus Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Diplodocus Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Diplodocus Methodology\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java
index b24f1dee0be0c877821c282e3b2a1bea91c49e9a..85a5a2f8823efa3410d54f010d4fa5e73c906f66 100755
--- a/src/ui/GTURTLEModeling.java
+++ b/src/ui/GTURTLEModeling.java
@@ -4301,6 +4301,10 @@ public class GTURTLEModeling {
     }
 
     public String makeXMLFromTurtleModeling(int index) {
+	return makeXMLFromTurtleModeling(index, null);
+    }
+
+    public String makeXMLFromTurtleModeling(int index, String extensionToName) {
         StringBuffer sb = new StringBuffer();
         //sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<TURTLEGMODELING>\n\n");
         sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n<TURTLEGMODELING version=\"" + DefaultText.getVersion() + "\">\n\n");
@@ -4314,7 +4318,7 @@ public class GTURTLEModeling {
         for(i=0; i<panels.size(); i++) {
             if ((index == -1) || (i == index)) {
                 tp = (TURTLEPanel)(panels.elementAt(i));
-                s = tp.saveInXML();
+                s = tp.saveInXML(extensionToName);
                 if (s == null) {
                     return null;
                 }
diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java
index 5710a383d6ab6d3530be94a82f7b8b5e81d7f06f..a3622f0977646cba618b7fbfd28bdde0f6cde179 100644
--- a/src/ui/MainGUI.java
+++ b/src/ui/MainGUI.java
@@ -7128,7 +7128,7 @@ public  class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
     }
 
     public void cloneTab(int index) {
-        String s = gtm.makeXMLFromTurtleModeling(index);
+        String s = gtm.makeXMLFromTurtleModeling(index, "_cloned");
         try {
             gtm.loadModelingFromXML(s);
             changeMade(null, -1);
diff --git a/src/ui/NCPanel.java b/src/ui/NCPanel.java
index af50c3ac41462aba03ebe7c12b84cd57da045e1a..611f0ddb3c4441ce9bc6ea51e9d0d6ffe571ea12 100755
--- a/src/ui/NCPanel.java
+++ b/src/ui/NCPanel.java
@@ -1,49 +1,49 @@
 /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
 
-ludovic.apvrille AT enst.fr
-
-This software is a computer program whose purpose is to allow the 
-edition of TURTLE analysis, design and deployment diagrams, to 
-allow the generation of RT-LOTOS or Java code from this diagram, 
-and at last to allow the analysis of formal validation traces 
-obtained from external tools, e.g. RTL from LAAS-CNRS and CADP 
-from INRIA Rhone-Alpes.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-
-/**
- * Class NCPanel
- * Managenemt of NC panels
- * Creation: 18/11/2008
- * @version 1.0 18/11/2008
- * @author Ludovic APVRILLE
- * @see MainGUI
- */
- 
+   ludovic.apvrille AT enst.fr
+
+   This software is a computer program whose purpose is to allow the
+   edition of TURTLE analysis, design and deployment diagrams, to
+   allow the generation of RT-LOTOS or Java code from this diagram,
+   and at last to allow the analysis of formal validation traces
+   obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+   from INRIA Rhone-Alpes.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+
+   /**
+   * Class NCPanel
+   * Managenemt of NC panels
+   * Creation: 18/11/2008
+   * @version 1.0 18/11/2008
+   * @author Ludovic APVRILLE
+   * @see MainGUI
+   */
+
 package ui;
 
 import java.awt.*;
@@ -53,37 +53,37 @@ import java.util.*;
 import ui.ncdd.*;
 
 public class NCPanel extends TURTLEPanel {
-    public NCDiagramPanel ncdp; 
+    public NCDiagramPanel ncdp;
     public Vector validated, ignored;
-    
+
     public NCPanel(MainGUI _mgui) {
         super(_mgui);
         tabbedPane = new JTabbedPane();
         cl = new ChangeListener() {
-            public void stateChanged(ChangeEvent e){
-                mgui.paneDesignAction(e);
-            }
-        };
+                public void stateChanged(ChangeEvent e){
+                    mgui.paneDesignAction(e);
+                }
+            };
         tabbedPane.addChangeListener(cl);
         tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui));
     }
-    
+
     public void init() {
-         
+
         //  Class Diagram toolbar
         NCDiagramToolBar toolBarNC = new NCDiagramToolBar(mgui);
         toolbars.add(toolBarNC);
-        
+
         toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-        
-        //Class	diagram
+
+        //Class diagram
         ncdp = new NCDiagramPanel(mgui, toolBarNC);
         ncdp.setName("Network Calculus Diagram");
         //tmlap.tp = this;
         tdp = ncdp;
         panels.add(ncdp); // Always first in list
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(ncdp);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(ncdp);
         ncdp.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT);
@@ -91,27 +91,30 @@ public class NCPanel extends TURTLEPanel {
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         tabbedPane.addTab("Network Calculus Diagram", IconManager.imgic60, toolBarPanel, "Opens network calculus diagram");
         tabbedPane.setSelectedIndex(0);
-        
+
         //jsp.setVisible(true);
- 
+
     }
     
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"NC diagram\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"NC diagram\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"NC diagram\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
-    
+
     public String saveTailInXml() {
         return "</Modeling>\n\n\n";
     }
-    
+
     public String toString() {
         return "NC diagram: " + mgui.getTitleAt(this);
     }
-	
-	/*public void renameMapping(String oldName, String newName) {
-		if (tmlap != null) {
-			tmlap.renameMapping(oldName, newName);
-		}
-	}*/
-    
-}
\ No newline at end of file
+
+    /*public void renameMapping(String oldName, String newName) {
+      if (tmlap != null) {
+      tmlap.renameMapping(oldName, newName);
+      }
+      }*/
+
+}
diff --git a/src/ui/ProactiveDesignPanel.java b/src/ui/ProactiveDesignPanel.java
index c7585822c9d84f129fe5f3a8fa8ba4851a741dd7..20665e5275fad93f4fc9a11b7bd6c23ff80f8b8f 100755
--- a/src/ui/ProactiveDesignPanel.java
+++ b/src/ui/ProactiveDesignPanel.java
@@ -190,8 +190,12 @@ public class ProactiveDesignPanel extends TURTLEPanel {
         
     } 
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"ProActive Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"ProActive Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"ProActive Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
+	
     }
     
     public String saveTailInXml() {
@@ -301,4 +305,4 @@ public class ProactiveDesignPanel extends TURTLEPanel {
 
 
 
-}
\ No newline at end of file
+}
diff --git a/src/ui/RequirementPanel.java b/src/ui/RequirementPanel.java
index 7e7bb27beb3bce46b3042ad356184261ac97732a..8f685a8ba4a0badc4b1022aba2ae4a363aee58a2 100755
--- a/src/ui/RequirementPanel.java
+++ b/src/ui/RequirementPanel.java
@@ -1,48 +1,48 @@
 /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille
 
-ludovic.apvrille AT enst.fr
-
-This software is a computer program whose purpose is to allow the 
-edition of TURTLE analysis, design and deployment diagrams, to 
-allow the generation of RT-LOTOS or Java code from this diagram, 
-and at last to allow the analysis of formal validation traces 
-obtained from external tools, e.g. RTL from LAAS-CNRS and CADP 
-from INRIA Rhone-Alpes.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-
-/**
- * Class RequirementPanel
- * Managenemt of requirement panels
- * Creation: 15/05/2006
- * @version 1.1 08/09/2009
- * @author Ludovic APVRILLE
- * @see MainGUI
- */
+   ludovic.apvrille AT enst.fr
+
+   This software is a computer program whose purpose is to allow the
+   edition of TURTLE analysis, design and deployment diagrams, to
+   allow the generation of RT-LOTOS or Java code from this diagram,
+   and at last to allow the analysis of formal validation traces
+   obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+   from INRIA Rhone-Alpes.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+
+   /**
+   * Class RequirementPanel
+   * Managenemt of requirement panels
+   * Creation: 15/05/2006
+   * @version 1.1 08/09/2009
+   * @author Ludovic APVRILLE
+   * @see MainGUI
+   */
 
 package ui;
 
@@ -56,113 +56,116 @@ import java.util.*;
 
 public class RequirementPanel extends TURTLEPanel {
     public RequirementDiagramPanel rdp;
-	public EBRDDPanel ebrdd;
-    
+    public EBRDDPanel ebrdd;
+
     public RequirementPanel(MainGUI _mgui) {
         super(_mgui);
-		
+
         tabbedPane = new JTabbedPane();
-		UIManager.put("TabbedPane.tabAreaBackground", _mgui.BACK_COLOR);
-		UIManager.put("TabbedPane.selected", _mgui.BACK_COLOR);
-		SwingUtilities.updateComponentTreeUI(tabbedPane);
-		//tabbedPane.setOpaque(true);
-		
+        UIManager.put("TabbedPane.tabAreaBackground", _mgui.BACK_COLOR);
+        UIManager.put("TabbedPane.selected", _mgui.BACK_COLOR);
+        SwingUtilities.updateComponentTreeUI(tabbedPane);
+        //tabbedPane.setOpaque(true);
+
         cl = new ChangeListener() {
-            public void stateChanged(ChangeEvent e){
-                mgui.paneRequirementAction(e);
-            }
-        };
+                public void stateChanged(ChangeEvent e){
+                    mgui.paneRequirementAction(e);
+                }
+            };
         tabbedPane.addChangeListener(cl);
         tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui));
-		
+
     }
-    
+
     public void init() {
-        
+
         // Requirement Diagram toolbar
         //addRequirementDiagram("Requirement Diagram");
-        
+
         //jsp.setVisible(true);
     }
-    
+
     public boolean addRequirementDiagram(String s) {
         RequirementDiagramToolBar toolBarReq = new RequirementDiagramToolBar(mgui);
         toolbars.add(toolBarReq);
-        
+
         toolBarPanel = new JPanel();
-		//toolBarPanel.setBackground(Color.red);
+        //toolBarPanel.setBackground(Color.red);
         toolBarPanel.setLayout(new BorderLayout());
-		//toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
-        
-        //Class	diagram
+        //toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
+
+        //Class diagram
         rdp = new RequirementDiagramPanel(mgui, toolBarReq);
         rdp.setName(s);
         rdp.tp = this;
         tdp = rdp;
         panels.add(rdp);
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(rdp);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(rdp);
         rdp.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT);
         toolBarPanel.add(toolBarReq, BorderLayout.NORTH);
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         tabbedPane.addTab(s, IconManager.imgic1000, toolBarPanel, "Opens requirement diagram");
-        tabbedPane.setSelectedIndex(0); 
+        tabbedPane.setSelectedIndex(0);
         JPanel toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-       
+
         return true;
     }
-	
-	public boolean addEBRDD(String s) {
+
+    public boolean addEBRDD(String s) {
         EBRDDToolBar toolBarEBRDD = new EBRDDToolBar(mgui);
         toolbars.add(toolBarEBRDD);
-        
+
         toolBarPanel = new JPanel();
-		//toolBarPanel.setBackground(Color.red);
+        //toolBarPanel.setBackground(Color.red);
         toolBarPanel.setLayout(new BorderLayout());
-		//toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
-        
-        //	diagram
+        //toolBarPanel.setBackground(ColorManager.MainTabbedPaneSelect);
+
+        //      diagram
         ebrdd = new EBRDDPanel(mgui, toolBarEBRDD);
         ebrdd.setName(s);
         ebrdd.tp = this;
         //tdp = rdp;
         panels.add(ebrdd);
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(ebrdd);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(ebrdd);
         ebrdd.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT);
         toolBarPanel.add(toolBarEBRDD, BorderLayout.NORTH);
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         tabbedPane.addTab(s, IconManager.imgic1058, toolBarPanel, "Opens EBRDD");
-        tabbedPane.setSelectedIndex(0); 
+        tabbedPane.setSelectedIndex(0);
         JPanel toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-       
+
         return true;
     }
-    
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Requirement\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Requirement\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Requirement\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
-    
+
     public String saveTailInXml() {
         return "</Modeling>\n\n\n";
     }
-    
+
     public String toString() {
         return mgui.getTitleAt(this) + " (SysML Requirement Diagrams)";
     }
-    
+
     public boolean removeEnabled(int index) {
         if (panels.size() > 1) {
             return true;
         }
         return false;
     }
-    
+
     public boolean renameEnabled(int index) {
         if (panels.size() == 0) {
             return false;
@@ -170,26 +173,26 @@ public class RequirementPanel extends TURTLEPanel {
         if ((panels.elementAt(index) instanceof RequirementDiagramPanel)){
             return true;
         }
-		
-		if ((panels.elementAt(index) instanceof EBRDDPanel)){
+
+        if ((panels.elementAt(index) instanceof EBRDDPanel)){
             return true;
         }
-		
-		
+
+
         return false;
     }
-    
-     public boolean isReqEnabled() {
+
+    public boolean isReqEnabled() {
         return true;
     }
-	
-	public void addAllEBRDDPanels(ArrayList<EBRDDPanel> _al) {
-		for(int i=0; i<panels.size(); i++) {
-			if (panelAt(i) instanceof EBRDDPanel) {
-				_al.add(((EBRDDPanel)panelAt(i)));
-			}
-		}
-	}
-    
 
-}
\ No newline at end of file
+    public void addAllEBRDDPanels(ArrayList<EBRDDPanel> _al) {
+        for(int i=0; i<panels.size(); i++) {
+            if (panelAt(i) instanceof EBRDDPanel) {
+                _al.add(((EBRDDPanel)panelAt(i)));
+            }
+        }
+    }
+
+
+}
diff --git a/src/ui/SysmlsecMethodologyPanel.java b/src/ui/SysmlsecMethodologyPanel.java
index 6e412c5f392c4e45ea8ed3ca952b1ee25a7fb430..78b01c4e2e710d6f59cf0eac9f1dab9efa04d079 100755
--- a/src/ui/SysmlsecMethodologyPanel.java
+++ b/src/ui/SysmlsecMethodologyPanel.java
@@ -38,7 +38,7 @@
    /**
    * Class SysmlsecMethodologyPanel
    * Managenemt of the sysmlsec methodology panels
-   * Creation: 26/0&/2016
+   * Creation: 26/01/2016
    * @version 1.1 26/01/2016
    * @author Ludovic APVRILLE
    * @see MainGUI
@@ -280,9 +280,11 @@ public class SysmlsecMethodologyPanel extends TURTLEPanel {
 
 
 
-
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"Sysmlsec Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"Sysmlsec Methodology\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"Sysmlsec Methodology\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/TDiagramPanel.java b/src/ui/TDiagramPanel.java
index 4311c05cf4c6469f1484d9e3be9d939b686127f3..fb5973f94187ed634029ac78fdefa08cecac1baa 100755
--- a/src/ui/TDiagramPanel.java
+++ b/src/ui/TDiagramPanel.java
@@ -1617,7 +1617,7 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree {
             }
         }
 		if (e.getSource() == checkLatency) {
-			if (componentPopup instanceof CheckableAccessibility){
+			if (componentPopup instanceof CheckableLatency){
 				componentPopup.setCheckLatency(!componentPopup.getCheckLatency());
 			}
 		}
@@ -1852,7 +1852,7 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree {
 
         }
 
-        if (componentPointed instanceof CheckableAccessibility){
+        if (componentPointed instanceof CheckableLatency){
             checkLatency.setEnabled(true);
         } else {
             checkLatency.setEnabled(false);
diff --git a/src/ui/TMLArchiPanel.java b/src/ui/TMLArchiPanel.java
index 50c3cd5d029f661a4515fd0ed4eb618c538b95a9..0302cf8d7d8df95a5fd17dfc91542c03ff981193 100755
--- a/src/ui/TMLArchiPanel.java
+++ b/src/ui/TMLArchiPanel.java
@@ -101,8 +101,11 @@ public class TMLArchiPanel extends TURTLEPanel {
  
     }
     
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"TML Architecture\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"TML Architecture\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"TML Architecture\" nameTab=\"" + mgui.getTabName(this) + extensionToName +"\" >\n";
     }
     
     public String saveTailInXml() {
diff --git a/src/ui/TMLCommunicationPatternPanel.java b/src/ui/TMLCommunicationPatternPanel.java
index d468db0f4b42e0cf2e2528dbd05b6bf3e0851235..5faf2ad58353d7e5620caf181d4cbc34473dbe01 100755
--- a/src/ui/TMLCommunicationPatternPanel.java
+++ b/src/ui/TMLCommunicationPatternPanel.java
@@ -163,8 +163,12 @@ public class TMLCommunicationPatternPanel extends TURTLEPanel {
 
     }
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"TML CP\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"TML CP\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"TML CP\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/TMLComponentDesignPanel.java b/src/ui/TMLComponentDesignPanel.java
index c5eaab940e3ded609e8160d0156ce40a86235200..f11f05c999c39f2d4eb6a07aa10d99ffbf00b80b 100755
--- a/src/ui/TMLComponentDesignPanel.java
+++ b/src/ui/TMLComponentDesignPanel.java
@@ -147,8 +147,12 @@ public class TMLComponentDesignPanel extends TURTLEPanel {
 
     }
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"TML Component Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+     public String saveHeaderInXml(String extensionToName) {
+	 if (extensionToName == null) {
+	     return "<Modeling type=\"TML Component Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	 }
+	 return "<Modeling type=\"TML Component Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
+	 
     }
 
     public String saveTailInXml() {
diff --git a/src/ui/TMLDesignPanel.java b/src/ui/TMLDesignPanel.java
index f841c483cfa85807f74141c3eafd87f8ae1fce82..38705e3b00c6da96cf0b6eaa19c36584bc0fff4a 100755
--- a/src/ui/TMLDesignPanel.java
+++ b/src/ui/TMLDesignPanel.java
@@ -1,50 +1,50 @@
 /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici
 
-ludovic.apvrille AT enst.fr
-andrea.enrici AT enst.fr
-
-This software is a computer program whose purpose is to allow the 
-edition of TURTLE analysis, design and deployment diagrams, to 
-allow the generation of RT-LOTOS or Java code from this diagram, 
-and at last to allow the analysis of formal validation traces 
-obtained from external tools, e.g. RTL from LAAS-CNRS and CADP 
-from INRIA Rhone-Alpes.
-
-This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
-modify and/ or redistribute the software under the terms of the CeCILL
-license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
-
-As a counterpart to the access to the source code and  rights to copy,
-modify and redistribute granted by the license, users are provided only
-with a limited warranty  and the software's author,  the holder of the
-economic rights,  and the successive licensors  have only  limited
-liability. 
-
-In this respect, the user's attention is drawn to the risks associated
-with loading,  using,  modifying and/or developing or reproducing the
-software by the user in light of its specific status of free software,
-that may mean  that it is complicated to manipulate,  and  that  also
-therefore means  that it is reserved for developers  and  experienced
-professionals having in-depth computer knowledge. Users are therefore
-encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
-
-The fact that you are presently reading this means that you have had
-knowledge of the CeCILL license and that you accept its terms.
-
-/**
- * Class TMLDesignPanel
- * Managenemt of TML design panels
- * Creation: 27/10/2006
- * @version 1.0 28/05/2014
- * @author Ludovic APVRILLE, Andrea ENRICI
- * @see MainGUI
- */
- 
+   ludovic.apvrille AT enst.fr
+   andrea.enrici AT enst.fr
+
+   This software is a computer program whose purpose is to allow the
+   edition of TURTLE analysis, design and deployment diagrams, to
+   allow the generation of RT-LOTOS or Java code from this diagram,
+   and at last to allow the analysis of formal validation traces
+   obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+   from INRIA Rhone-Alpes.
+
+   This software is governed by the CeCILL  license under French law and
+   abiding by the rules of distribution of free software.  You can  use,
+   modify and/ or redistribute the software under the terms of the CeCILL
+   license as circulated by CEA, CNRS and INRIA at the following URL
+   "http://www.cecill.info".
+
+   As a counterpart to the access to the source code and  rights to copy,
+   modify and redistribute granted by the license, users are provided only
+   with a limited warranty  and the software's author,  the holder of the
+   economic rights,  and the successive licensors  have only  limited
+   liability.
+
+   In this respect, the user's attention is drawn to the risks associated
+   with loading,  using,  modifying and/or developing or reproducing the
+   software by the user in light of its specific status of free software,
+   that may mean  that it is complicated to manipulate,  and  that  also
+   therefore means  that it is reserved for developers  and  experienced
+   professionals having in-depth computer knowledge. Users are therefore
+   encouraged to load and test the software's suitability as regards their
+   requirements in conditions enabling the security of their systems and/or
+   data to be ensured and,  more generally, to use and operate it in the
+   same conditions as regards security.
+
+   The fact that you are presently reading this means that you have had
+   knowledge of the CeCILL license and that you accept its terms.
+
+   /**
+   * Class TMLDesignPanel
+   * Managenemt of TML design panels
+   * Creation: 27/10/2006
+   * @version 1.0 28/05/2014
+   * @author Ludovic APVRILLE, Andrea ENRICI
+   * @see MainGUI
+   */
+
 package ui;
 
 import java.awt.*;
@@ -56,22 +56,22 @@ import ui.tmlad.*;
 import ui.tmldd.*;
 
 public class TMLDesignPanel extends TURTLEPanel {
-    public TMLTaskDiagramPanel tmltdp; 
+    public TMLTaskDiagramPanel tmltdp;
     public Vector<TGComponent> validated, ignored;
-    
+
     public TMLDesignPanel(MainGUI _mgui) {
         super(_mgui);
         tabbedPane = new JTabbedPane();
         cl = new ChangeListener() {
-            public void stateChanged(ChangeEvent e){
-                mgui.paneDesignAction(e);
-            }
-        };
+                public void stateChanged(ChangeEvent e){
+                    mgui.paneDesignAction(e);
+                }
+            };
         tabbedPane.addChangeListener(cl);
         tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui));
     }
-    
-   public TMLActivityDiagramPanel getTMLActivityDiagramPanel(String name) {
+
+    public TMLActivityDiagramPanel getTMLActivityDiagramPanel(String name) {
         TMLActivityDiagramPanel tmladp;
         for(int i=1; i<panels.size(); i++) {
             tmladp = (TMLActivityDiagramPanel)(panels.elementAt(i));
@@ -84,14 +84,14 @@ public class TMLDesignPanel extends TURTLEPanel {
     public void addTMLActivityDiagram(String s) {
         JPanel toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-        
-        TMLActivityDiagramToolBar toolBarActivity	= new TMLActivityDiagramToolBar(mgui);
+
+        TMLActivityDiagramToolBar toolBarActivity       = new TMLActivityDiagramToolBar(mgui);
         toolbars.add(toolBarActivity);
-        
+
         TMLActivityDiagramPanel tmladp = new TMLActivityDiagramPanel(mgui, toolBarActivity);
         tmladp.tp = this;
         tmladp.setName(s);
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(tmladp);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(tmladp);
         tmladp.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement( MainGUI.INCREMENT );
@@ -99,26 +99,26 @@ public class TMLDesignPanel extends TURTLEPanel {
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         panels.add(tmladp);
         tabbedPane.addTab(s, IconManager.imgic63, toolBarPanel, "Opens the activity diagram of " + s);
-   
+
         return;
     }
-    
+
     public void init() {
-         
+
         //  Class Diagram toolbar
         TMLTaskDiagramToolBar toolBarTML = new TMLTaskDiagramToolBar(mgui);
         toolbars.add(toolBarTML);
-        
+
         toolBarPanel = new JPanel();
         toolBarPanel.setLayout(new BorderLayout());
-        
-        //Class	diagram
+
+        //Class diagram
         tmltdp = new TMLTaskDiagramPanel(mgui, toolBarTML);
         tmltdp.setName("TML Task Diagram");
         tmltdp.tp = this;
         tdp = tmltdp;
         panels.add(tmltdp); // Always first in list
-        JScrollDiagramPanel jsp	= new JScrollDiagramPanel(tmltdp);
+        JScrollDiagramPanel jsp = new JScrollDiagramPanel(tmltdp);
         tmltdp.jsp = jsp;
         jsp.setWheelScrollingEnabled(true);
         jsp.getVerticalScrollBar().setUnitIncrement( MainGUI.INCREMENT );
@@ -126,62 +126,65 @@ public class TMLDesignPanel extends TURTLEPanel {
         toolBarPanel.add(jsp, BorderLayout.CENTER);
         tabbedPane.addTab("TML Task Diagram", IconManager.imgic62, toolBarPanel, "Opens TML task diagram");
         tabbedPane.setSelectedIndex(0);
-        
+
         mgui.changeMade(tmltdp, TDiagramPanel.NEW_COMPONENT);
-        
+
         //jsp.setVisible(true);
- 
+
     }
-    
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"TML Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; 
+
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"TML Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"TML Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
-    
+
     public String saveTailInXml() {
         return "</Modeling>\n\n\n";
     }
-    
+
     public String toString() {
         return mgui.getTitleAt(this) + " (TML Functional View)";
     }
-	
-	public ArrayList<String> getAllTMLTaskNames(String _name) {
-		return tmltdp.getAllTMLTaskNames(_name);
-	}
 
-	public ArrayList<String> getAllTMLCommunicationNames(String _name) {
-		return tmltdp.getAllTMLCommunicationNames(_name);
-	}
-	
-	public ArrayList<String> getAllTMLEventNames( String _name ) {
-		return tmltdp.getAllTMLEventNames( _name );
-	}
+    public ArrayList<String> getAllTMLTaskNames(String _name) {
+        return tmltdp.getAllTMLTaskNames(_name);
+    }
+
+    public ArrayList<String> getAllTMLCommunicationNames(String _name) {
+        return tmltdp.getAllTMLCommunicationNames(_name);
+    }
+
+    public ArrayList<String> getAllTMLEventNames( String _name ) {
+        return tmltdp.getAllTMLEventNames( _name );
+    }
+
+    public java.util.List<String> getAllNonMappedTMLTaskNames(String _name, TMLArchiDiagramPanel _tadp, boolean ref, String name) {
+        return tmltdp.getAllNonMappedTMLTaskNames(_name, _tadp, ref, name);
+    }
+
+    public TMLTaskOperator getTaskByName(String _name) {
+        return tmltdp.getTaskByName(_name);
+    }
+
+    public void getListOfBreakPoints(ArrayList<Point> points) {
+        TGComponent tgc;
+        Iterator<TGComponent> iterator = tmltdp.getComponentList().listIterator();
+        TMLTaskOperator tmlto;
+        TMLActivityDiagramPanel tmladp;
 
-	public java.util.List<String> getAllNonMappedTMLTaskNames(String _name, TMLArchiDiagramPanel _tadp, boolean ref, String name) {
-		return tmltdp.getAllNonMappedTMLTaskNames(_name, _tadp, ref, name);
-	}
-	
-	public TMLTaskOperator getTaskByName(String _name) {
-		return tmltdp.getTaskByName(_name);
-	}
-	
-	public void getListOfBreakPoints(ArrayList<Point> points) {
-		TGComponent tgc;
-		Iterator<TGComponent> iterator = tmltdp.getComponentList().listIterator();
-		TMLTaskOperator tmlto;
-		TMLActivityDiagramPanel tmladp;
-		
         while(iterator.hasNext()) {
             tgc = iterator.next();
-            
+
             if (tgc instanceof TMLTaskOperator) {
                 tmlto = (TMLTaskOperator)tgc;
-				
+
                 if (tmlto.getDIPLOID() != -1) {
-					tmladp = getTMLActivityDiagramPanel(tmlto.getValue());
-					tmladp.getListOfBreakPoints(points, tmlto.getDIPLOID());
-				}
-			}
-		}
-	}
+                    tmladp = getTMLActivityDiagramPanel(tmlto.getValue());
+                    tmladp.getListOfBreakPoints(points, tmlto.getDIPLOID());
+                }
+            }
+        }
+    }
 }
diff --git a/src/ui/TURTLEOSDesignPanel.java b/src/ui/TURTLEOSDesignPanel.java
index 53a23b173ec105062699064fcc4a934a9f78cab9..e8125f1925a44eafbeb35cfc1c7c927cbe481719 100755
--- a/src/ui/TURTLEOSDesignPanel.java
+++ b/src/ui/TURTLEOSDesignPanel.java
@@ -135,8 +135,11 @@ public class TURTLEOSDesignPanel extends TURTLEPanel implements TURTLEDesignPane
           tabbedPane.setSelectedIndex(0);
     }
 
-    public String saveHeaderInXml() {
-        return "<Modeling type=\"TURTLE-OS Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+    public String saveHeaderInXml(String extensionToName) {
+	if (extensionToName == null) {
+	    return "<Modeling type=\"TURTLE-OS Design\" nameTab=\"" + mgui.getTabName(this) + "\" >\n";
+	}
+	return "<Modeling type=\"TURTLE-OS Design\" nameTab=\"" + mgui.getTabName(this) + extensionToName + "\" >\n";
     }
 
     public String saveTailInXml() {
@@ -147,4 +150,4 @@ public class TURTLEOSDesignPanel extends TURTLEPanel implements TURTLEDesignPane
         return "TURTLE-OS: " + mgui.getTitleAt(this);
     }
 
-}
\ No newline at end of file
+}
diff --git a/src/ui/TURTLEPanel.java b/src/ui/TURTLEPanel.java
index 4cf9dd39acd13034cf9ac7c6a19441be375f38e1..3c0f39bd6bfe5737f80d56518128f4e6df9ce662 100755
--- a/src/ui/TURTLEPanel.java
+++ b/src/ui/TURTLEPanel.java
@@ -68,7 +68,7 @@ public abstract class TURTLEPanel implements GenericTree {
     }
 
     public abstract void init();
-    public abstract String saveHeaderInXml();
+    public abstract String saveHeaderInXml(String extensionToName);
     public abstract String saveTailInXml();
 
     public TDiagramPanel panelAt(int index) {
@@ -97,16 +97,20 @@ public abstract class TURTLEPanel implements GenericTree {
     }
 
     public StringBuffer saveInXML() {
+	return saveInXML(null);
+    }
+
+    public StringBuffer saveInXML(String extensionToName) {
 
         TDiagramPanel tdp;
         StringBuffer sb = new StringBuffer();
-        sb.append(saveHeaderInXml());
+        sb.append(saveHeaderInXml(extensionToName));
         StringBuffer s;
         for(int i=0; i<panels.size(); i++) {
             tdp = (TDiagramPanel)(panels.elementAt(i));
             s = tdp.saveInXML();
             if (s == null) {
-                System.out.println("Null diagram");
+                //System.out.println("Null diagram");
                 return null;
             }
             sb.append(s);
@@ -120,13 +124,13 @@ public abstract class TURTLEPanel implements GenericTree {
 
         TDiagramPanel tdp;
         StringBuffer sb = new StringBuffer();
-        sb.append(saveHeaderInXml());
+        sb.append(saveHeaderInXml(null));
         StringBuffer s;
 
         tdp = (TDiagramPanel)(panels.elementAt(indexOfDiagram));
         s = tdp.saveInXML();
         if (s == null) {
-            System.out.println("Null diagram");
+            //System.out.println("Null diagram");
             return null;
         }
         sb.append(s);
@@ -327,7 +331,7 @@ public abstract class TURTLEPanel implements GenericTree {
 
     public void searchForText(String text, Vector<Object> elements) {
         if (panelAt(0) != null) {
-            String s = saveHeaderInXml().toLowerCase();
+            String s = saveHeaderInXml(null).toLowerCase();
             if (s.indexOf(text) >= 0) {
                 elements.add(this);
                 /*CheckingError ce = new CheckingError(CheckingError.INFO, "Diagram");
diff --git a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
index 49ced3a977e02cdce86020789a182f21d73ed609..571d83784d0556476366b84e7839ed13f944c686 100755
--- a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
+++ b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java
@@ -978,6 +978,8 @@ public  class JFrameInteractiveSimulation extends JFrame implements ActionListen
         GridBagConstraints c0 = new GridBagConstraints();
         latencyPanel.setLayout(gridbag0);
         infoTab.addTab("Latency", null, latencyPanel, "Latency Measurements");
+        c0.gridwidth = GridBagConstraints.REMAINDER;
+		latencyPanel.add(new JLabel("Latencies shown in number of cycles relative to the main clock"), c0);
 
         c0.gridwidth=1;
         c0.gridheight=1;
diff --git a/src/ui/tmlad/TMLADActionState.java b/src/ui/tmlad/TMLADActionState.java
index dbf7fd158e7afcbdcb4b3576609ea7633b116b30..70c35adedc789f459b7218582e40759bd622f00f 100755
--- a/src/ui/tmlad/TMLADActionState.java
+++ b/src/ui/tmlad/TMLADActionState.java
@@ -52,7 +52,7 @@ import java.awt.geom.*;
 import myutil.*;
 import ui.*;
 
-public class TMLADActionState extends TGCOneLineText implements PreJavaCode, PostJavaCode, CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADActionState extends TGCOneLineText implements PreJavaCode, PostJavaCode, CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textY =  15;
diff --git a/src/ui/tmlad/TMLADReadChannel.java b/src/ui/tmlad/TMLADReadChannel.java
index aa2a0809957aaa824a428b27b20f7cd0b6830dcd..0d018f1e9b0f14b538d746c512243d6670f442a5 100755
--- a/src/ui/tmlad/TMLADReadChannel.java
+++ b/src/ui/tmlad/TMLADReadChannel.java
@@ -57,7 +57,7 @@ import myutil.*;
 import ui.*;
 import ui.window.*;
 
-public class TMLADReadChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADReadChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textX0 =  2;
diff --git a/src/ui/tmlad/TMLADSendEvent.java b/src/ui/tmlad/TMLADSendEvent.java
index b2eebdf41b7cfe91ae983aefd2afa6a893884842..a1e5ee8f5542ac3352671bfff35c23b7cd550862 100755
--- a/src/ui/tmlad/TMLADSendEvent.java
+++ b/src/ui/tmlad/TMLADSendEvent.java
@@ -58,7 +58,7 @@ import myutil.*;
 import ui.*;
 import ui.window.*;
 
-public class TMLADSendEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADSendEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textY =  15;
diff --git a/src/ui/tmlad/TMLADSendRequest.java b/src/ui/tmlad/TMLADSendRequest.java
index a4ac31f6ca436649cd9a49cf38538a299c7c93f5..4f222d921a879444aaa7d930c4d6603a6ade64cd 100755
--- a/src/ui/tmlad/TMLADSendRequest.java
+++ b/src/ui/tmlad/TMLADSendRequest.java
@@ -57,7 +57,7 @@ import myutil.*;
 import ui.*;
 import ui.window.*;
 
-public class TMLADSendRequest extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADSendRequest extends TGCWithoutInternalComponent implements CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textY =  15;
diff --git a/src/ui/tmlad/TMLADWaitEvent.java b/src/ui/tmlad/TMLADWaitEvent.java
index cee8f31ed2fd0189df45bfbf5d649ccea2a4bf18..a1df1de442fedfa6a3ef19a7364a29d2d0a60961 100755
--- a/src/ui/tmlad/TMLADWaitEvent.java
+++ b/src/ui/tmlad/TMLADWaitEvent.java
@@ -57,7 +57,7 @@ import myutil.*;
 import ui.*;
 import ui.window.*;
 
-public class TMLADWaitEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADWaitEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textY =  15;
diff --git a/src/ui/tmlad/TMLADWriteChannel.java b/src/ui/tmlad/TMLADWriteChannel.java
index 478c331fca556b4e5903b89eb7b67160003be26d..a9dc066c3b7a8f56b619a8fbe99d72810586d245 100755
--- a/src/ui/tmlad/TMLADWriteChannel.java
+++ b/src/ui/tmlad/TMLADWriteChannel.java
@@ -57,7 +57,7 @@ import myutil.*;
 import ui.*;
 import ui.window.*;
 
-public class TMLADWriteChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
+public class TMLADWriteChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, CheckableLatency, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight {
     protected int lineLength = 5;
     protected int textX =  5;
     protected int textY =  15;
diff --git a/src/ui/tmldd/TMLArchiPortArtifact.java b/src/ui/tmldd/TMLArchiPortArtifact.java
index f1c6a4d4575192660fc2e29f5a3c0f4ef8bd8993..6650ebcb454f356ef8697c800e3cbf59369306c8 100644
--- a/src/ui/tmldd/TMLArchiPortArtifact.java
+++ b/src/ui/tmldd/TMLArchiPortArtifact.java
@@ -157,9 +157,9 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements
             TGComponent tgc;
             if (tdp != null) {
                 if (mappedMemory.length() > 0) {
-                    ListIterator<TGComponent> iterator = tdp.getComponentList().listIterator();
+                    ListIterator iterator = tdp.getComponentList().listIterator();
                     while(iterator.hasNext()) {
-                        tgc = iterator.next();
+                        tgc = (TGComponent)(iterator.next());
                         if (tgc instanceof TMLArchiMemoryNode) {
                             if (tgc.getName().compareTo(mappedMemory) == 0) {
                                 GraphicLib.dashedLine(g, getX() + getWidth()/2, getY() + getHeight()/2, tgc.getX() + tgc.getWidth()/2, tgc.getY() + tgc.getHeight()/2);
@@ -200,14 +200,17 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements
         String tmp;
         boolean error = false;
 
-        TraceManager.addDev( "bufferParameters before opening the window: " + bufferParameters.toString() );
-        JDialogPortArtifact dialog = new JDialogPortArtifact(frame, "Setting port artifact attributes", this, mappedMemory, bufferParameters, value );
-        //dialog.setSize(700, 600);
-        GraphicLib.centerOnParent(dialog, 700, 600);
-        dialog.setVisible( true ); // blocked until dialog has been closed
+        // Get the list of all other TMLArchiPortArtifact.java and retrieve the mapped ports
+		Vector<String> portsList = this.getTDiagramPanel().getMGUI().getAllTMLInputPorts();
+
+        //TraceManager.addDev( "bufferParameters before opening the window: " + bufferParameters.toString() );
+        JDialogPortArtifact dialog = new JDialogPortArtifact( frame, "Setting port artifact attributes", this, mappedMemory, portsList, value );
+        dialog.setSize(700, 600);
+        GraphicLib.centerOnParent(dialog);
+        dialog.show(); // blocked until dialog has been closed
         mappedMemory = dialog.getMappedMemory();
         bufferParameters = dialog.getBufferParameters();        //becomes empty if closing the window without pushing Save
-        TraceManager.addDev( "bufferParameters after closing the window: " + bufferParameters.toString() );
+        //TraceManager.addDev( "bufferParameters after closing the window: " + bufferParameters.toString() );
         bufferType = bufferParameters.get( Buffer.BUFFER_TYPE_INDEX );
 
         TraceManager.addDev( "mapped Port: " + dialog.getMappedPort() );
@@ -313,7 +316,7 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements
             NodeList nli;
             Node n1, n2;
             Element elt;
-   //         int t1id;
+            int t1id;
             String svalue = null, sname = null, sreferenceCommunication = null, stype = null;
             //String prio = null;
 
@@ -322,8 +325,8 @@ public class TMLArchiPortArtifact extends TGCWithoutInternalComponent implements
                 //System.out.println(n1);
                 if (n1.getNodeType() == Node.ELEMENT_NODE) {
                     nli = n1.getChildNodes();
-                    for(int j=0; j<nli.getLength(); j++) {
-                        n2 = nli.item(j);
+                    for(int j=0; i<nli.getLength(); i++) {
+                        n2 = nli.item(i);
                         //System.out.println(n2);
                         if (n2.getNodeType() == Node.ELEMENT_NODE) {
                             elt = (Element) n2;
diff --git a/src/ui/window/JDialogPortArtifact.java b/src/ui/window/JDialogPortArtifact.java
index c2a3c9dced6e24d2e314255b717eac9a8feadd6d..792787025f91b8b1fede7184dba37b24b5fb0c70 100755
--- a/src/ui/window/JDialogPortArtifact.java
+++ b/src/ui/window/JDialogPortArtifact.java
@@ -1,575 +1,469 @@
-/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea ENRICI
- *
- * ludovic.apvrille AT enst.fr, andrea.enrici AT nokia.com
- *
- * This software is a computer program whose purpose is to allow the
- * edition of TURTLE analysis, design and deployment diagrams, to
- * allow the generation of RT-LOTOS or Java code from this diagram,
- * and at last to allow the analysis of formal validation traces
- * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
- * from INRIA Rhone-Alpes.
- *
- * This software is governed by the CeCILL  license under French law and
- * abiding by the rules of distribution of free software.  You can  use,
- * modify and/ or redistribute the software under the terms of the CeCILL
- * license as circulated by CEA, CNRS and INRIA at the following URL
- * "http://www.cecill.info".
- *
- * As a counterpart to the access to the source code and  rights to copy,
- * modify and redistribute granted by the license, users are provided only
- * with a limited warranty  and the software's author,  the holder of the
- * economic rights,  and the successive licensors  have only  limited
- * liability.
- *
- * In this respect, the user's attention is drawn to the risks associated
- * with loading,  using,  modifying and/or developing or reproducing the
- * software by the user in light of its specific status of free software,
- * that may mean  that it is complicated to manipulate,  and  that  also
- * therefore means  that it is reserved for developers  and  experienced
- * professionals having in-depth computer knowledge. Users are therefore
- * encouraged to load and test the software's suitability as regards their
- * requirements in conditions enabling the security of their systems and/or
- * data to be ensured and,  more generally, to use and operate it in the
- * same conditions as regards security.
- *
- * The fact that you are presently reading this means that you have had
- * knowledge of the CeCILL license and that you accept its terms.
- *
- * /**
- * Class JDialogTMLTaskArtifact
- * Dialog for managing artifact to map ports onto CPs
- * Creation: 19/09/2007
- * @version 1.0 19/09/2007
- * @author Ludovic APVRILLE, Andrea ENRICI
- * @see
- */
-
-package ui.window;
-
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-import java.util.*;
-
-import ui.*;
-import ui.tmldd.*;
-import tmltranslator.modelcompiler.*;
-
-import myutil.*;
-
-
-public class JDialogPortArtifact extends javax.swing.JDialog implements ActionListener  {
-    
-	private boolean regularClose;
-	private boolean emptyPortsList = false;
-    
-    private JPanel panel2;
-    private Frame frame;
-    private TMLArchiPortArtifact artifact;
-    private String mappedMemory = "VOID"; 
-
-	protected JComboBox<String> mappedPortCB, memoryCB;
-	protected JTextField baseAddressTF, numSamplesTF, bitsPerSymbolTF;
-	protected String baseAddress, mappedPort, sampleLength, numSamples, bitsPerSymbol;
-	protected String bank, dataType, symmetricalValue;
-	protected JComboBox<String> dataTypeCB, bankCB, symmetricalValueCB;
-
-	//Intl Data In
-	protected JTextField widthIntl_TF, bitInOffsetIntl_TF, inputOffsetIntl_TF;
-	protected String widthIntl, bitInOffsetIntl, inputOffsetIntl, packedBinaryInIntl;
-	protected JComboBox<String> packedBinaryInIntl_CB;
-
-	//Intl Data Out
-	protected JTextField bitOutOffsetIntl_TF, outputOffsetIntl_TF;
-	protected JComboBox<String> packedBinaryOutIntl_CB;
-	protected String packedBinaryOutIntl, bitOutOffsetIntl, outputOffsetIntl;
-
-	//Intl Perm
-	protected JTextField lengthPermIntl_TF, offsetPermIntl_TF;
-	protected String lengthPermIntl, offsetPermIntl;
-
-	//Mapper Data In
-	protected JTextField baseAddressDataInMapp_TF, numSamplesDataInMapp_TF, bitsPerSymbolDataInMapp_TF;
-	protected String baseAddressDataInMapp, numSamplesDataInMapp, bitsPerSymbolDataInMapp, symmetricalValueDataInMapp;
-	protected JComboBox<String> symmetricalValueDataInMapp_CB;
-	//Mapper Data Out
-	protected JTextField baseAddressDataOutMapp_TF;
-	protected String baseAddressDataOutMapp;
-	//Mapper LUT
-	protected JTextField baseAddressLUTMapp_TF;
-	protected String baseAddressLUTMapp;
-	
-  // Main Panel
-  private JButton closeButton;
-  private JButton cancelButton;
-
-	//Code generation
-	private JPanel panel3; /*panel4, panel5*/;
-	private JTabbedPane tabbedPane;
-	private int bufferType = 0;
-	private ArrayList<String> bufferParameters;
-//private String appName = "";
-    
-    /** Creates new form  */
-    public JDialogPortArtifact(Frame _frame, String _title, TMLArchiPortArtifact _artifact, String _mappedMemory, ArrayList<String> _bufferParameters, String _mappedPort ) {
-			super(_frame, _title, true);
-			frame = _frame;
-			artifact = _artifact;
-			mappedMemory = _mappedMemory;
-			bufferParameters = _bufferParameters; //contains a set of parameters that are read from the xml description. The first parameters is the buffer type
-			mappedPort = _mappedPort;
-			//appName = mappedPort.split("::")[0];
-
-			TraceManager.addDev("init components");
-
-			initComponents();
-
-			TraceManager.addDev("pack");
-			pack();
-    }
-    
-    private void initComponents() {
-
-        Container c = getContentPane();
-        GridBagLayout gridbag0 = new GridBagLayout();
-      //  GridBagLayout gridbag1 = new GridBagLayout();
-        GridBagLayout gridbag2 = new GridBagLayout();
-        GridBagConstraints c0 = new GridBagConstraints();
-        GridBagConstraints c1 = new GridBagConstraints();
-        GridBagConstraints c2 = new GridBagConstraints();
-        
-        setFont(new Font("Helvetica", Font.PLAIN, 14));
-        c.setLayout(gridbag0);
-        
-        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-        
-        panel2 = new JPanel();
-        panel2.setLayout(gridbag2);
-        panel2.setBorder(new javax.swing.border.TitledBorder("Artifact attributes"));
-        panel2.setPreferredSize(new Dimension(650, 350));
-
-        panel3 = new JPanel();
-        panel3.setLayout(gridbag2);
-        panel3.setBorder(new javax.swing.border.TitledBorder("Code generation: memory configuration"));
-        panel3.setPreferredSize(new Dimension(650, 350));
-
-        tabbedPane = new JTabbedPane();
-//        panel4 = new JPanel();
-//        panel5 = new JPanel();
-        
-		c1.gridwidth = 1;
-        c1.gridheight = 1;
-        c1.weighty = 1.0;
-        c1.weightx = 1.0;
-        c1.fill = GridBagConstraints.HORIZONTAL;
-        c1.gridwidth = GridBagConstraints.REMAINDER; //end row
-		TraceManager.addDev("Getting communications");
-		//Vector<String> list = artifact.getTDiagramPanel().getMGUI().getAllTMLCommunicationNames();
-		Vector<String> portsList = artifact.getTDiagramPanel().getMGUI().getAllTMLInputPorts();
-   		//Vector<String> portsList = new Vector<String>();
-        TraceManager.addDev( "The list of input ports is:\n" + portsList.toString() );
-        if( portsList.size() == 0 ) {
-            emptyPortsList = true;
-            portsList.add( "No available port" );
-        }
-
-        // Build the list of available ports, if there is an application diagram
-        /*if( list.size() > 0 )   {
-	    	int index = 0;
-            //parse each entry of list. Entry is in format AppName::chIn__chOut
-            for( String s: list )	{
-                TraceManager.addDev( "Testing if " + s + " contains " + appName + "...");
-                if( s.contains( appName ) )	{	//build the DS for the mapped applications (filter out the case of multiple applications)
-                    //TraceManager.addDev( "Parsing: " + s );
-                    String[] temp1 = s.split("__");
-					String[] temp2 = temp1[0].split( "::" );
-    				String chOut = temp2[0] + "::" + temp1[1];
-                    //TraceManager.addDev( "chOut = " + chOut );
-                    String chIn = temp2[0] + "::" + temp2[1];
-                    //TraceManager.addDev( "chIn = " + chIn );
-                    if( !portsList.contains( chOut ) )	{
-                        portsList.add( chOut );
-                    }
-                    if( !portsList.contains( chIn ) )	{
-                        portsList.add( chIn );
-                    }
-		    	}
-            }
-		}
-        else    {
-            list.add( "No communication to map" );
-            emptyPortsList = true;
-            portsList.add( "No available port" );
-        }*/
-		
-		TraceManager.addDev( "Got communications" );
-
-        mappedPortCB = new JComboBox<String>( portsList );
-		if( !mappedPort.equals( "VOID" ) && !mappedPort.equals( "" ) )	{
-			mappedPortCB.setSelectedIndex( portsList.indexOf( mappedPort ) );
-		}
-		else	{
-			mappedPortCB.setSelectedIndex( 0 );
-		}
-        panel2.add( new JLabel( "Port:" ), c2 );
-		mappedPortCB.addActionListener(this);
-		panel2.add( mappedPortCB, c1 );
-		
-		//Make the list of memories that are available for being mapped
-		java.util.List<TGComponent> componentList = artifact.getTDiagramPanel().getComponentList();
-		Vector<String> memoryList = new Vector<String>();
-		for( int k = 0; k < componentList.size(); k++ )	{
-			if( componentList.get(k) instanceof TMLArchiMemoryNode )	{
-				memoryList.add( ( (TMLArchiMemoryNode) componentList.get(k) ).getName() );
-			}
-		}
-        if( memoryList.size() == 0 )    { // In case there are no memories in the design
-            memoryList.add( "No available memory" );              
-        }
-
-		memoryCB = new JComboBox<String>( memoryList );
-		if( !mappedMemory.equals( "VOID" ) && !mappedMemory.equals( "" ) )	{
-			memoryCB.setSelectedIndex( memoryList.indexOf( mappedMemory ) );
-		}
-		else	{
-			memoryCB.setSelectedIndex( 0 );
-		}
-		panel2.add( new JLabel( "Memory: "),  c2 );
-		memoryCB.addActionListener(this);
-		panel2.add( memoryCB, c1 );
-
-        if( (emptyPortsList) || (memoryList.size() == 0) )  {
-            //the project does not contain an application diagram, or the platform diagram does not contain any memory or both
-            bufferType = Buffer.ANOMALY;
-        }
-        else    {
-            //Must distinguish between 2 cases:
-            // - bufferParameters is empty because the user has just instantiated the artifact
-            // - bufferParameters is not empty as the user had already done some mapping
-            if( bufferParameters.size() == 0 )  {   //assign to bufferType the type of the first memory in memoryList
-		        for( int k = 0; k < componentList.size(); k++ )	{
-        			if( componentList.get(k) instanceof TMLArchiMemoryNode )	{
-		        		if( ((TMLArchiMemoryNode) componentList.get(k)).getName().equals( memoryList.get(0) ) ) {
-				            bufferType = ((TMLArchiMemoryNode)componentList.get(k)).getBufferType();
-                            break;
-                        }
-        			}
-		        }
-               // String memoryName = memoryList.get(0);
-                //TraceManager.addDev( "bufferType of " + memoryName + " is " + bufferType );
-            }
-            else    {
-                bufferType = Integer.parseInt( bufferParameters.get( Buffer.BUFFER_TYPE_INDEX ) );
-            }
-        }
-
-		ArrayList<JPanel> panelsList;
-
-		switch( bufferType )	{
-			case Buffer.FEP_BUFFER:	
-				panelsList = FepBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				break;
-			case Buffer.INTERLEAVER_BUFFER:	
-				panelsList = InterleaverBuffer.makePanel( c1, c2 );
-				tabbedPane.addTab( "Data In", panelsList.get(0) );
-				tabbedPane.addTab( "Data Out", panelsList.get(1) );
-				tabbedPane.addTab( "Permutation Table", panelsList.get(2) );
-				tabbedPane.setSelectedIndex(0);
-				break;
-			case Buffer.ADAIF_BUFFER:	
-				panelsList = AdaifBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				break;
-			case Buffer.MAPPER_BUFFER:	
-				tabbedPane.removeAll();
-				panelsList = MapperBuffer.makePanel( c1, c2 );
-				tabbedPane.addTab( "Data In", panelsList.get(0) );
-				tabbedPane.addTab( "Data Out", panelsList.get(1) );
-				tabbedPane.addTab( "Look Up Table", panelsList.get(2) );
-				tabbedPane.setSelectedIndex(0);
-				break;
-			case Buffer.MAIN_MEMORY_BUFFER:	
-				panelsList = MMBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				break;
-			default:	//the FEP buffer, arbitrary choice - Control flow goes here if there is an anomaly but no tabbedPane is added below
-				panelsList = FepBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				break;
-		}
-
-		// main panel;
-		c0.gridheight = 10;
-		c0.weighty = 1.0;
-		c0.weightx = 1.0;
-		c0.gridwidth = GridBagConstraints.REMAINDER; //end row
-		c0.fill = GridBagConstraints.BOTH;
-		c.add( panel2, c0 );
-
-        if( ( bufferType == Buffer.MAIN_MEMORY_BUFFER ) || ( bufferType == Buffer.FEP_BUFFER ) || ( bufferType == Buffer.ADAIF_BUFFER ) )    {
-            panel3.setBorder( new javax.swing.border.TitledBorder( "Code generation: memory configuration" ) );
-			tabbedPane.removeAll();
-			tabbedPane.addTab( "Data", panel3 );
-			tabbedPane.setSelectedIndex( 0 );
-		}
-        if( bufferType != Buffer.ANOMALY )  { //Don't add the tabbedPane is there is a bufferType anomaly
-    		c.add( tabbedPane, c0 );
-        }
-
-		c0.gridwidth = 1;
-		c0.gridheight = 1;
-		c0.fill = GridBagConstraints.HORIZONTAL;
-		closeButton = new JButton("Save and Close", IconManager.imgic25);
-		//closeButton.setPreferredSize(new Dimension(600, 50));
-		closeButton.addActionListener(this);
-		c.add(closeButton, c0);
-		c0.gridwidth = GridBagConstraints.REMAINDER; //end row
-		cancelButton = new JButton("Cancel", IconManager.imgic27);
-		cancelButton.addActionListener(this);
-		c.add(cancelButton, c0);
-  }
-
-	private int getBufferTypeFromSelectedMemory( String mappedMemory )	{
-		
-		java.util.List<TGComponent> componentList = artifact.getTDiagramPanel().getComponentList();
-		//Vector<String> list = new Vector<String>();
-		
-		for( int k = 0; k < componentList.size(); k++ )	{
-			if( componentList.get(k) instanceof TMLArchiMemoryNode )	{
-				TMLArchiMemoryNode memoryNode = (TMLArchiMemoryNode)componentList.get(k);
-				if( memoryNode.getName().equals( mappedMemory ) )	{
-					return memoryNode.getBufferType();
-				}
-			}
-		}
-		return 0;	//default: the main memory buffer
-	}
-    
-  public void	actionPerformed(ActionEvent evt)  {
-
-		if( evt.getSource() == memoryCB )	{
-			updateBufferPanel();
-		}
-        
-    String command = evt.getActionCommand();
-    // Compare the action command to the known actions.
-   	if (command.equals("Save and Close"))  {
-    	closeDialog();
-    } else if (command.equals("Cancel")) {
-    	cancelDialog();
-		}
-	}
-
-	private void updateBufferPanel()	{
-
-		GridBagConstraints c1 = new GridBagConstraints();
-		GridBagConstraints c2 = new GridBagConstraints();
-
-		c1.gridwidth = 1;
-		c1.gridheight = 1;
-		c1.weighty = 1.0;
-		c1.weightx = 1.0;
-		c1.fill = GridBagConstraints.HORIZONTAL;
-    c1.gridwidth = GridBagConstraints.REMAINDER; //end row
-		
-		//flushBuffersStrings();
-		bufferType = getBufferTypeFromSelectedMemory( (String)memoryCB.getItemAt( memoryCB.getSelectedIndex() ) );
-		ArrayList<JPanel> panelsList;
-
-		switch( bufferType )	{
-			case Buffer.FEP_BUFFER:	
-				tabbedPane.removeAll();
-				panelsList = FepBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				tabbedPane.addTab( "Data", panel3 );
-				break;
-			case Buffer.MAPPER_BUFFER:	
-				tabbedPane.removeAll();
-				panelsList = MapperBuffer.makePanel( c1, c2 );
-				tabbedPane.addTab( "Data In", panelsList.get(0) );
-				tabbedPane.addTab( "Data Out", panelsList.get(1) );
-				tabbedPane.addTab( "Look Up Table", panelsList.get(2) );
-				tabbedPane.setSelectedIndex(0);
-				break;
-			case Buffer.ADAIF_BUFFER:	
-				tabbedPane.removeAll();
-				panelsList = AdaifBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				tabbedPane.addTab( "Data", panel3 );
-				break;
-			case Buffer.INTERLEAVER_BUFFER:
-				tabbedPane.removeAll();
-				panelsList = InterleaverBuffer.makePanel( c1, c2 );
-				tabbedPane.addTab( "Data In", panelsList.get(0) );
-				tabbedPane.addTab( "Data Out", panelsList.get(1) );
-				tabbedPane.addTab( "Permutation Table", panelsList.get(2) );
-				tabbedPane.setSelectedIndex(0);
-				break;
-			case Buffer.MAIN_MEMORY_BUFFER:	
-				tabbedPane.removeAll();
-				panelsList = MMBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				tabbedPane.addTab( "Data", panel3 );
-				break;
-			default:	//the main memory buffer 
-				tabbedPane.removeAll();
-				panelsList = FepBuffer.makePanel( c1, c2 );
-				panel3 = panelsList.get(0);
-				tabbedPane.addTab( "Data", panel3 );
-				break;
-		}
-	}
-
-    public void closeDialog() {
-
-        regularClose = true;
-				mappedMemory = (String) memoryCB.getItemAt( memoryCB.getSelectedIndex() );
-				bufferType = getBufferTypeFromSelectedMemory( (String)memoryCB.getItemAt( memoryCB.getSelectedIndex() ) );
-				switch ( bufferType )	{
-					case Buffer.FEP_BUFFER:
-						if( !FepBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-					case Buffer.MAPPER_BUFFER:	
-						if( !MapperBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-					case Buffer.ADAIF_BUFFER:	
-						if( !AdaifBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-					case Buffer.INTERLEAVER_BUFFER:	
-						if( !InterleaverBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-					case Buffer.MAIN_MEMORY_BUFFER:	
-						if( !MMBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-					default:	//the main memory buffer 
-						if( !FepBuffer.closePanel( frame ) )	{
-							return;
-						}
-						break;
-				}
-        dispose();
-    }
-
-		public String getMappedPort()	{
-			return mappedPort;
-		}
-
-		public String getMappedMemory()	{
-			return mappedMemory;
-		}
-
-		public String getStartAddress()	{
-			return baseAddress;
-		}
-
-    public void cancelDialog() {
-        dispose();
-    }
-    
-    public boolean isRegularClose() {
-        return regularClose;
-    }
-	
-	public String getReferenceCommunicationName() {
-		if (emptyPortsList) {
-			return null;
-		}
-		String tmp = (String)( mappedPortCB.getSelectedItem() );
-		int index = tmp.indexOf("::");
-		if (index == -1) {
-			return tmp;
-		}
-        return tmp.substring(0, index);
-    }
-    
-    public String getCommunicationName() {
-        String tmp = (String)( mappedPortCB.getSelectedItem() );
-		int index = tmp.indexOf("::");
-		if (index == -1) {
-			return tmp;
-		}
-        tmp = tmp.substring(index+2, tmp.length());
-		
-		index =  tmp.indexOf("(");
-		if (index > -1) {
-			tmp = tmp.substring(0, index).trim();
-		}
-		return tmp;
-    }
-	
-	 public String getTypeName() {
-		String tmp = (String)( mappedPortCB.getSelectedItem() );
-		int index1 = tmp.indexOf("(");
-		int index2 = tmp.indexOf(")");
-		if ((index1 > -1) && (index2 > index1)) {
-			return tmp.substring(index1+1, index2);
-		}
-		return "";
-	 }
-	
-	public int indexOf(Vector<String> _list, String name) {
-		int i = 0;
-		for(String s : _list) {
-			if (s.equals(name)) {
-				return i;
-			}
-			i++;
-		}
-		return 0;
-	}
-	
-	public ArrayList<String> getBufferParameters()	{
-
-		ArrayList<String> params = new ArrayList<String>();
-		params.add( String.valueOf( bufferType ) );
-		switch( bufferType )	{
-			case Buffer.FEP_BUFFER:
-				params = FepBuffer.getBufferParameters();
-				break;
-			case Buffer.INTERLEAVER_BUFFER:	
-				params = InterleaverBuffer.getBufferParameters();
-				break;
-			case Buffer.ADAIF_BUFFER:
-				params = AdaifBuffer.getBufferParameters();
-				break;
-			case Buffer.MAPPER_BUFFER:	
-				params = MapperBuffer.getBufferParameters();
-				break;
-			case Buffer.MAIN_MEMORY_BUFFER:	
-				params = MMBuffer.getBufferParameters();
-				break;
-			default:	//the main memory buffer
-				params = FepBuffer.getBufferParameters();
-				break;
-		}
-		return params;
-	}
-//
-//	private void cleanPanels()	{
-//		panel3.removeAll();
-//		panel4.removeAll();
-//		panel5.removeAll();
-//		tabbedPane.removeAll();
-//	}
-//
-//	private void revalidateAndRepaintPanels()	{
-//		panel3.revalidate();
-//		panel3.repaint();
-//		panel4.revalidate();
-//		panel4.repaint();
-//		panel5.revalidate();
-//		panel5.repaint();
-//	}
-
-}	//End of class
+/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille,
+ * Nokia Bell Labs France, Andrea ENRICI
+ *
+ * ludovic.apvrille AT enst.fr
+ * andrea.enrici AT nokia.com
+ *
+ * This software is a computer program whose purpose is to allow the
+ * edition of TURTLE analysis, design and deployment diagrams, to
+ * allow the generation of RT-LOTOS or Java code from this diagram,
+ * and at last to allow the analysis of formal validation traces
+ * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP
+ * from INRIA Rhone-Alpes.
+ *
+ * This software is governed by the CeCILL  license under French law and
+ * abiding by the rules of distribution of free software.  You can  use,
+ * modify and/ or redistribute the software under the terms of the CeCILL
+ * license as circulated by CEA, CNRS and INRIA at the following URL
+ * "http://www.cecill.info".
+ *
+ * As a counterpart to the access to the source code and  rights to copy,
+ * modify and redistribute granted by the license, users are provided only
+ * with a limited warranty  and the software's author,  the holder of the
+ * economic rights,  and the successive licensors  have only  limited
+ * liability.
+ *
+ * In this respect, the user's attention is drawn to the risks associated
+ * with loading,  using,  modifying and/or developing or reproducing the
+ * software by the user in light of its specific status of free software,
+ * that may mean  that it is complicated to manipulate,  and  that  also
+ * therefore means  that it is reserved for developers  and  experienced
+ * professionals having in-depth computer knowledge. Users are therefore
+ * encouraged to load and test the software's suitability as regards their
+ * requirements in conditions enabling the security of their systems and/or
+ * data to be ensured and,  more generally, to use and operate it in the
+ * same conditions as regards security.
+ *
+ * The fact that you are presently reading this means that you have had
+ * knowledge of the CeCILL license and that you accept its terms.
+ *
+ * /**
+ * Class JDialogTMLTaskArtifact
+ * Dialog for managing artifact to map ports onto CPs
+ * Creation: 19/09/2007
+ * @version 1.0 19/09/2007
+ * @author Ludovic APVRILLE, Andrea ENRICI
+ * @see
+ */
+
+package ui.window;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import java.util.*;
+import java.util.List;
+
+import ui.*;
+import ui.tmldd.*;
+import tmltranslator.modelcompiler.*;
+
+import myutil.*;
+
+
+public class JDialogPortArtifact extends javax.swing.JDialog implements ActionListener  {
+    
+	private boolean regularClose;
+	private boolean emptyPortsList = false;
+    
+    private JPanel panel2;
+    private Frame frame;
+    private TMLArchiPortArtifact artifact;
+    private String mappedMemory = "VOID"; 
+
+	protected JComboBox mappedPortCB, memoryCB;
+	protected JTextField baseAddressTF, numSamplesTF, bitsPerSymbolTF;
+	protected String baseAddress, mappedPort, sampleLength, numSamples, bitsPerSymbol;
+	protected String bank, dataType, symmetricalValue;
+	protected JComboBox dataTypeCB, bankCB, symmetricalValueCB;
+
+	//Intl Data In
+	protected JTextField widthIntl_TF, bitInOffsetIntl_TF, inputOffsetIntl_TF;
+	protected String widthIntl, bitInOffsetIntl, inputOffsetIntl, packedBinaryInIntl;
+	protected JComboBox packedBinaryInIntl_CB;
+
+	//Intl Data Out
+	protected JTextField bitOutOffsetIntl_TF, outputOffsetIntl_TF;
+	protected JComboBox packedBinaryOutIntl_CB;
+	protected String packedBinaryOutIntl, bitOutOffsetIntl, outputOffsetIntl;
+
+	//Intl Perm
+	protected JTextField lengthPermIntl_TF, offsetPermIntl_TF;
+	protected String lengthPermIntl, offsetPermIntl;
+
+	//Mapper Data In
+	protected JTextField baseAddressDataInMapp_TF, numSamplesDataInMapp_TF, bitsPerSymbolDataInMapp_TF;
+	protected String baseAddressDataInMapp, numSamplesDataInMapp, bitsPerSymbolDataInMapp, symmetricalValueDataInMapp;
+	protected JComboBox symmetricalValueDataInMapp_CB;
+	//Mapper Data Out
+	protected JTextField baseAddressDataOutMapp_TF;
+	protected String baseAddressDataOutMapp;
+	//Mapper LUT
+	protected JTextField baseAddressLUTMapp_TF;
+	protected String baseAddressLUTMapp;
+	
+    // Main Panel
+    private JButton closeButton;
+    private JButton cancelButton;
+
+	//Code generation
+	private JPanel panel3, panel4, panel5;
+	private JTabbedPane tabbedPane;
+	private String HALUnitName = "";
+	private Vector<String> portsList;
+	private String appName = "";
+    
+    /** Creates new form  */
+    public JDialogPortArtifact(Frame _frame, String _title, TMLArchiPortArtifact _artifact, String _mappedMemory, Vector<String> _portsList, String _mappedPort ) {
+        super(_frame, _title, true);
+        frame = _frame;
+		artifact = _artifact;
+		mappedMemory = _mappedMemory;
+		portsList = _portsList;
+		mappedPort = _mappedPort;
+		appName = mappedPort.split("::")[0];
+		initComponents();
+		pack();
+    }
+    
+    private void initComponents() {
+
+        Container c = getContentPane();
+        GridBagLayout gridbag0 = new GridBagLayout();
+        GridBagLayout gridbag1 = new GridBagLayout();
+        GridBagLayout gridbag2 = new GridBagLayout();
+        GridBagConstraints c0 = new GridBagConstraints();
+        GridBagConstraints c1 = new GridBagConstraints();
+        GridBagConstraints c2 = new GridBagConstraints();
+        
+        setFont(new Font("Helvetica", Font.PLAIN, 14));
+        c.setLayout(gridbag0);
+        
+        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        
+        panel2 = new JPanel();
+        panel2.setLayout(gridbag2);
+        panel2.setBorder(new javax.swing.border.TitledBorder("Artifact attributes"));
+        panel2.setPreferredSize(new Dimension(650, 350));
+
+        panel3 = new JPanel();
+        panel3.setLayout(gridbag2);
+        panel3.setBorder(new javax.swing.border.TitledBorder("Code generation: memory configuration"));
+        panel3.setPreferredSize(new Dimension(650, 350));
+
+        tabbedPane = new JTabbedPane();
+        panel4 = new JPanel();
+        panel5 = new JPanel();
+        
+		c1.gridwidth = 1;
+        c1.gridheight = 1;
+        c1.weighty = 1.0;
+        c1.weightx = 1.0;
+        c1.fill = GridBagConstraints.HORIZONTAL;
+        c1.gridwidth = GridBagConstraints.REMAINDER; //end row
+        int mappedPortIndex;
+        if( portsList.size() == 0 ) {
+            portsList.add( "No available port" );
+            mappedPortIndex = 0;
+        }
+        else    {
+            mappedPortIndex = portsList.indexOf( mappedPort );
+        }
+		
+        mappedPortCB = new JComboBox( portsList );
+        mappedPortCB.setSelectedIndex( mappedPortIndex );
+        panel2.add( new JLabel( "Port:" ), c2 );
+		mappedPortCB.addActionListener(this);
+		panel2.add( mappedPortCB, c1 );
+		
+		//Make the list of memories that are available for being mapped
+		List componentList = artifact.getTDiagramPanel().getComponentList();
+		Vector<String> memoryList = new Vector<String>();
+		for( int k = 0; k < componentList.size(); k++ )	{
+			if( componentList.get(k) instanceof TMLArchiMemoryNode )	{
+				memoryList.add( ( (TMLArchiMemoryNode) componentList.get(k) ).getName() );
+			}
+		}
+        if( memoryList.size() == 0 )    { // In case there are no memories in the design
+            memoryList.add( "No available memory" );              
+        }
+
+		memoryCB = new JComboBox( memoryList );
+		if( !mappedMemory.equals( "VOID" ) && !mappedMemory.equals( "" ) )	{
+			memoryCB.setSelectedIndex( memoryList.indexOf( mappedMemory ) );
+		}
+		else	{
+			memoryCB.setSelectedIndex( 0 );
+		}
+		panel2.add( new JLabel( "Memory: "),  c2 );
+		memoryCB.addActionListener(this);
+		panel2.add( memoryCB, c1 );
+
+		// main panel;
+		c0.gridheight = 10;
+		c0.weighty = 1.0;
+		c0.weightx = 1.0;
+		c0.gridwidth = GridBagConstraints.REMAINDER; //end row
+		c0.fill = GridBagConstraints.BOTH;
+		c.add( panel2, c0 );
+
+		c0.gridwidth = 1;
+		c0.gridheight = 1;
+		c0.fill = GridBagConstraints.HORIZONTAL;
+		closeButton = new JButton("Save and Close", IconManager.imgic25);
+		//closeButton.setPreferredSize(new Dimension(600, 50));
+		closeButton.addActionListener(this);
+		c.add(closeButton, c0);
+		c0.gridwidth = GridBagConstraints.REMAINDER; //end row
+		cancelButton = new JButton("Cancel", IconManager.imgic27);
+		cancelButton.addActionListener(this);
+		c.add(cancelButton, c0);
+  }
+
+	private String getBufferTypeFromSelectedMemory( String mappedMemory )	{
+		
+		List componentList = artifact.getTDiagramPanel().getComponentList();
+		Vector<String> list = new Vector<String>();
+		
+		for( int k = 0; k < componentList.size(); k++ )	{
+			if( componentList.get(k) instanceof TMLArchiMemoryNode )	{
+				TMLArchiMemoryNode memoryNode = (TMLArchiMemoryNode)componentList.get(k);
+				if( memoryNode.getName().equals( mappedMemory ) )	{
+					return memoryNode.getName();
+				}
+			}
+		}
+		return "NO MEC";	//default: the main memory buffer
+	}
+    
+  public void actionPerformed(ActionEvent evt)  {
+
+      /*if( evt.getSource() == memoryCB )	{
+          updateBufferPanel();
+      }*/
+      String command = evt.getActionCommand();
+      // Compare the action command to the known actions.
+      if (command.equals("Save and Close"))  {
+          closeDialog();
+      } else if (command.equals("Cancel")) {
+          cancelDialog();
+      }
+	}
+
+	private void updateBufferPanel()	{
+
+		GridBagConstraints c1 = new GridBagConstraints();
+		GridBagConstraints c2 = new GridBagConstraints();
+
+		c1.gridwidth = 1;
+		c1.gridheight = 1;
+		c1.weighty = 1.0;
+		c1.weightx = 1.0;
+		c1.fill = GridBagConstraints.HORIZONTAL;
+    c1.gridwidth = GridBagConstraints.REMAINDER; //end row
+		
+		//flushBuffersStrings();
+		HALUnitName = getBufferTypeFromSelectedMemory( (String)memoryCB.getItemAt( memoryCB.getSelectedIndex() ) );
+		ArrayList<JPanel> panelsList;
+
+		switch( HALUnitName )	{
+			case "FEP_BUFFER":
+				tabbedPane.removeAll();
+				panelsList = FepBuffer.makePanel( c1, c2 );
+				panel3 = panelsList.get(0);
+				tabbedPane.addTab( "Data", panel3 );
+				break;
+			case "MAPPER_BUFFER":
+				tabbedPane.removeAll();
+				panelsList = MapperBuffer.makePanel( c1, c2 );
+				tabbedPane.addTab( "Data In", panelsList.get(0) );
+				tabbedPane.addTab( "Data Out", panelsList.get(1) );
+				tabbedPane.addTab( "Look Up Table", panelsList.get(2) );
+				tabbedPane.setSelectedIndex(0);
+				break;
+			case "ADAIF_BUFFER":
+				tabbedPane.removeAll();
+				panelsList = AdaifBuffer.makePanel( c1, c2 );
+				panel3 = panelsList.get(0);
+				tabbedPane.addTab( "Data", panel3 );
+				break;
+			case "INTERLEAVER_BUFFER":
+				tabbedPane.removeAll();
+				panelsList = InterleaverBuffer.makePanel( c1, c2 );
+				tabbedPane.addTab( "Data In", panelsList.get(0) );
+				tabbedPane.addTab( "Data Out", panelsList.get(1) );
+				tabbedPane.addTab( "Permutation Table", panelsList.get(2) );
+				tabbedPane.setSelectedIndex(0);
+				break;
+			case "MAIN_MEMORY_BUFFER":
+				tabbedPane.removeAll();
+				panelsList = MMBuffer.makePanel( c1, c2 );
+				panel3 = panelsList.get(0);
+				tabbedPane.addTab( "Data", panel3 );
+				break;
+			default:	//the main memory buffer 
+				tabbedPane.removeAll();
+				panelsList = FepBuffer.makePanel( c1, c2 );
+				panel3 = panelsList.get(0);
+				tabbedPane.addTab( "Data", panel3 );
+				break;
+		}
+	}
+
+    public void closeDialog() {
+
+        regularClose = true;
+        mappedMemory = (String) memoryCB.getItemAt( memoryCB.getSelectedIndex() );
+        HALUnitName = getBufferTypeFromSelectedMemory( (String)memoryCB.getItemAt( memoryCB.getSelectedIndex() ) );
+        switch ( HALUnitName )	{
+					case "FEP_BUFFER":
+						if( !FepBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+					case "MAPPER_BUFFER":
+						if( !MapperBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+					case "ADAIF_BUFFER":
+						if( !AdaifBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+					case "INTERLEAVER_BUFFER":
+						if( !InterleaverBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+					case "MAIN_MEMORY_BUFFER":
+						if( !MMBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+					default:	//the main memory buffer 
+						if( !FepBuffer.closePanel( frame ) )	{
+							return;
+						}
+						break;
+				}
+        dispose();
+    }
+
+		public String getMappedPort()	{
+			return mappedPort;
+		}
+
+		public String getMappedMemory()	{
+			return mappedMemory;
+		}
+
+		public String getStartAddress()	{
+			return baseAddress;
+		}
+
+    public void cancelDialog() {
+        dispose();
+    }
+    
+    public boolean isRegularClose() {
+        return regularClose;
+    }
+	
+	public String getReferenceCommunicationName() {
+		if (emptyPortsList) {
+			return null;
+		}
+		String tmp = (String)( mappedPortCB.getSelectedItem() );
+        if( tmp.length() > 0 )    {
+    		int index = tmp.indexOf("::");
+	    	if (index == -1) {
+		    	return tmp;
+		    }
+            return tmp.substring(0, index);
+        }
+        else    {
+            return "ERROR EMPTY PORT NAME";
+        }
+    }
+    
+    public String getCommunicationName() {
+        String tmp = (String)( mappedPortCB.getSelectedItem() );
+		int index = tmp.indexOf("::");
+		if (index == -1) {
+			return tmp;
+		}
+        tmp = tmp.substring(index+2, tmp.length());
+		
+		index =  tmp.indexOf("(");
+		if (index > -1) {
+			tmp = tmp.substring(0, index).trim();
+		}
+		return tmp;
+    }
+	
+	 public String getTypeName() {
+		String tmp = (String)( mappedPortCB.getSelectedItem() );
+		int index1 = tmp.indexOf("(");
+		int index2 = tmp.indexOf(")");
+		if ((index1 > -1) && (index2 > index1)) {
+			return tmp.substring(index1+1, index2);
+		}
+		return "";
+	 }
+	
+	public int indexOf(Vector<String> _list, String name) {
+		int i = 0;
+		for(String s : _list) {
+			if (s.equals(name)) {
+				return i;
+			}
+			i++;
+		}
+		return 0;
+	}
+	
+	public ArrayList<String> getBufferParameters()	{
+
+		ArrayList<String> params = new ArrayList<String>();
+		params.add( String.valueOf( HALUnitName ) );
+		switch( HALUnitName )	{
+			case "FEP_BUFFER":
+				params = FepBuffer.getBufferParameters();
+				break;
+            case "INTERLEAVER_BUFFER":
+				params = InterleaverBuffer.getBufferParameters();
+				break;
+			case "ADAIF_BUFFER":
+				params = AdaifBuffer.getBufferParameters();
+				break;
+            case "MAPPER_BUFFER":
+				params = MapperBuffer.getBufferParameters();
+				break;
+			case "MAIN_MEMORY_BUFFER":
+				params = MMBuffer.getBufferParameters();
+				break;
+			default:	//the main memory buffer
+				params = FepBuffer.getBufferParameters();
+				break;
+		}
+		return params;
+	}
+
+	private void cleanPanels()	{
+		panel3.removeAll();
+		panel4.removeAll();
+		panel5.removeAll();
+		tabbedPane.removeAll();
+	}
+
+	private void revalidateAndRepaintPanels()	{
+		panel3.revalidate();
+		panel3.repaint();
+		panel4.revalidate();
+		panel4.repaint();
+		panel5.revalidate();
+		panel5.repaint();
+	}
+
+}	//End of class