diff --git a/modeling/DIPLODOCUS/SmartCardProtocol.xml b/modeling/DIPLODOCUS/SmartCardProtocol.xml index 4c5a0bfdb34749c0a16bf696b83cd3aae35c9b1f..3be8f0461d15b221b56a44e49f20e47c7c5b18b7 100755 --- a/modeling/DIPLODOCUS/SmartCardProtocol.xml +++ b/modeling/DIPLODOCUS/SmartCardProtocol.xml @@ -305,10 +305,10 @@ <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="278" minY="-13" maxY="264" /> -<infoparam name="TGComponent" value="Event data_Ready_SC" /> +<infoparam name="TGComponent" value="Event data_Ready_SC2" /> <TGConnectingPoint num="0" id="41" /> <extraparam> -<Prop commName="data_Ready_SC" commType="1" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="data_Ready_SC" commType="1" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -325,7 +325,7 @@ <infoparam name="TGComponent" value="Channel fromDtoSC" /> <TGConnectingPoint num="0" id="43" /> <extraparam> -<Prop commName="fromDtoSC" commType="0" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="null" associatedEvent="" checkConf="true" checkConfStatus="1" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="fromDtoSC" commType="0" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="true" checkConfStatus="1" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -342,7 +342,7 @@ <infoparam name="TGComponent" value="Channel fromSCtoD" /> <TGConnectingPoint num="0" id="45" /> <extraparam> -<Prop commName="fromSCtoD" commType="0" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="fromSCtoD" commType="0" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -359,7 +359,7 @@ <infoparam name="TGComponent" value="Event answerToReset, pTSConfirm" /> <TGConnectingPoint num="0" id="47" /> <extraparam> -<Prop commName="answerToReset, pTSConfirm" commType="1" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="answerToReset, pTSConfirm" commType="1" origin="false" finite="false" blocking="true" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -555,10 +555,10 @@ <sizeparam width="26" height="26" minWidth="1" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-13" maxX="188" minY="-13" maxY="225" /> -<infoparam name="TGComponent" value="Event data_Ready_SC" /> +<infoparam name="TGComponent" value="Event data_Ready_SC2" /> <TGConnectingPoint num="0" id="74" /> <extraparam> -<Prop commName="data_Ready_SC" commType="1" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="data_Ready_SC" commType="1" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -592,7 +592,7 @@ <infoparam name="TGComponent" value="Channel fromSCtoD" /> <TGConnectingPoint num="0" id="78" /> <extraparam> -<Prop commName="fromSCtoD" commType="0" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="fromSCtoD" commType="0" origin="true" finite="false" blocking="false" maxSamples="8" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -609,7 +609,7 @@ <infoparam name="TGComponent" value="Event answerToReset, pTSConfirm" /> <TGConnectingPoint num="0" id="80" /> <extraparam> -<Prop commName="answerToReset, pTSConfirm" commType="1" origin="true" finite="true" blocking="false" maxSamples="1" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="VOID" associatedEvent="VOID" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="0" checkStrongAuthStatus="0" /> +<Prop commName="answerToReset, pTSConfirm" commType="1" origin="true" finite="true" blocking="false" maxSamples="1" widthSamples="4" isLossy="false" isPrex="false" isPostex="false" lossPercentage="0" maxNbOfLoss="-1" dataFlowType="int16_t" associatedEvent="" checkConf="false" checkConfStatus="0" checkAuth="false" checkWeakAuthStatus="1" checkStrongAuthStatus="1" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> <Type type="0" typeOther="" /> @@ -1231,7 +1231,7 @@ <SUBCOMPONENT type="-1" id="228" > <father id="235" num="0" /> <cdparam x="528" y="386" /> -<sizeparam width="12" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="14" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-75" maxX="-20" minY="10" maxY="35" /> <infoparam name="guard 1" value="[ ]" /> @@ -1239,7 +1239,7 @@ <SUBCOMPONENT type="-1" id="229" > <father id="235" num="1" /> <cdparam x="588" y="386" /> -<sizeparam width="12" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="14" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="35" maxX="55" minY="10" maxY="35" /> <infoparam name="guard 2" value="[ ]" /> @@ -1247,7 +1247,7 @@ <SUBCOMPONENT type="-1" id="230" > <father id="235" num="2" /> <cdparam x="573" y="421" /> -<sizeparam width="12" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="14" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="20" maxX="40" minY="45" maxY="70" /> <infoparam name="guard 3" value="[ ]" /> @@ -1267,7 +1267,7 @@ <SUBCOMPONENT type="-1" id="236" > <father id="243" num="0" /> <cdparam x="599" y="527" /> -<sizeparam width="51" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="52" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-75" maxX="-20" minY="10" maxY="35" /> <infoparam name="guard 1" value="[ x==0 ]" /> @@ -1275,7 +1275,7 @@ <SUBCOMPONENT type="-1" id="237" > <father id="243" num="1" /> <cdparam x="679" y="527" /> -<sizeparam width="12" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="14" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="35" maxX="55" minY="10" maxY="35" /> <infoparam name="guard 2" value="[ ]" /> @@ -1283,7 +1283,7 @@ <SUBCOMPONENT type="-1" id="238" > <father id="243" num="2" /> <cdparam x="664" y="562" /> -<sizeparam width="41" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="42" height="15" minWidth="10" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="20" maxX="40" minY="45" maxY="70" /> <infoparam name="guard 3" value="[ x>0 ]" /> @@ -1299,8 +1299,8 @@ </COMPONENT> <COMPONENT type="1007" id="248" > -<cdparam x="192" y="137" /> -<sizeparam width="72" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="188" y="137" /> +<sizeparam width="81" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send request" value="activation()" /> @@ -1312,8 +1312,8 @@ </COMPONENT> <COMPONENT type="1008" id="251" > -<cdparam x="205" y="237" /> -<sizeparam width="47" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="202" y="237" /> +<sizeparam width="53" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="reset()" /> @@ -1326,8 +1326,8 @@ </COMPONENT> <COMPONENT type="1010" id="254" > -<cdparam x="172" y="288" /> -<sizeparam width="110" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="167" y="288" /> +<sizeparam width="120" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="answerToReset() " /> @@ -1339,8 +1339,8 @@ </COMPONENT> <COMPONENT type="1008" id="257" > -<cdparam x="208" y="337" /> -<sizeparam width="40" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="207" y="337" /> +<sizeparam width="43" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="pTS()" /> @@ -1352,8 +1352,8 @@ </COMPONENT> <COMPONENT type="1010" id="260" > -<cdparam x="359" y="165" /> -<sizeparam width="89" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="356" y="165" /> +<sizeparam width="94" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="pTSConfirm() " /> @@ -1368,7 +1368,7 @@ <COMPONENT type="301" id="277" > <cdparam x="367" y="222" /> -<sizeparam width="105" height="15" minWidth="50" minHeight="20" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="114" height="15" minWidth="50" minHeight="20" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="UML Note" value="data exchange @@ -1395,8 +1395,8 @@ </COMPONENT> <COMPONENT type="1006" id="280" > -<cdparam x="433" y="448" /> -<sizeparam width="87" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="429" y="448" /> +<sizeparam width="94" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="write channel" value="fromDtoSC(1)" /> @@ -1408,8 +1408,8 @@ </COMPONENT> <COMPONENT type="1008" id="283" > -<cdparam x="422" y="507" /> -<sizeparam width="109" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="419" y="507" /> +<sizeparam width="115" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="data_Ready(x, b)" /> @@ -1433,8 +1433,8 @@ </COMPONENT> <COMPONENT type="1017" id="288" > -<cdparam x="593" y="447" /> -<sizeparam width="133" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="588" y="447" /> +<sizeparam width="142" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="notified event" value="x=?data_Ready_SC()" /> @@ -1455,8 +1455,8 @@ </COMPONENT> <COMPONENT type="1009" id="293" > -<cdparam x="614" y="700" /> -<sizeparam width="91" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="610" y="700" /> +<sizeparam width="98" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="read channel" value="fromSCtoD(1) " /> @@ -1468,8 +1468,8 @@ </COMPONENT> <COMPONENT type="1010" id="296" > -<cdparam x="604" y="619" /> -<sizeparam width="110" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="600" y="619" /> +<sizeparam width="119" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="data_Ready_SC() " /> @@ -1491,8 +1491,8 @@ </COMPONENT> <COMPONENT type="1014" id="302" > -<cdparam x="307" y="287" /> -<sizeparam width="254" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="300" y="287" /> +<sizeparam width="268" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="for loop" value="for(i=0;i<nbOfComputedPackets;i = i +1)" /> @@ -1525,7 +1525,7 @@ <cdparam x="561" y="301" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> -<P1 x="561" y="301" id="300" /> +<P1 x="568" y="301" id="300" /> <P2 x="568" y="366" id="231" /> <AutomaticDrawing data="true" /> </CONNECTOR> @@ -5682,8 +5682,8 @@ On prend b=1 comme exemple </COMPONENT> <COMPONENT type="1010" id="1282" > -<cdparam x="141" y="129" /> -<sizeparam width="51" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="138" y="129" /> +<sizeparam width="57" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="reset() " /> @@ -5695,8 +5695,8 @@ On prend b=1 comme exemple </COMPONENT> <COMPONENT type="1008" id="1285" > -<cdparam x="113" y="182" /> -<sizeparam width="106" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="108" y="182" /> +<sizeparam width="116" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="answerToReset()" /> @@ -5708,8 +5708,8 @@ On prend b=1 comme exemple </COMPONENT> <COMPONENT type="1010" id="1288" > -<cdparam x="144" y="237" /> -<sizeparam width="44" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="143" y="237" /> +<sizeparam width="47" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="pTS() " /> @@ -5721,8 +5721,8 @@ On prend b=1 comme exemple </COMPONENT> <COMPONENT type="1008" id="1291" > -<cdparam x="124" y="308" /> -<sizeparam width="85" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="121" y="308" /> +<sizeparam width="90" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="pTSConfirm()" /> @@ -5735,7 +5735,7 @@ On prend b=1 comme exemple <COMPONENT type="301" id="1308" > <cdparam x="376" y="98" /> -<sizeparam width="233" height="39" minWidth="50" minHeight="20" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="249" height="39" minWidth="50" minHeight="20" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="UML Note" value="The first two layers of the OSI model @@ -5766,8 +5766,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1007" id="1311" > -<cdparam x="254" y="97" /> -<sizeparam width="89" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="250" y="97" /> +<sizeparam width="96" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send request" value="start_TCP_IP()" /> @@ -5779,8 +5779,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1007" id="1314" > -<cdparam x="241" y="148" /> -<sizeparam width="114" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="236" y="148" /> +<sizeparam width="125" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send request" value="start_Application()" /> @@ -5801,8 +5801,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1008" id="1319" > -<cdparam x="309" y="350" /> -<sizeparam width="106" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="305" y="350" /> +<sizeparam width="115" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="data_Ready_SC()" /> @@ -5823,8 +5823,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1009" id="1324" > -<cdparam x="321" y="308" /> -<sizeparam width="83" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="318" y="308" /> +<sizeparam width="88" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="read channel" value="fromTtoP(1) " /> @@ -5836,8 +5836,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1010" id="1327" > -<cdparam x="337" y="264" /> -<sizeparam width="50" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="335" y="264" /> +<sizeparam width="55" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="send() " /> @@ -5849,8 +5849,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1006" id="1330" > -<cdparam x="319" y="392" /> -<sizeparam width="87" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="315" y="392" /> +<sizeparam width="94" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="write channel" value="fromSCtoD(1)" /> @@ -5862,8 +5862,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1008" id="1333" > -<cdparam x="496" y="350" /> -<sizeparam width="59" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="493" y="350" /> +<sizeparam width="65" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="send event" value="receive()" /> @@ -5875,8 +5875,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1009" id="1336" > -<cdparam x="480" y="311" /> -<sizeparam width="91" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="476" y="311" /> +<sizeparam width="98" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="read channel" value="fromDtoSC(1) " /> @@ -5888,8 +5888,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1006" id="1339" > -<cdparam x="486" y="387" /> -<sizeparam width="79" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="483" y="387" /> +<sizeparam width="84" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="write channel" value="fromPtoT(1)" /> @@ -5901,8 +5901,8 @@ the smart card and the terminal </COMPONENT> <COMPONENT type="1010" id="1342" > -<cdparam x="470" y="268" /> -<sizeparam width="110" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="466" y="268" /> +<sizeparam width="118" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="wait event" value="data_Ready(t, b) " /> @@ -5918,7 +5918,7 @@ the smart card and the terminal <COMPONENT type="1014" id="1346" > <cdparam x="236" y="202" /> -<sizeparam width="125" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="124" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="for loop" value="for(j=0;x==0;j = j)" /> @@ -6125,7 +6125,7 @@ the smart card and the terminal <cdparam x="391" y="282" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="600" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from for loop to select" value="null" /> -<P1 x="361" y="216" id="1344" /> +<P1 x="360" y="216" id="1344" /> <P2 x="439" y="216" id="1349" /> <AutomaticDrawing data="true" /> </CONNECTOR> diff --git a/src/main/java/ui/tmlad/TMLADNotifiedEvent.java b/src/main/java/ui/tmlad/TMLADNotifiedEvent.java index 9864ba10f53bd32dfe1a351b1c0728c2c376343e..167d225a8476774228640de2a0c14025bd5d3abe 100755 --- a/src/main/java/ui/tmlad/TMLADNotifiedEvent.java +++ b/src/main/java/ui/tmlad/TMLADNotifiedEvent.java @@ -166,6 +166,11 @@ public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements E public String getEventName() { return eventName; } + + public void setEventName(String _name) { + eventName = _name; + makeValue(); + } public String getVariable() { return result; diff --git a/src/main/java/ui/tmlad/TMLADSendEvent.java b/src/main/java/ui/tmlad/TMLADSendEvent.java index 649206e58214eef05f241e4cc6dfae1894e7bb91..5c0a73288c73da13861c4fa0b846951924b17506 100755 --- a/src/main/java/ui/tmlad/TMLADSendEvent.java +++ b/src/main/java/ui/tmlad/TMLADSendEvent.java @@ -229,6 +229,12 @@ public class TMLADSendEvent extends TGCWithoutInternalComponent implements Check return eventName; } + public void setEventName(String _name) { + eventName = _name; + makeValue(); + } + + public String getParamValue(int i) { return params[i]; } diff --git a/src/main/java/ui/tmlad/TMLADSendRequest.java b/src/main/java/ui/tmlad/TMLADSendRequest.java index cc2d397637b446fe54a95e837261236f7d558cab..8a24e4d696e74b46d7605ade6427ce3839aef431 100755 --- a/src/main/java/ui/tmlad/TMLADSendRequest.java +++ b/src/main/java/ui/tmlad/TMLADSendRequest.java @@ -220,7 +220,7 @@ public class TMLADSendRequest extends TGCWithoutInternalComponent implements Che public void setRequestName(String name){ - requestName=name; + requestName = name; makeValue(); } @@ -229,8 +229,8 @@ public class TMLADSendRequest extends TGCWithoutInternalComponent implements Che } public void setParam(int i, String s){ - params[i]=s; - nParam=Math.max(i,nParam); + params[i] = s; + nParam = Math.max(i,nParam); } public int nbOfParams() { return nParam; diff --git a/src/main/java/ui/tmlad/TMLADWaitEvent.java b/src/main/java/ui/tmlad/TMLADWaitEvent.java index 73dd7daf09b214668ff02f90d6a7c3eb8d134adf..d04c3928adf037ea305e1843cb20d1a63122ea76 100755 --- a/src/main/java/ui/tmlad/TMLADWaitEvent.java +++ b/src/main/java/ui/tmlad/TMLADWaitEvent.java @@ -220,6 +220,11 @@ public class TMLADWaitEvent extends TGCWithoutInternalComponent implements Check return eventName; } + public void setEventName(String _name) { + eventName = _name; + makeValue(); + } + public String getParamValue(int i) { return params[i]; } diff --git a/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java b/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java index ffc66bcc07c445fdb91aa3eeed555f9c4fe35389..6eea0270f57dd5ee416be066a36ca1fbd3ea0024 100755 --- a/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java +++ b/src/main/java/ui/tmlcompd/TMLCPrimitivePort.java @@ -52,6 +52,10 @@ import ui.window.JDialogTMLCompositePort; import ui.avatarrd.AvatarRDRequirement; import ui.tmlad.TMLADReadChannel; import ui.tmlad.TMLADWriteChannel; +import ui.tmlad.TMLADSendEvent; +import ui.tmlad.TMLADSendRequest; +import ui.tmlad.TMLADWaitEvent; +import ui.tmlad.TMLADNotifiedEvent; import ui.tmldd.TMLArchiCPNode; import ui.tmldd.TMLArchiPortArtifact; @@ -566,6 +570,7 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent associatedEvent = jda.getAssociatedEvent(); isPrex = jda.isChannelPrex(); isPostex = jda.isChannelPostex(); + TraceManager.addDev( "The Data flow type is: " + dataFlowType ); TraceManager.addDev( "The Associated event is: " + associatedEvent ); @@ -591,19 +596,19 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent checkConf = jda.checkConf; reference = jda.getReference(); if (checkConf){ - if (checkConfStatus==NOCHECK){ - checkConfStatus=TOCHECK; + if (checkConfStatus == NOCHECK){ + checkConfStatus = TOCHECK; } } else { - if (checkConfStatus!=NOCHECK){ - checkConfStatus=NOCHECK; + if (checkConfStatus != NOCHECK){ + checkConfStatus = NOCHECK; } } - checkAuth=jda.checkAuth; - if (checkStrongAuthStatus<2){ - checkStrongAuthStatus=1; - checkWeakAuthStatus=1; + checkAuth = jda.checkAuth; + if (checkStrongAuthStatus < 2){ + checkStrongAuthStatus = 1; + checkWeakAuthStatus = 1; } for(int i=0; i<nbMaxAttribute; i++) { //TraceManager.addDev("Getting string type: " + jda.getStringType(i)); @@ -983,9 +988,36 @@ public abstract class TMLCPrimitivePort extends TGCScalableWithInternalComponent } if (t2 instanceof TMLADReadChannel) { - TMLADReadChannel twc = (TMLADReadChannel) t2; - if (twc.getChannelName().equals(commName)) - twc.setChannelName(s); + TMLADReadChannel trc = (TMLADReadChannel) t2; + if (trc.getChannelName().equals(commName)) + trc.setChannelName(s); + } + + + if (t2 instanceof TMLADSendEvent) { + + TMLADSendEvent tse = (TMLADSendEvent) t2; + TraceManager.addDev("Send event with event=" + tse.getEventName() + " vs " + commName); + if (tse.getEventName().equals(commName)) + tse.setEventName(s); + } + + if (t2 instanceof TMLADSendRequest) { + TMLADSendRequest tsr = (TMLADSendRequest) t2; + if (tsr.getRequestName().equals(commName)) + tsr.setRequestName(s); + } + + if (t2 instanceof TMLADWaitEvent) { + TMLADWaitEvent twe = (TMLADWaitEvent) t2; + if (twe.getEventName().equals(commName)) + twe.setEventName(s); + } + + if (t2 instanceof TMLADNotifiedEvent) { + TMLADNotifiedEvent tne = (TMLADNotifiedEvent) t2; + if (tne.getEventName().equals(commName)) + tne.setEventName(s); } } t.repaint(); diff --git a/src/main/java/ui/window/JDialogTMLCompositePort.java b/src/main/java/ui/window/JDialogTMLCompositePort.java index 7755b51f83e8f354a50e1022995948e2bb4cddf4..ffd54ac87a753409cb11cb86915177cc8a0d6f88 100755 --- a/src/main/java/ui/window/JDialogTMLCompositePort.java +++ b/src/main/java/ui/window/JDialogTMLCompositePort.java @@ -37,14 +37,11 @@ */ - - package ui.window; -import ui.util.IconManager; +import ui.TGComponent; import ui.TType; import ui.tmlcd.TMLDataFlowType; -import ui.TGComponent; import javax.swing.*; import java.awt.*; @@ -57,25 +54,26 @@ import java.util.Vector; * Class JDialogTMLCompositePort * Dialog for managing port properties * Creation: 26/03/2008 - * @version 1.0 26/03/2008 + * * @author Ludovic APVRILLE + * @version 1.0 26/03/2008 */ public class JDialogTMLCompositePort extends JDialogBase implements ActionListener { - private JPanel panel3; - private Frame frame; - + private JPanel panel3; + private Frame frame; + private String name; - private String dataFlowType = "VOID"; - private String associatedEvent = "VOID"; + private String dataFlowType = "VOID"; + private String associatedEvent = "VOID"; private TType type1, type2, type3, type4, type5; private boolean isFinite, isBlocking, isOrigin; private String maxInFIFO, widthSamples; - - private boolean isLossy, isPrex, isPostex; - private int lossPercentage; - private int maxNbOfLoss; //-1 means no max + + private boolean isLossy, isPrex, isPostex; + private int lossPercentage; + private int maxNbOfLoss; //-1 means no max public boolean data; public boolean checkConf; @@ -85,112 +83,120 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen private JComboBox<String> typePort, typeList1, typeList2, typeList3, typeList4, typeList5; private JComboBox<String> origin, finite, blocking, dfType; private JComboBox<TGComponent> refReq; - private JLabel lossPercentageLabel, maxNbOfLossLabel; - private int portIndex; + private JLabel lossPercentageLabel, maxNbOfLossLabel; + private int portIndex; private Vector<String> origins, finites, blockings, portTypes, types1, types2, types3, types4, types5; - private Vector<String> types; + private Vector<String> types; private Vector<TGComponent> refs; private TGComponent reference; - // Robustness - private JCheckBox isLossyBox, isPrexCB, isPostexCB, confCheckBox, authCheckBox; - private JTextField lossPercentageText, maxNbOfLossText; + // Robustness + private JCheckBox isLossyBox, isPrexCB, isPostexCB, confCheckBox, authCheckBox; + private JTextField lossPercentageText, maxNbOfLossText; - public JDialogTMLCompositePort(String _name, int _portIndex, TType _type1, TType _type2, TType _type3, TType _type4, TType _type5, boolean _isOrigin, boolean _isFinite, boolean _isBlocking, String _maxInFIFO, String _widthSamples, boolean _isLossy, int _lossPercentage, int _maxNbOfLoss, Frame f, String title, Vector<String> _types, String _dataFlowType, String _associatedEvent, boolean _isPrex, boolean _isPostex , boolean _checkConf, boolean _checkAuth, TGComponent _reference, Vector<TGComponent> _refs) { + public JDialogTMLCompositePort(String _name, int _portIndex, TType _type1, TType _type2, TType _type3, TType _type4, TType _type5, boolean _isOrigin, boolean _isFinite, boolean _isBlocking, String _maxInFIFO, String _widthSamples, boolean _isLossy, int _lossPercentage, int _maxNbOfLoss, Frame f, String title, Vector<String> _types, String _dataFlowType, String _associatedEvent, boolean _isPrex, boolean _isPostex, boolean _checkConf, boolean _checkAuth, TGComponent _reference, Vector<TGComponent> _refs) { super(f, title, true); frame = f; - + name = _name; - portIndex = _portIndex; - type1 = _type1; type2 = _type2; type3 = _type3; type4 = _type4; type5 = _type5; - - types = _types; - + portIndex = _portIndex; + type1 = _type1; + type2 = _type2; + type3 = _type3; + type4 = _type4; + type5 = _type5; + + types = _types; + data = false; - - dataFlowType = _dataFlowType; - associatedEvent = _associatedEvent; + + dataFlowType = _dataFlowType; + associatedEvent = _associatedEvent; maxInFIFO = _maxInFIFO; - widthSamples = _widthSamples; - isOrigin = _isOrigin; + widthSamples = _widthSamples; + isOrigin = _isOrigin; isFinite = _isFinite; isBlocking = _isBlocking; - - isPrex = _isPrex; - isPostex = _isPostex; - isLossy = _isLossy; - lossPercentage = _lossPercentage; - maxNbOfLoss = _maxNbOfLoss; - checkConf = _checkConf; - checkAuth = _checkAuth; - refs=_refs; - reference= _reference; + + isPrex = _isPrex; + isPostex = _isPostex; + isLossy = _isLossy; + lossPercentage = _lossPercentage; + maxNbOfLoss = _maxNbOfLoss; + checkConf = _checkConf; + checkAuth = _checkAuth; + refs = _refs; + reference = _reference; myInitComponents(); initComponents(); checkMode(); - + pack(); } - + private void myInitComponents() { - - portTypes = new Vector<>(); - portTypes.add("Channel"); - portTypes.add("Event"); - portTypes.add("Request"); - - types1 = new Vector<>(); types2 = new Vector<>(); types3 = new Vector<>(); types4 = new Vector<>(); types5 = new Vector<>(); + + portTypes = new Vector<>(); + portTypes.add("Channel"); + portTypes.add("Event"); + portTypes.add("Request"); + + types1 = new Vector<>(); + types2 = new Vector<>(); + types3 = new Vector<>(); + types4 = new Vector<>(); + types5 = new Vector<>(); types1.add(TType.getStringType(0)); types1.add(TType.getStringType(1)); types1.add(TType.getStringType(2)); - + types2.add(TType.getStringType(0)); types2.add(TType.getStringType(1)); types2.add(TType.getStringType(2)); - + types3.add(TType.getStringType(0)); types3.add(TType.getStringType(1)); types3.add(TType.getStringType(2)); - - types4.add(TType.getStringType(0)); + + types4.add(TType.getStringType(0)); types4.add(TType.getStringType(1)); types4.add(TType.getStringType(2)); - - types5.add(TType.getStringType(0)); + + types5.add(TType.getStringType(0)); types5.add(TType.getStringType(1)); types5.add(TType.getStringType(2)); - - addTypes(types1, types); - addTypes(types2, types); - addTypes(types3, types); - addTypes(types4, types); - addTypes(types5, types); - - origins = new Vector<>(); - origins.add("Origin"); - origins.add("Destination"); - - finites = new Vector<>(); - finites.add("Finite FIFO"); - finites.add("Infinite FIFO"); - - blockings = new Vector<>(); - blockings.add("Blocking"); - blockings.add("Non-blocking FIFO"); + + addTypes(types1, types); + addTypes(types2, types); + addTypes(types3, types); + addTypes(types4, types); + addTypes(types5, types); + + origins = new Vector<>(); + origins.add("Origin"); + origins.add("Destination"); + + finites = new Vector<>(); + finites.add("Finite FIFO"); + finites.add("Infinite FIFO"); + + blockings = new Vector<>(); + blockings.add("Blocking"); + blockings.add("Non-blocking FIFO"); } - - private void addTypes(Vector<String> v, Vector<String> types) { - v.addAll(types); - } - + + private void addTypes(Vector<String> v, Vector<String> types) { + v.addAll(types); + } + private void initComponents() { - int i; - - Vector<String> dataFlowTypes = new Vector<>(); - dataFlowTypes.add( TMLDataFlowType.INT_16 ); - dataFlowTypes.add( TMLDataFlowType.INT_32 ); - dataFlowTypes.add( TMLDataFlowType.INT_64 ); + int i; + + Vector<String> dataFlowTypes = new Vector<>(); + dataFlowTypes.add(TMLDataFlowType.INT_16); + dataFlowTypes.add(TMLDataFlowType.INT_32); + dataFlowTypes.add(TMLDataFlowType.INT_64); Container c = getContentPane(); GridBagLayout gridbag0 = new GridBagLayout(); @@ -199,21 +205,21 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen GridBagConstraints c1 = new GridBagConstraints(); GridBagLayout gridbag2 = new GridBagLayout(); GridBagConstraints c2 = new GridBagConstraints(); - GridBagLayout gridbag3 = new GridBagLayout(); + GridBagLayout gridbag3 = new GridBagLayout(); GridBagConstraints c3 = new GridBagConstraints(); GridBagConstraints c4 = new GridBagConstraints(); - GridBagLayout gridbag4 = new GridBagLayout(); - + GridBagLayout gridbag4 = new GridBagLayout(); + setFont(new Font("Helvetica", Font.PLAIN, 14)); c.setLayout(gridbag0); - + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); - JPanel panel1 = new JPanel(); + JPanel panel1 = new JPanel(); panel1.setLayout(gridbag1); panel1.setBorder(new javax.swing.border.TitledBorder("Name and type ")); panel1.setPreferredSize(new Dimension(300, 150)); - + // First line panel1 c1.gridwidth = 1; c1.gridheight = 1; @@ -223,7 +229,7 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c1.fill = GridBagConstraints.BOTH; c1.gridheight = 3; panel1.add(new JLabel(" "), c1); - + c1.gridwidth = 1; c1.gridheight = 1; c1.weighty = 1.0; @@ -233,39 +239,39 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c1.gridwidth = GridBagConstraints.REMAINDER; //end row nameText = new JTextField(name); panel1.add(nameText, c1); - - // Type of port - c1.gridwidth = 1; + + // Type of port + c1.gridwidth = 1; c1.fill = GridBagConstraints.HORIZONTAL; c1.anchor = GridBagConstraints.CENTER; panel1.add(new JLabel("Type:"), c1); c1.gridwidth = GridBagConstraints.REMAINDER; //end row typePort = new JComboBox<>(portTypes); typePort.setSelectedIndex(portIndex); - typePort.addActionListener(this); + typePort.addActionListener(this); panel1.add(typePort, c1); - - c1.gridwidth = 1; + + c1.gridwidth = 1; c1.fill = GridBagConstraints.HORIZONTAL; c1.anchor = GridBagConstraints.CENTER; panel1.add(new JLabel("Origin:"), c1); c1.gridwidth = GridBagConstraints.REMAINDER; //end row origin = new JComboBox<>(origins); - if (isOrigin) { - origin.setSelectedIndex(0); - } else { - origin.setSelectedIndex(1); - } - origin.addActionListener(this); + if (isOrigin) { + origin.setSelectedIndex(0); + } else { + origin.setSelectedIndex(1); + } + origin.addActionListener(this); panel1.add(origin, c1); - - - // parameters - JPanel panel2 = new JPanel(); + + + // parameters + JPanel panel2 = new JPanel(); panel2.setLayout(gridbag2); panel2.setBorder(new javax.swing.border.TitledBorder("Formal Verification & Simulation Parameters ")); panel2.setPreferredSize(new Dimension(300, 300)); - c2.gridwidth = 1; + c2.gridwidth = 1; c2.gridheight = 1; c2.weighty = 1.0; c2.weightx = 1.0; @@ -273,29 +279,29 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c2.fill = GridBagConstraints.BOTH; c2.gridheight = 3; panel2.add(new JLabel(" "), c2); - - //Security Properties to check - confCheckBox = new JCheckBox("Check Confidentiality"); - panel2.add(confCheckBox, c2); - confCheckBox.addActionListener(this); - confCheckBox.setSelected(checkConf); - authCheckBox = new JCheckBox("Check Authenticity"); - authCheckBox.addActionListener(this); - panel2.add(authCheckBox,c2); - authCheckBox.setSelected(checkAuth); - - - //If related to security requirement, allow reference to the requirement - c2.gridwidth = 1; + + //Security Properties to check + confCheckBox = new JCheckBox("Check Confidentiality"); + panel2.add(confCheckBox, c2); + confCheckBox.addActionListener(this); + confCheckBox.setSelected(checkConf); + authCheckBox = new JCheckBox("Check Authenticity"); + authCheckBox.addActionListener(this); + panel2.add(authCheckBox, c2); + authCheckBox.setSelected(checkAuth); + + + //If related to security requirement, allow reference to the requirement + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; - panel2.add(new JLabel("Reference Requirement"),c2); - c2.gridwidth = GridBagConstraints.REMAINDER; //end row - refReq = new JComboBox<>(refs); - panel2.add(refReq,c2); - if (reference!=null){ - refReq.setSelectedItem(reference); - } + panel2.add(new JLabel("Reference Requirement"), c2); + c2.gridwidth = GridBagConstraints.REMAINDER; //end row + refReq = new JComboBox<>(refs); + panel2.add(refReq, c2); + if (reference != null) { + refReq.setSelectedItem(reference); + } c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; @@ -303,21 +309,21 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen panel2.add(new JLabel("Type #1"), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList1 = new JComboBox<>(types1); - //TraceManager.addDev("type1= " + type1); - if (type1.getType() < TType.OTHER) { - typeList1.setSelectedIndex(type1.getType()); - } else { - for(i=TType.OTHER; i<types1.size(); i++) { - //TraceManager.addDev("Looking for:" + type1.getTypeOther()); - //TraceManager.addDev("Current type:" + types1.get(i)); - if ((types1.get(i)).compareTo(type1.getTypeOther()) == 0) { - typeList1.setSelectedIndex(i); - break; - } - } - } + //TraceManager.addDev("type1= " + type1); + if (type1.getType() < TType.OTHER) { + typeList1.setSelectedIndex(type1.getType()); + } else { + for (i = TType.OTHER; i < types1.size(); i++) { + //TraceManager.addDev("Looking for:" + type1.getTypeOther()); + //TraceManager.addDev("Current type:" + types1.get(i)); + if ((types1.get(i)).compareTo(type1.getTypeOther()) == 0) { + typeList1.setSelectedIndex(i); + break; + } + } + } panel2.add(typeList1, c2); - + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; @@ -325,19 +331,19 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList2 = new JComboBox<>(types2); if (type2.getType() < TType.OTHER) { - typeList2.setSelectedIndex(type2.getType()); - } else { - for(i=TType.OTHER; i<types2.size(); i++) { - //TraceManager.addDev("Looking for:" + type1.getTypeOther()); - //TraceManager.addDev("Current type:" + types1.get(i)); - if ((types2.get(i)).compareTo(type2.getTypeOther()) == 0) { - typeList2.setSelectedIndex(i); - break; - } - } - } + typeList2.setSelectedIndex(type2.getType()); + } else { + for (i = TType.OTHER; i < types2.size(); i++) { + //TraceManager.addDev("Looking for:" + type1.getTypeOther()); + //TraceManager.addDev("Current type:" + types1.get(i)); + if ((types2.get(i)).compareTo(type2.getTypeOther()) == 0) { + typeList2.setSelectedIndex(i); + break; + } + } + } panel2.add(typeList2, c2); - + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; @@ -345,110 +351,108 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList3 = new JComboBox<>(types3); if (type3.getType() < TType.OTHER) { - typeList3.setSelectedIndex(type3.getType()); - } else { - for(i=TType.OTHER; i<types3.size(); i++) { - //TraceManager.addDev("Looking for:" + type1.getTypeOther()); - //TraceManager.addDev("Current type:" + types1.get(i)); - if ((types3.get(i)).compareTo(type3.getTypeOther()) == 0) { - typeList3.setSelectedIndex(i); - break; - } - } - } + typeList3.setSelectedIndex(type3.getType()); + } else { + for (i = TType.OTHER; i < types3.size(); i++) { + //TraceManager.addDev("Looking for:" + type1.getTypeOther()); + //TraceManager.addDev("Current type:" + types1.get(i)); + if ((types3.get(i)).compareTo(type3.getTypeOther()) == 0) { + typeList3.setSelectedIndex(i); + break; + } + } + } panel2.add(typeList3, c2); - - c2.gridwidth = 1; + + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; panel2.add(new JLabel("Type: #4"), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList4 = new JComboBox<>(types4); if (type4.getType() < TType.OTHER) { - typeList4.setSelectedIndex(type4.getType()); - } else { - for(i=TType.OTHER; i<types4.size(); i++) { - //TraceManager.addDev("Looking for:" + type1.getTypeOther()); - //TraceManager.addDev("Current type:" + types1.get(i)); - if ((types4.get(i)).compareTo(type4.getTypeOther()) == 0) { - typeList4.setSelectedIndex(i); - break; - } - } - } + typeList4.setSelectedIndex(type4.getType()); + } else { + for (i = TType.OTHER; i < types4.size(); i++) { + //TraceManager.addDev("Looking for:" + type1.getTypeOther()); + //TraceManager.addDev("Current type:" + types1.get(i)); + if ((types4.get(i)).compareTo(type4.getTypeOther()) == 0) { + typeList4.setSelectedIndex(i); + break; + } + } + } panel2.add(typeList4, c2); - - - c2.gridwidth = 1; + + + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; panel2.add(new JLabel("Type: #5"), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row typeList5 = new JComboBox<>(types5); if (type5.getType() < TType.OTHER) { - typeList5.setSelectedIndex(type5.getType()); - } else { - for(i=TType.OTHER; i<types5.size(); i++) { - //TraceManager.addDev("Looking for:" + type1.getTypeOther()); - //TraceManager.addDev("Current type:" + types1.get(i)); - if ((types5.get(i)).compareTo(type5.getTypeOther()) == 0) { - typeList5.setSelectedIndex(i); - break; - } - } - } + typeList5.setSelectedIndex(type5.getType()); + } else { + for (i = TType.OTHER; i < types5.size(); i++) { + //TraceManager.addDev("Looking for:" + type1.getTypeOther()); + //TraceManager.addDev("Current type:" + types1.get(i)); + if ((types5.get(i)).compareTo(type5.getTypeOther()) == 0) { + typeList5.setSelectedIndex(i); + break; + } + } + } panel2.add(typeList5, c2); - // Code generation - JPanel panel4 = new JPanel(); - panel4.setLayout( gridbag4 ); - panel4.setBorder( new javax.swing.border.TitledBorder("Code generation ") ); - panel4.setPreferredSize( new Dimension(300, 300) ); - c4.gridwidth = 1; + // Code generation + JPanel panel4 = new JPanel(); + panel4.setLayout(gridbag4); + panel4.setBorder(new javax.swing.border.TitledBorder("Code generation ")); + panel4.setPreferredSize(new Dimension(300, 300)); + c4.gridwidth = 1; c4.gridheight = 1; c4.weighty = 1.0; c4.weightx = 1.0; c4.gridwidth = GridBagConstraints.REMAINDER; //end row c4.fill = GridBagConstraints.BOTH; c4.gridheight = 3; - panel4.add( new JLabel(" "), c4 ); + panel4.add(new JLabel(" "), c4); c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; panel4.add(new JLabel("Dataflow type"), c2); c4.gridwidth = GridBagConstraints.REMAINDER; //end row - dfType = new JComboBox<>( dataFlowTypes ); - if( dataFlowType.equals( "VOID" ) || dataFlowType.equals( "" ) ) { - dfType.setSelectedIndex( 0 ); - } - else { - dfType.setSelectedIndex( dataFlowTypes.indexOf( dataFlowType ) ); - } - dfType.addActionListener(this); - panel4.add( dfType, c4); - + dfType = new JComboBox<>(dataFlowTypes); + if ((dataFlowType == null) || (dataFlowType.equals("VOID")) || (dataFlowType.equals(""))) { + dfType.setSelectedIndex(0); + } else { + dfType.setSelectedIndex(dataFlowTypes.indexOf(dataFlowType)); + } + dfType.addActionListener(this); + panel4.add(dfType, c4); + c4.gridwidth = 1; - if( associatedEvent.equals( "VOID" ) || associatedEvent.equals( "" ) ) { - associatedEventJT = new JTextField( "", 15 ); - } - else { - associatedEventJT = new JTextField( associatedEvent, 15 ); - } - panel4.add( new JLabel("Associate to event"), c4 ); + if (associatedEvent.equals("VOID") || associatedEvent.equals("")) { + associatedEventJT = new JTextField("", 15); + } else { + associatedEventJT = new JTextField(associatedEvent, 15); + } + panel4.add(new JLabel("Associate to event"), c4); c4.gridwidth = GridBagConstraints.REMAINDER; //end row - panel4.add( associatedEventJT, c4 ); + panel4.add(associatedEventJT, c4); c4.gridwidth = 1; //c2.gridwidth = GridBagConstraints.REMAINDER; //end row - isPrexCB = new JCheckBox("Prex"); - isPrexCB.setSelected( isPrex ); - panel4.add( isPrexCB, c4 ); + isPrexCB = new JCheckBox("Prex"); + isPrexCB.setSelected(isPrex); + panel4.add(isPrexCB, c4); c4.gridwidth = 1; c4.gridwidth = GridBagConstraints.REMAINDER; //end row - isPostexCB = new JCheckBox("Postex"); - isPostexCB.setSelected( isPostex ); - panel4.add( isPostexCB, c4 ); + isPostexCB = new JCheckBox("Postex"); + isPostexCB.setSelected(isPostex); + panel4.add(isPostexCB, c4); c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; @@ -456,34 +460,34 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen panel2.add(new JLabel("Blocking?"), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row blocking = new JComboBox<>(blockings); - if (isBlocking) { - blocking.setSelectedIndex(0); - } else { - blocking.setSelectedIndex(1); - } - blocking.addActionListener(this); + if (isBlocking) { + blocking.setSelectedIndex(0); + } else { + blocking.setSelectedIndex(1); + } + blocking.addActionListener(this); panel2.add(blocking, c2); - - c2.gridwidth = 1; + + c2.gridwidth = 1; c2.fill = GridBagConstraints.HORIZONTAL; c2.anchor = GridBagConstraints.CENTER; panel2.add(new JLabel("Finite?"), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row finite = new JComboBox<>(finites); - if (isFinite) { - finite.setSelectedIndex(0); - } else { - finite.setSelectedIndex(1); - } - finite.addActionListener(this); + if (isFinite) { + finite.setSelectedIndex(0); + } else { + finite.setSelectedIndex(1); + } + finite.addActionListener(this); panel2.add(finite, c2); - - c2.gridwidth = 1; + + c2.gridwidth = 1; panel2.add(new JLabel("Width (in Byte)="), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row widthText = new JTextField(widthSamples); panel2.add(widthText, c2); - + c2.gridwidth = 1; panel2.add(new JLabel("Capacity="), c2); c2.gridwidth = GridBagConstraints.REMAINDER; //end row @@ -497,13 +501,13 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen blocking.setSelected(isBlocking); blocking.addActionListener(this); panel2.add(blocking, c1);*/ - - // Robustness + + // Robustness panel3 = new JPanel(); panel3.setLayout(gridbag3); panel3.setBorder(new javax.swing.border.TitledBorder("Robustness ")); panel3.setPreferredSize(new Dimension(300, 300)); - c3.gridwidth = 1; + c3.gridwidth = 1; c3.gridheight = 1; c3.weighty = 1.0; c3.weightx = 1.0; @@ -511,28 +515,28 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c3.fill = GridBagConstraints.BOTH; c3.gridheight = 3; panel3.add(new JLabel(" "), c3); - - c3.gridwidth = GridBagConstraints.REMAINDER; //end row + + c3.gridwidth = GridBagConstraints.REMAINDER; //end row c3.fill = GridBagConstraints.HORIZONTAL; c3.anchor = GridBagConstraints.CENTER; - isLossyBox = new JCheckBox("Lossy"); - isLossyBox.setSelected(isLossy); + isLossyBox = new JCheckBox("Lossy"); + isLossyBox.setSelected(isLossy); panel3.add(isLossyBox, c3); - - c3.gridwidth = 1; - lossPercentageLabel = new JLabel("Loss percentage"); - panel3.add(lossPercentageLabel, c3); - c3.gridwidth = GridBagConstraints.REMAINDER; //end row - lossPercentageText = new JTextField(""+lossPercentage); - panel3.add(lossPercentageText, c3); - - c3.gridwidth = 1; - maxNbOfLossLabel = new JLabel("Max nb of loss"); - panel3.add(maxNbOfLossLabel, c3); - c3.gridwidth = GridBagConstraints.REMAINDER; //end row - maxNbOfLossText = new JTextField(""+maxNbOfLoss); - panel3.add(maxNbOfLossText, c3); - + + c3.gridwidth = 1; + lossPercentageLabel = new JLabel("Loss percentage"); + panel3.add(lossPercentageLabel, c3); + c3.gridwidth = GridBagConstraints.REMAINDER; //end row + lossPercentageText = new JTextField("" + lossPercentage); + panel3.add(lossPercentageText, c3); + + c3.gridwidth = 1; + maxNbOfLossLabel = new JLabel("Max nb of loss"); + panel3.add(maxNbOfLossLabel, c3); + c3.gridwidth = GridBagConstraints.REMAINDER; //end row + maxNbOfLossText = new JTextField("" + maxNbOfLoss); + panel3.add(maxNbOfLossText, c3); + // main panel; c0.gridwidth = 1; @@ -540,239 +544,239 @@ public class JDialogTMLCompositePort extends JDialogBase implements ActionListen c0.weighty = 1.0; c0.weightx = 1.0; c0.gridwidth = GridBagConstraints.REMAINDER; //end row - c0.fill = GridBagConstraints.BOTH; - + c0.fill = GridBagConstraints.BOTH; + c.add(panel1, c0); c.add(panel2, c0); - c.add(panel4, c0); - c.add(panel3, c0); + c.add(panel4, c0); + c.add(panel3, c0); + - c0.gridheight = 1; c0.fill = GridBagConstraints.HORIZONTAL; - + initButtons(c0, c, this); - repaint(); + repaint(); } - - public void actionPerformed(ActionEvent evt) { + + public void actionPerformed(ActionEvent evt) { String command = evt.getActionCommand(); - - checkMode(); - if (confCheckBox.isSelected() || authCheckBox.isSelected()){ - refReq.setEnabled(true); - } - else { - refReq.setEnabled(false); - } + + checkMode(); + if (confCheckBox.isSelected() || authCheckBox.isSelected()) { + refReq.setEnabled(true); + } else { + refReq.setEnabled(false); + } /*if (evt.getSource() == finite) { - if (finite.getSelectedIndex() == 1) { + if (finite.getSelectedIndex() == 1) { blocking.setSelectedIndex(1); } checkMode(); }*/ // Compare the action command to the known actions. - if (command.equals("Save and Close")) { + if (command.equals("Save and Close")) { closeDialog(); } else if (command.equals("Cancel")) { cancelDialog(); } } - - + + public void closeDialog() { data = true; - dataFlowType = dfType.getItemAt( dfType.getSelectedIndex() ); - associatedEvent = associatedEventJT.getText(); - isPrex = isPrexCB.isSelected(); - isPostex = isPostexCB.isSelected(); - checkConf = confCheckBox.isSelected(); - checkAuth = authCheckBox.isSelected(); - if( isPrex && isPostex ) { - JOptionPane.showMessageDialog( frame, "A channel cannot be marked as both prex and postex", "Error", - JOptionPane.INFORMATION_MESSAGE ); - return; - } + dataFlowType = dfType.getItemAt(dfType.getSelectedIndex()); + associatedEvent = associatedEventJT.getText(); + isPrex = isPrexCB.isSelected(); + isPostex = isPostexCB.isSelected(); + checkConf = confCheckBox.isSelected(); + checkAuth = authCheckBox.isSelected(); + if (isPrex && isPostex) { + JOptionPane.showMessageDialog(frame, "A channel cannot be marked as both prex and postex", "Error", + JOptionPane.INFORMATION_MESSAGE); + return; + } dispose(); } - public String getDataFlowType() { - return dataFlowType; - } + public String getDataFlowType() { + return dataFlowType; + } + + public String getAssociatedEvent() { + return associatedEvent; + } - public String getAssociatedEvent() { - return associatedEvent; - } - public void cancelDialog() { dispose(); } - public TGComponent getReference(){ - return (TGComponent) refReq.getSelectedItem(); - } - + + public TGComponent getReference() { + return (TGComponent) refReq.getSelectedItem(); + } + public void checkMode() { - int index = typePort.getSelectedIndex(); - if (index == 0) { - // channel - origin.setEnabled(true); - typeList1.setEnabled(false); - typeList2.setEnabled(false); - typeList3.setEnabled(false); - typeList4.setEnabled(false); - typeList5.setEnabled(false); - blocking.setEnabled(true); - finite.setEnabled(false); - widthText.setEnabled(true); - maxText.setEnabled((origin.getSelectedIndex() == 0) && (blocking.getSelectedIndex() == 0)); - - } else if (index == 1) { - // Event - origin.setEnabled(true); - typeList1.setEnabled(true); - typeList2.setEnabled(true); - typeList3.setEnabled(true); - typeList4.setEnabled(true); - typeList5.setEnabled(true); - dfType.setEnabled(false) ; - associatedEventJT.setEnabled( false ); - isPrexCB.setEnabled(false); - isPostexCB.setEnabled(false); - if (origin.getSelectedIndex() == 0) { - blocking.setEnabled(true); - finite.setEnabled(true); - if (blocking.getSelectedIndex() == 0) { - finite.setSelectedIndex(0); - } - } else { - blocking.setEnabled(false); - blocking.setSelectedIndex(0); - finite.setEnabled(false); - } - - widthText.setEnabled(false); - maxText.setEnabled(finite.getSelectedIndex() == 0); - - } else { - // Request - origin.setEnabled(true); - typeList1.setEnabled(true); - typeList2.setEnabled(true); - typeList3.setEnabled(true); - typeList4.setEnabled(true); - typeList5.setEnabled(true); - dfType.setEnabled(false) ; - associatedEventJT.setEnabled( false ); - isPrexCB.setEnabled(false); - isPostexCB.setEnabled(false); - blocking.setEnabled(false); - if (origin.getSelectedIndex() == 0) { - blocking.setSelectedIndex(1); - } else { - blocking.setSelectedIndex(0); - } - finite.setEnabled(false); - finite.setSelectedIndex(1); - widthText.setEnabled(false); - maxText.setEnabled(false); - - } + int index = typePort.getSelectedIndex(); + if (index == 0) { + // channel + origin.setEnabled(true); + typeList1.setEnabled(false); + typeList2.setEnabled(false); + typeList3.setEnabled(false); + typeList4.setEnabled(false); + typeList5.setEnabled(false); + blocking.setEnabled(true); + finite.setEnabled(false); + widthText.setEnabled(true); + maxText.setEnabled((origin.getSelectedIndex() == 0) && (blocking.getSelectedIndex() == 0)); + + } else if (index == 1) { + // Event + origin.setEnabled(true); + typeList1.setEnabled(true); + typeList2.setEnabled(true); + typeList3.setEnabled(true); + typeList4.setEnabled(true); + typeList5.setEnabled(true); + dfType.setEnabled(false); + associatedEventJT.setEnabled(false); + isPrexCB.setEnabled(false); + isPostexCB.setEnabled(false); + if (origin.getSelectedIndex() == 0) { + blocking.setEnabled(true); + finite.setEnabled(true); + if (blocking.getSelectedIndex() == 0) { + finite.setSelectedIndex(0); + } + } else { + blocking.setEnabled(false); + blocking.setSelectedIndex(0); + finite.setEnabled(false); + } + + widthText.setEnabled(false); + maxText.setEnabled(finite.getSelectedIndex() == 0); + + } else { + // Request + origin.setEnabled(true); + typeList1.setEnabled(true); + typeList2.setEnabled(true); + typeList3.setEnabled(true); + typeList4.setEnabled(true); + typeList5.setEnabled(true); + dfType.setEnabled(false); + associatedEventJT.setEnabled(false); + isPrexCB.setEnabled(false); + isPostexCB.setEnabled(false); + blocking.setEnabled(false); + if (origin.getSelectedIndex() == 0) { + blocking.setSelectedIndex(1); + } else { + blocking.setSelectedIndex(0); + } + finite.setEnabled(false); + finite.setSelectedIndex(1); + widthText.setEnabled(false); + maxText.setEnabled(false); + + } /*maxText.setEnabled(finite.isSelected()); blocking.setEnabled(finite.isSelected());*/ - - panel3.setEnabled(origin.getSelectedIndex() == 0); - isLossyBox.setEnabled(origin.getSelectedIndex() == 0); - lossPercentageText.setEnabled(origin.getSelectedIndex() == 0); - maxNbOfLossText.setEnabled(origin.getSelectedIndex() == 0); - lossPercentageLabel.setEnabled(origin.getSelectedIndex() == 0); - maxNbOfLossLabel.setEnabled(origin.getSelectedIndex() == 0); + + panel3.setEnabled(origin.getSelectedIndex() == 0); + isLossyBox.setEnabled(origin.getSelectedIndex() == 0); + lossPercentageText.setEnabled(origin.getSelectedIndex() == 0); + maxNbOfLossText.setEnabled(origin.getSelectedIndex() == 0); + lossPercentageLabel.setEnabled(origin.getSelectedIndex() == 0); + maxNbOfLossLabel.setEnabled(origin.getSelectedIndex() == 0); } - + public boolean hasNewData() { return data; } - + public String getParamName() { return nameText.getText(); } - + public String getMaxSamples() { - return maxText.getText(); + return maxText.getText(); } - - public String getWidthSamples() { - return widthText.getText(); + + public String getWidthSamples() { + return widthText.getText(); } - - public boolean isOrigin() { - return (origin.getSelectedIndex() == 0); + + public boolean isOrigin() { + return (origin.getSelectedIndex() == 0); } - + public boolean isFinite() { - return (finite.getSelectedIndex() == 0); + return (finite.getSelectedIndex() == 0); } - + public boolean isBlocking() { - return (blocking.getSelectedIndex() == 0); + return (blocking.getSelectedIndex() == 0); } - public boolean isChannelPrex() { - return isPrex; - } + public boolean isChannelPrex() { + return isPrex; + } - public boolean isChannelPostex() { - return isPostex; - } - - public int getPortType() { - return typePort.getSelectedIndex(); - } + public boolean isChannelPostex() { + return isPostex; + } + + public int getPortType() { + return typePort.getSelectedIndex(); + } public int getType(int i) { - switch(i) { + switch (i) { case 0: return typeList1.getSelectedIndex(); case 1: return typeList2.getSelectedIndex(); case 2: return typeList3.getSelectedIndex(); - case 3: - return typeList4.getSelectedIndex(); - case 4: - return typeList5.getSelectedIndex(); - default: + case 3: + return typeList4.getSelectedIndex(); + case 4: + return typeList5.getSelectedIndex(); + default: return typeList1.getSelectedIndex(); } - + + } + + public String getStringType(int i) { + int index = getType(i); + if (index < 3) { + return TType.getStringType(index); + } + + return types.get(index - 3); + } + + public boolean isLossy() { + return isLossyBox.isSelected(); + } + + public int getLossPercentage() { + try { + return Integer.decode(lossPercentageText.getText().trim()); + } catch (Exception e) { + return -1; + } + } + + public int getMaxNbOfLoss() { + try { + return Integer.decode(maxNbOfLossText.getText().trim()); + } catch (Exception e) { + return -1; + } } - - public String getStringType(int i) { - int index = getType(i); - if (index < 3) { - return TType.getStringType(index); - } - - return types.get(index-3); - } - - public boolean isLossy() { - return isLossyBox.isSelected(); - } - - public int getLossPercentage() { - try { - return Integer.decode(lossPercentageText.getText().trim()); - } catch (Exception e) { - return -1; - } - } - - public int getMaxNbOfLoss() { - try { - return Integer.decode(maxNbOfLossText.getText().trim()); - } catch (Exception e) { - return -1; - } - } }