diff --git a/modeling/modelsForTestingTTool/modelszoom.xml b/modeling/modelsForTestingTTool/modelszoom.xml index 1e6f29832980eef56f669554e39dad6a4516b35c..b19d27f8bc13d7c29f24de92318d5bd20b21ad25 100644 --- a/modeling/modelsForTestingTTool/modelszoom.xml +++ b/modeling/modelsForTestingTTool/modelszoom.xml @@ -6,7 +6,7 @@ <UseCaseDiagramPanel name="Use Case Diagram 0" minX="10" maxX="2500" minY="10" maxY="1500" zoom="1.0000000000000009" > <COMPONENT type="703" id="33" > <cdparam x="168" y="367" /> -<sizeparam width="74" height="50" minWidth="40" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="77" height="50" minWidth="40" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2501" minY="10" maxY="1501" /> <infoparam name="actor" value="Actor2" /> @@ -45,8 +45,8 @@ </COMPONENT> <COMPONENT type="701" id="58" > -<cdparam x="390" y="322" /> -<sizeparam width="80" height="40" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="387" y="322" /> +<sizeparam width="87" height="40" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2501" minY="10" maxY="1501" /> <infoparam name="Use case" value="My use case" /> @@ -140,7 +140,7 @@ <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="null" /> <P1 x="182" y="244" id="74" /> -<P2 x="390" y="342" id="35" /> +<P2 x="387" y="342" id="35" /> <Point x="168" y="303" /> <Point x="231" y="270" /> <Point x="292" y="338" /> @@ -173,291 +173,377 @@ </UseCaseDiagramPanel> -<SequenceDiagramPanel name="ScenarioFromUCD0" minX="10" maxX="2500" minY="10" maxY="1500" > -<COMPONENT type="606" id="228" > -<cdparam x="400" y="211" /> -<sizeparam width="10" height="411" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> +<SequenceDiagramPanelZV name="ScenarioFromUCD0" minX="10" maxX="2500" minY="10" maxY="1500" > +<CONNECTOR type="107" id="335" > +<cdparam x="105" y="173" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector" value="msg?" /> +<P1 x="104" y="467" id="272" /> +<P2 x="254" y="473" id="215" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> +<COMPONENT type="620" id="174" > +<cdparam x="711" y="98" /> +<sizeparam width="10" height="500" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> -<infoparam name="My system" value="My system" /> +<infoparam name="instance" value="Instance name" /> <extraparam> <Actor data="false" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="610" id="287" > -<father id="228" num="0" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="623" id="113" > +<father id="174" num="0" /> +<cdparam x="715" y="245" /> +<sizeparam width="49" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="470" /> +<infoparam name="action state" value="action" /> +<TGConnectingPoint num="0" id="105" /> +<TGConnectingPoint num="1" id="106" /> +<TGConnectingPoint num="2" id="107" /> +<TGConnectingPoint num="3" id="108" /> +<TGConnectingPoint num="4" id="109" /> +<TGConnectingPoint num="5" id="110" /> +<TGConnectingPoint num="6" id="111" /> +<TGConnectingPoint num="7" id="112" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="630" id="115" > +<father id="174" num="1" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="288" /> +<TGConnectingPoint num="0" id="114" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="285" > -<father id="228" num="1" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="117" > +<father id="174" num="2" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="286" /> +<TGConnectingPoint num="0" id="116" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="283" > -<father id="228" num="2" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="119" > +<father id="174" num="3" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="284" /> +<TGConnectingPoint num="0" id="118" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="281" > -<father id="228" num="3" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="121" > +<father id="174" num="4" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="282" /> +<TGConnectingPoint num="0" id="120" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="279" > -<father id="228" num="4" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="123" > +<father id="174" num="5" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="280" /> +<TGConnectingPoint num="0" id="122" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="277" > -<father id="228" num="5" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="125" > +<father id="174" num="6" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="278" /> +<TGConnectingPoint num="0" id="124" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="275" > -<father id="228" num="6" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="127" > +<father id="174" num="7" /> +<cdparam x="715" y="478" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="276" /> +<TGConnectingPoint num="0" id="126" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="273" > -<father id="228" num="7" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="129" > +<father id="174" num="8" /> +<cdparam x="715" y="470" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="274" /> +<TGConnectingPoint num="0" id="128" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="271" > -<father id="228" num="8" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="131" > +<father id="174" num="9" /> +<cdparam x="715" y="454" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="272" /> +<TGConnectingPoint num="0" id="130" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="269" > -<father id="228" num="9" /> -<cdparam x="406" y="519" /> +<SUBCOMPONENT type="630" id="133" > +<father id="174" num="10" /> +<cdparam x="715" y="437" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="270" /> +<TGConnectingPoint num="0" id="132" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="267" > -<father id="228" num="10" /> -<cdparam x="406" y="505" /> +<SUBCOMPONENT type="630" id="135" > +<father id="174" num="11" /> +<cdparam x="715" y="420" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="268" /> +<TGConnectingPoint num="0" id="134" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="265" > -<father id="228" num="11" /> -<cdparam x="406" y="489" /> +<SUBCOMPONENT type="630" id="137" > +<father id="174" num="12" /> +<cdparam x="715" y="404" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="266" /> +<TGConnectingPoint num="0" id="136" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="263" > -<father id="228" num="12" /> -<cdparam x="406" y="472" /> +<SUBCOMPONENT type="630" id="139" > +<father id="174" num="13" /> +<cdparam x="715" y="387" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="264" /> +<TGConnectingPoint num="0" id="138" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="261" > -<father id="228" num="13" /> -<cdparam x="406" y="455" /> +<SUBCOMPONENT type="630" id="141" > +<father id="174" num="14" /> +<cdparam x="715" y="370" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="262" /> +<TGConnectingPoint num="0" id="140" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="259" > -<father id="228" num="14" /> -<cdparam x="406" y="439" /> +<SUBCOMPONENT type="630" id="143" > +<father id="174" num="15" /> +<cdparam x="715" y="354" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="260" /> +<TGConnectingPoint num="0" id="142" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="257" > -<father id="228" num="15" /> -<cdparam x="406" y="422" /> +<SUBCOMPONENT type="630" id="145" > +<father id="174" num="16" /> +<cdparam x="715" y="337" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="258" /> +<TGConnectingPoint num="0" id="144" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="255" > -<father id="228" num="16" /> -<cdparam x="406" y="405" /> +<SUBCOMPONENT type="630" id="147" > +<father id="174" num="17" /> +<cdparam x="715" y="320" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="256" /> +<TGConnectingPoint num="0" id="146" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="253" > -<father id="228" num="17" /> -<cdparam x="406" y="389" /> +<SUBCOMPONENT type="630" id="149" > +<father id="174" num="18" /> +<cdparam x="715" y="304" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="254" /> +<TGConnectingPoint num="0" id="148" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="251" > -<father id="228" num="18" /> -<cdparam x="406" y="372" /> +<SUBCOMPONENT type="630" id="151" > +<father id="174" num="19" /> +<cdparam x="715" y="287" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="252" /> +<TGConnectingPoint num="0" id="150" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="249" > -<father id="228" num="19" /> -<cdparam x="406" y="355" /> +<SUBCOMPONENT type="630" id="153" > +<father id="174" num="20" /> +<cdparam x="715" y="270" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="250" /> +<TGConnectingPoint num="0" id="152" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="247" > -<father id="228" num="20" /> -<cdparam x="406" y="339" /> +<SUBCOMPONENT type="630" id="155" > +<father id="174" num="21" /> +<cdparam x="715" y="254" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="248" /> +<TGConnectingPoint num="0" id="154" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="245" > -<father id="228" num="21" /> -<cdparam x="406" y="322" /> +<SUBCOMPONENT type="630" id="157" > +<father id="174" num="22" /> +<cdparam x="715" y="237" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="246" /> +<TGConnectingPoint num="0" id="156" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="243" > -<father id="228" num="22" /> -<cdparam x="406" y="305" /> +<SUBCOMPONENT type="630" id="159" > +<father id="174" num="23" /> +<cdparam x="715" y="220" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="244" /> +<TGConnectingPoint num="0" id="158" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="241" > -<father id="228" num="23" /> -<cdparam x="406" y="289" /> +<SUBCOMPONENT type="630" id="161" > +<father id="174" num="24" /> +<cdparam x="715" y="204" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="242" /> +<TGConnectingPoint num="0" id="160" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="239" > -<father id="228" num="24" /> -<cdparam x="406" y="272" /> +<SUBCOMPONENT type="630" id="163" > +<father id="174" num="25" /> +<cdparam x="715" y="187" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="240" /> +<TGConnectingPoint num="0" id="162" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="237" > -<father id="228" num="25" /> -<cdparam x="406" y="255" /> +<SUBCOMPONENT type="630" id="165" > +<father id="174" num="26" /> +<cdparam x="715" y="170" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="238" /> +<TGConnectingPoint num="0" id="164" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="235" > -<father id="228" num="26" /> -<cdparam x="406" y="239" /> +<SUBCOMPONENT type="630" id="167" > +<father id="174" num="27" /> +<cdparam x="715" y="154" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="236" /> +<TGConnectingPoint num="0" id="166" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="233" > -<father id="228" num="27" /> -<cdparam x="406" y="223" /> +<SUBCOMPONENT type="630" id="169" > +<father id="174" num="28" /> +<cdparam x="715" y="137" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="234" /> +<TGConnectingPoint num="0" id="168" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="231" > -<father id="228" num="28" /> -<cdparam x="406" y="225" /> +<SUBCOMPONENT type="630" id="171" > +<father id="174" num="29" /> +<cdparam x="715" y="120" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="232" /> +<TGConnectingPoint num="0" id="170" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="229" > -<father id="228" num="29" /> -<cdparam x="406" y="223" /> +<SUBCOMPONENT type="630" id="173" > +<father id="174" num="30" /> +<cdparam x="715" y="110" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="230" /> +<TGConnectingPoint num="0" id="172" /> </SUBCOMPONENT> -<COMPONENT type="606" id="167" > -<cdparam x="250" y="211" /> -<sizeparam width="10" height="411" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="620" id="202" > +<cdparam x="431" y="92" /> +<sizeparam width="10" height="500" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> +<infoparam name="instance" value="Instance name" /> +<extraparam> +<Actor data="false" /> +</extraparam> +</COMPONENT> +<SUBCOMPONENT type="623" id="183" > +<father id="202" num="0" /> +<cdparam x="435" y="379" /> +<sizeparam width="30" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="470" /> +<infoparam name="action state" value="a" /> +<TGConnectingPoint num="0" id="175" /> +<TGConnectingPoint num="1" id="176" /> +<TGConnectingPoint num="2" id="177" /> +<TGConnectingPoint num="3" id="178" /> +<TGConnectingPoint num="4" id="179" /> +<TGConnectingPoint num="5" id="180" /> +<TGConnectingPoint num="6" id="181" /> +<TGConnectingPoint num="7" id="182" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="625" id="192" > +<father id="202" num="1" /> +<cdparam x="449" y="474" /> +<sizeparam width="15" height="25" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="18" maxX="18" minY="-2" maxY="478" /> +<infoparam name="setting timer" value="{timer=myTimer, duration=10}" /> +<TGConnectingPoint num="0" id="184" /> +<TGConnectingPoint num="1" id="185" /> +<TGConnectingPoint num="2" id="186" /> +<TGConnectingPoint num="3" id="187" /> +<TGConnectingPoint num="4" id="188" /> +<TGConnectingPoint num="5" id="189" /> +<TGConnectingPoint num="6" id="190" /> +<TGConnectingPoint num="7" id="191" /> +<extraparam> +<Interval timer="myTimer" duration="10" /> +</extraparam> +</SUBCOMPONENT> +<SUBCOMPONENT type="623" id="201" > +<father id="202" num="2" /> +<cdparam x="435" y="349" /> +<sizeparam width="30" height="20" minWidth="30" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="470" /> +<infoparam name="action state" value="b" /> +<TGConnectingPoint num="0" id="193" /> +<TGConnectingPoint num="1" id="194" /> +<TGConnectingPoint num="2" id="195" /> +<TGConnectingPoint num="3" id="196" /> +<TGConnectingPoint num="4" id="197" /> +<TGConnectingPoint num="5" id="198" /> +<TGConnectingPoint num="6" id="199" /> +<TGConnectingPoint num="7" id="200" /> +</SUBCOMPONENT> + +<COMPONENT type="620" id="263" > +<cdparam x="250" y="100" /> +<sizeparam width="10" height="500" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="Actor2" value="Actor2" /> @@ -465,280 +551,280 @@ <Actor data="true" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="610" id="226" > -<father id="167" num="0" /> -<cdparam x="256" y="518" /> +<SUBCOMPONENT type="630" id="204" > +<father id="263" num="0" /> +<cdparam x="254" y="112" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="227" /> +<TGConnectingPoint num="0" id="203" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="224" > -<father id="167" num="1" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="206" > +<father id="263" num="1" /> +<cdparam x="254" y="116" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="225" /> +<TGConnectingPoint num="0" id="205" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="222" > -<father id="167" num="2" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="208" > +<father id="263" num="2" /> +<cdparam x="254" y="133" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="223" /> +<TGConnectingPoint num="0" id="207" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="220" > -<father id="167" num="3" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="210" > +<father id="263" num="3" /> +<cdparam x="254" y="150" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="221" /> +<TGConnectingPoint num="0" id="209" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="218" > -<father id="167" num="4" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="212" > +<father id="263" num="4" /> +<cdparam x="254" y="166" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="219" /> +<TGConnectingPoint num="0" id="211" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="216" > -<father id="167" num="5" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="214" > +<father id="263" num="5" /> +<cdparam x="254" y="183" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="217" /> +<TGConnectingPoint num="0" id="213" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="214" > -<father id="167" num="6" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="216" > +<father id="263" num="6" /> +<cdparam x="254" y="466" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> <TGConnectingPoint num="0" id="215" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="212" > -<father id="167" num="7" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="218" > +<father id="263" num="7" /> +<cdparam x="254" y="216" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="213" /> +<TGConnectingPoint num="0" id="217" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="210" > -<father id="167" num="8" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="220" > +<father id="263" num="8" /> +<cdparam x="254" y="233" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="211" /> +<TGConnectingPoint num="0" id="219" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="208" > -<father id="167" num="9" /> -<cdparam x="256" y="519" /> +<SUBCOMPONENT type="630" id="222" > +<father id="263" num="9" /> +<cdparam x="254" y="250" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="209" /> +<TGConnectingPoint num="0" id="221" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="206" > -<father id="167" num="10" /> -<cdparam x="256" y="505" /> +<SUBCOMPONENT type="630" id="224" > +<father id="263" num="10" /> +<cdparam x="254" y="266" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="207" /> +<TGConnectingPoint num="0" id="223" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="204" > -<father id="167" num="11" /> -<cdparam x="256" y="489" /> +<SUBCOMPONENT type="630" id="226" > +<father id="263" num="11" /> +<cdparam x="254" y="283" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="205" /> +<TGConnectingPoint num="0" id="225" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="202" > -<father id="167" num="12" /> -<cdparam x="256" y="472" /> +<SUBCOMPONENT type="630" id="228" > +<father id="263" num="12" /> +<cdparam x="254" y="300" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="203" /> +<TGConnectingPoint num="0" id="227" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="200" > -<father id="167" num="13" /> -<cdparam x="256" y="455" /> +<SUBCOMPONENT type="630" id="230" > +<father id="263" num="13" /> +<cdparam x="254" y="316" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="201" /> +<TGConnectingPoint num="0" id="229" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="198" > -<father id="167" num="14" /> -<cdparam x="256" y="439" /> +<SUBCOMPONENT type="630" id="232" > +<father id="263" num="14" /> +<cdparam x="254" y="333" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="199" /> +<TGConnectingPoint num="0" id="231" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="196" > -<father id="167" num="15" /> -<cdparam x="256" y="422" /> +<SUBCOMPONENT type="630" id="234" > +<father id="263" num="15" /> +<cdparam x="254" y="350" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="197" /> +<TGConnectingPoint num="0" id="233" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="194" > -<father id="167" num="16" /> -<cdparam x="256" y="405" /> +<SUBCOMPONENT type="630" id="236" > +<father id="263" num="16" /> +<cdparam x="254" y="366" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="195" /> +<TGConnectingPoint num="0" id="235" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="192" > -<father id="167" num="17" /> -<cdparam x="256" y="389" /> +<SUBCOMPONENT type="630" id="238" > +<father id="263" num="17" /> +<cdparam x="254" y="383" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="193" /> +<TGConnectingPoint num="0" id="237" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="190" > -<father id="167" num="18" /> -<cdparam x="256" y="372" /> +<SUBCOMPONENT type="630" id="240" > +<father id="263" num="18" /> +<cdparam x="254" y="400" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="191" /> +<TGConnectingPoint num="0" id="239" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="188" > -<father id="167" num="19" /> -<cdparam x="256" y="355" /> +<SUBCOMPONENT type="630" id="242" > +<father id="263" num="19" /> +<cdparam x="254" y="416" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="189" /> +<TGConnectingPoint num="0" id="241" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="186" > -<father id="167" num="20" /> -<cdparam x="256" y="339" /> +<SUBCOMPONENT type="630" id="244" > +<father id="263" num="20" /> +<cdparam x="254" y="433" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="187" /> +<TGConnectingPoint num="0" id="243" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="184" > -<father id="167" num="21" /> -<cdparam x="256" y="322" /> +<SUBCOMPONENT type="630" id="246" > +<father id="263" num="21" /> +<cdparam x="254" y="450" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="185" /> +<TGConnectingPoint num="0" id="245" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="182" > -<father id="167" num="22" /> -<cdparam x="256" y="305" /> +<SUBCOMPONENT type="630" id="248" > +<father id="263" num="22" /> +<cdparam x="254" y="466" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="183" /> +<TGConnectingPoint num="0" id="247" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="180" > -<father id="167" num="23" /> -<cdparam x="256" y="289" /> +<SUBCOMPONENT type="630" id="250" > +<father id="263" num="23" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="181" /> +<TGConnectingPoint num="0" id="249" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="178" > -<father id="167" num="24" /> -<cdparam x="256" y="272" /> +<SUBCOMPONENT type="630" id="252" > +<father id="263" num="24" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="179" /> +<TGConnectingPoint num="0" id="251" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="176" > -<father id="167" num="25" /> -<cdparam x="256" y="255" /> +<SUBCOMPONENT type="630" id="254" > +<father id="263" num="25" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="177" /> +<TGConnectingPoint num="0" id="253" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="174" > -<father id="167" num="26" /> -<cdparam x="256" y="239" /> +<SUBCOMPONENT type="630" id="256" > +<father id="263" num="26" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="175" /> +<TGConnectingPoint num="0" id="255" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="172" > -<father id="167" num="27" /> -<cdparam x="256" y="223" /> +<SUBCOMPONENT type="630" id="258" > +<father id="263" num="27" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="173" /> +<TGConnectingPoint num="0" id="257" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="170" > -<father id="167" num="28" /> -<cdparam x="256" y="225" /> +<SUBCOMPONENT type="630" id="260" > +<father id="263" num="28" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="171" /> +<TGConnectingPoint num="0" id="259" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="168" > -<father id="167" num="29" /> -<cdparam x="256" y="223" /> +<SUBCOMPONENT type="630" id="262" > +<father id="263" num="29" /> +<cdparam x="254" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="169" /> +<TGConnectingPoint num="0" id="261" /> </SUBCOMPONENT> -<COMPONENT type="606" id="106" > -<cdparam x="100" y="211" /> -<sizeparam width="10" height="411" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> +<COMPONENT type="620" id="333" > +<cdparam x="100" y="100" /> +<sizeparam width="10" height="500" minWidth="10" minHeight="250" maxWidth="10" maxHeight="1500" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="2500" minY="10" maxY="1500" /> <infoparam name="Actor1" value="Actor1" /> @@ -746,298 +832,298 @@ <Actor data="true" /> </extraparam> </COMPONENT> -<SUBCOMPONENT type="603" id="289" > -<father id="106" num="0" /> -<cdparam x="117" y="426" /> -<sizeparam width="15" height="25" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="18" maxX="18" minY="-2" maxY="389" /> -<infoparam name="setting timer" value="{timer=myTimer, duration=10}" /> -<TGConnectingPoint num="0" id="290" /> -<TGConnectingPoint num="1" id="291" /> -<TGConnectingPoint num="2" id="292" /> -<TGConnectingPoint num="3" id="293" /> -<TGConnectingPoint num="4" id="294" /> -<TGConnectingPoint num="5" id="295" /> -<TGConnectingPoint num="6" id="296" /> -<TGConnectingPoint num="7" id="297" /> -<extraparam> -<Interval timer="myTimer" duration="10" /> -</extraparam> -</SUBCOMPONENT> -<SUBCOMPONENT type="610" id="165" > -<father id="106" num="1" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="265" > +<father id="333" num="0" /> +<cdparam x="104" y="278" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="166" /> +<TGConnectingPoint num="0" id="264" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="163" > -<father id="106" num="2" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="267" > +<father id="333" num="1" /> +<cdparam x="104" y="203" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="164" /> +<TGConnectingPoint num="0" id="266" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="161" > -<father id="106" num="3" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="269" > +<father id="333" num="2" /> +<cdparam x="104" y="112" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="162" /> +<TGConnectingPoint num="0" id="268" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="159" > -<father id="106" num="4" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="271" > +<father id="333" num="3" /> +<cdparam x="104" y="150" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="160" /> +<TGConnectingPoint num="0" id="270" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="157" > -<father id="106" num="5" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="273" > +<father id="333" num="4" /> +<cdparam x="104" y="460" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="158" /> +<TGConnectingPoint num="0" id="272" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="155" > -<father id="106" num="6" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="275" > +<father id="333" num="5" /> +<cdparam x="104" y="183" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="156" /> +<TGConnectingPoint num="0" id="274" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="153" > -<father id="106" num="7" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="277" > +<father id="333" num="6" /> +<cdparam x="104" y="200" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="154" /> +<TGConnectingPoint num="0" id="276" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="151" > -<father id="106" num="8" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="279" > +<father id="333" num="7" /> +<cdparam x="104" y="216" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="152" /> +<TGConnectingPoint num="0" id="278" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="149" > -<father id="106" num="9" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="281" > +<father id="333" num="8" /> +<cdparam x="104" y="233" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="150" /> +<TGConnectingPoint num="0" id="280" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="147" > -<father id="106" num="10" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="283" > +<father id="333" num="9" /> +<cdparam x="104" y="250" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="148" /> +<TGConnectingPoint num="0" id="282" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="145" > -<father id="106" num="11" /> -<cdparam x="106" y="505" /> +<SUBCOMPONENT type="630" id="285" > +<father id="333" num="10" /> +<cdparam x="104" y="266" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="146" /> +<TGConnectingPoint num="0" id="284" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="143" > -<father id="106" num="12" /> -<cdparam x="106" y="489" /> +<SUBCOMPONENT type="630" id="287" > +<father id="333" num="11" /> +<cdparam x="104" y="283" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="144" /> +<TGConnectingPoint num="0" id="286" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="141" > -<father id="106" num="13" /> -<cdparam x="106" y="472" /> +<SUBCOMPONENT type="630" id="289" > +<father id="333" num="12" /> +<cdparam x="104" y="300" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="142" /> +<TGConnectingPoint num="0" id="288" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="139" > -<father id="106" num="14" /> -<cdparam x="106" y="455" /> +<SUBCOMPONENT type="630" id="291" > +<father id="333" num="13" /> +<cdparam x="104" y="316" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="140" /> +<TGConnectingPoint num="0" id="290" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="137" > -<father id="106" num="15" /> -<cdparam x="106" y="501" /> +<SUBCOMPONENT type="630" id="293" > +<father id="333" num="14" /> +<cdparam x="104" y="333" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="138" /> +<TGConnectingPoint num="0" id="292" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="135" > -<father id="106" num="16" /> -<cdparam x="106" y="519" /> +<SUBCOMPONENT type="630" id="295" > +<father id="333" num="15" /> +<cdparam x="104" y="350" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="136" /> +<TGConnectingPoint num="0" id="294" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="133" > -<father id="106" num="17" /> -<cdparam x="106" y="405" /> +<SUBCOMPONENT type="630" id="297" > +<father id="333" num="16" /> +<cdparam x="104" y="366" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="134" /> +<TGConnectingPoint num="0" id="296" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="131" > -<father id="106" num="18" /> -<cdparam x="106" y="389" /> +<SUBCOMPONENT type="630" id="299" > +<father id="333" num="17" /> +<cdparam x="104" y="383" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="132" /> +<TGConnectingPoint num="0" id="298" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="129" > -<father id="106" num="19" /> -<cdparam x="106" y="372" /> +<SUBCOMPONENT type="630" id="301" > +<father id="333" num="18" /> +<cdparam x="104" y="400" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="130" /> +<TGConnectingPoint num="0" id="300" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="127" > -<father id="106" num="20" /> -<cdparam x="106" y="355" /> +<SUBCOMPONENT type="630" id="303" > +<father id="333" num="19" /> +<cdparam x="104" y="416" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="128" /> +<TGConnectingPoint num="0" id="302" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="125" > -<father id="106" num="21" /> -<cdparam x="106" y="339" /> +<SUBCOMPONENT type="630" id="305" > +<father id="333" num="20" /> +<cdparam x="104" y="433" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="126" /> +<TGConnectingPoint num="0" id="304" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="123" > -<father id="106" num="22" /> -<cdparam x="106" y="322" /> +<SUBCOMPONENT type="630" id="307" > +<father id="333" num="21" /> +<cdparam x="104" y="450" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="124" /> +<TGConnectingPoint num="0" id="306" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="121" > -<father id="106" num="23" /> -<cdparam x="106" y="305" /> +<SUBCOMPONENT type="630" id="309" > +<father id="333" num="22" /> +<cdparam x="104" y="466" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="122" /> +<TGConnectingPoint num="0" id="308" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="119" > -<father id="106" num="24" /> -<cdparam x="106" y="289" /> +<SUBCOMPONENT type="630" id="311" > +<father id="333" num="23" /> +<cdparam x="104" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="120" /> +<TGConnectingPoint num="0" id="310" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="117" > -<father id="106" num="25" /> -<cdparam x="106" y="272" /> +<SUBCOMPONENT type="630" id="313" > +<father id="333" num="24" /> +<cdparam x="104" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="118" /> +<TGConnectingPoint num="0" id="312" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="115" > -<father id="106" num="26" /> -<cdparam x="106" y="255" /> +<SUBCOMPONENT type="630" id="315" > +<father id="333" num="25" /> +<cdparam x="104" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="116" /> +<TGConnectingPoint num="0" id="314" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="113" > -<father id="106" num="27" /> -<cdparam x="106" y="239" /> +<SUBCOMPONENT type="630" id="317" > +<father id="333" num="26" /> +<cdparam x="104" y="128" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="114" /> +<TGConnectingPoint num="0" id="316" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="111" > -<father id="106" num="28" /> -<cdparam x="106" y="223" /> +<SUBCOMPONENT type="630" id="319" > +<father id="333" num="27" /> +<cdparam x="104" y="388" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="112" /> +<TGConnectingPoint num="0" id="318" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="109" > -<father id="106" num="29" /> -<cdparam x="106" y="225" /> +<SUBCOMPONENT type="630" id="321" > +<father id="333" num="28" /> +<cdparam x="104" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="110" /> +<TGConnectingPoint num="0" id="320" /> </SUBCOMPONENT> -<SUBCOMPONENT type="610" id="107" > -<father id="106" num="30" /> -<cdparam x="106" y="223" /> +<SUBCOMPONENT type="630" id="323" > +<father id="333" num="29" /> +<cdparam x="104" y="480" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="5" maxX="5" minY="10" maxY="386" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="475" /> <infoparam name="port" value="port" /> -<TGConnectingPoint num="0" id="108" /> +<TGConnectingPoint num="0" id="322" /> +</SUBCOMPONENT> +<SUBCOMPONENT type="628" id="332" > +<father id="333" num="30" /> +<cdparam x="104" y="185" /> +<sizeparam width="10" height="30" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="5" maxX="5" minY="10" maxY="460" /> +<infoparam name="time interval" value="" /> +<TGConnectingPoint num="0" id="324" /> +<TGConnectingPoint num="1" id="325" /> +<TGConnectingPoint num="2" id="326" /> +<TGConnectingPoint num="3" id="327" /> +<TGConnectingPoint num="4" id="328" /> +<TGConnectingPoint num="5" id="329" /> +<TGConnectingPoint num="6" id="330" /> +<TGConnectingPoint num="7" id="331" /> +<extraparam> +<Interval minDelay="" maxDelay="" /> +</extraparam> </SUBCOMPONENT> -</SequenceDiagramPanel> +</SequenceDiagramPanelZV> </Modeling> diff --git a/src/ui/ActionPerformer.java b/src/ui/ActionPerformer.java index ec2619e77f11a056087f55cc00912f939eb6e0c3..9c738ef40ea99e3fb0075a3ae2a1f12abd59b7ef 100755 --- a/src/ui/ActionPerformer.java +++ b/src/ui/ActionPerformer.java @@ -644,6 +644,36 @@ public class ActionPerformer { mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SD_COREGION); } else if (command.equals(mgui.actions[TGUIAction.SD_ALIGN_INSTANCES].getActionCommand())) { mgui.alignInstances(); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_EDIT].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.EDIT, -1); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_INSTANCE].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_INSTANCE); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_SYNC].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.CONNECTOR_MESSAGE_SYNC_SDZV); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_ASYNC].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SDZV); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_ABSOLUTE_TIME_CONSTRAINT].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_ABSOLUTE_TIME_CONSTRAINT); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_RELATIVE_TIME_CONSTRAINT); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT_CONNECTOR].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.CONNECTOR_RELATIVE_TIME_SDZV); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_ACTION_STATE].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_ACTION_STATE); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_GUARD].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_GUARD); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_TIME_INTERVAL].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_TIME_INTERVAL); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_TIMER_SETTING].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_TIMER_SETTING); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_TIMER_EXPIRATION].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_TIMER_EXPIRATION); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_TIMER_CANCELLATION].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_TIMER_CANCELLATION); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_COREGION].getActionCommand())) { + mgui.actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.SDZV_COREGION); + } else if (command.equals(mgui.actions[TGUIAction.SDZV_ALIGN_INSTANCES].getActionCommand())) { + mgui.alignInstances(); } else if (command.equals(mgui.actions[TGUIAction.UCD_EDIT].getActionCommand())) { mgui.actionOnButton(TGComponentManager.EDIT, -1); } else if (command.equals(mgui.actions[TGUIAction.UCD_ACTOR].getActionCommand())) { diff --git a/src/ui/AnalysisPanel.java b/src/ui/AnalysisPanel.java index f21a469abcf5380cc12317b5729664f09eabadd5..e1c337f714ab5ad7a3bc0bc427b5e7ba6cf6f9d2 100755 --- a/src/ui/AnalysisPanel.java +++ b/src/ui/AnalysisPanel.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 AnalysisPanel -* Managenemt of analysis panels -* Creation: 14/01/2005 -* @version 1.0 14/01/2005 -* @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 AnalysisPanel + * Managenemt of analysis panels + * Creation: 14/01/2005 + * @version 1.0 14/01/2005 + * @author Ludovic APVRILLE + * @see MainGUI + */ package ui; @@ -53,6 +53,7 @@ import java.util.*; import ui.iod.*; import ui.sd.*; +import ui.sd2.*; import ui.ucd.*; import ui.avatarcd.*; import ui.avatarad.*; @@ -60,57 +61,84 @@ import myutil.*; public class AnalysisPanel extends TURTLEPanel { public InteractionOverviewDiagramPanel iodp; - + public AnalysisPanel(MainGUI _mgui) { super(_mgui); tabbedPane = new JTabbedPane(); cl = new ChangeListener() { - public void stateChanged(ChangeEvent e){ - mgui.paneAnalysisAction(e); - } - }; + public void stateChanged(ChangeEvent e){ + mgui.paneAnalysisAction(e); + } + }; tabbedPane.addChangeListener(cl); tabbedPane.addMouseListener(new TURTLEPanelPopupListener(this, mgui)); } - + public void init() { - + // Class Diagram toolbar InteractionOverviewDiagramToolBar toolBarIOD = new InteractionOverviewDiagramToolBar(mgui); toolbars.add(toolBarIOD); - + toolBarPanel = new JPanel(); toolBarPanel.setLayout(new BorderLayout()); - - //Class diagram + + //Class diagram iodp = new InteractionOverviewDiagramPanel(mgui, toolBarIOD); iodp.setName("Interaction Overview Diagram"); iodp.tp = this; tdp = iodp; panels.add(iodp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); iodp.jsp = jsp; jsp.setWheelScrollingEnabled(true); jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); toolBarPanel.add(toolBarIOD, BorderLayout.NORTH); toolBarPanel.add(jsp, BorderLayout.CENTER); tabbedPane.addTab("Interaction Overview Diagram", IconManager.imgic17, toolBarPanel, "Opens interaction overview diagram"); - tabbedPane.setSelectedIndex(0); + tabbedPane.setSelectedIndex(0); //jsp.setVisible(true); } - + public boolean addSequenceDiagram(String s) { JPanel toolBarPanel = new JPanel(); toolBarPanel.setLayout(new BorderLayout()); - - SequenceDiagramToolBar toolBarSequence = new SequenceDiagramToolBar(mgui); + + ui.sd.SequenceDiagramToolBar toolBarSequence = new ui.sd.SequenceDiagramToolBar(mgui); + toolbars.add(toolBarSequence); + + ui.sd2.SequenceDiagramPanel sdp = new ui.sd2.SequenceDiagramPanel(mgui, toolBarSequence); + sdp.setName(s); + sdp.tp = this; + panels.add(sdp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(sdp); + sdp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); + toolBarPanel.add(toolBarSequence, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab(s, IconManager.imgic18, toolBarPanel, "Open the sequence diagram of " + s); + //tabbedPane.setVisible(true); + //sdp.setVisible(true); + //jsp.setVisible(true); + //tabbedPane.setSelectedIndex(panels.size()-1); + + return true; + + } + + public boolean addSequenceDiagramZV(String s) { + JPanel toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + ui.sd2.SequenceDiagramToolBar toolBarSequence = new ui.sd2.SequenceDiagramToolBar(mgui); toolbars.add(toolBarSequence); - - SequenceDiagramPanel sdp = new SequenceDiagramPanel(mgui, toolBarSequence); + + ui.sd2.SequenceDiagramPanel sdp = new ui.sd2.SequenceDiagramPanel(mgui, toolBarSequence); sdp.setName(s); sdp.tp = this; panels.add(sdp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(sdp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(sdp); sdp.jsp = jsp; jsp.setWheelScrollingEnabled(true); jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); @@ -121,237 +149,237 @@ public class AnalysisPanel extends TURTLEPanel { //sdp.setVisible(true); //jsp.setVisible(true); //tabbedPane.setSelectedIndex(panels.size()-1); - + return true; - + } - - public boolean addIODiagram(String s) { + + public boolean addIODiagram(String s) { InteractionOverviewDiagramToolBar toolBarIOD = new InteractionOverviewDiagramToolBar(mgui); toolbars.add(toolBarIOD); - + toolBarPanel = new JPanel(); toolBarPanel.setLayout(new BorderLayout()); - + iodp = new InteractionOverviewDiagramPanel(mgui, toolBarIOD); iodp.setName(s); iodp.tp = this; tdp = iodp; panels.add(iodp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); iodp.jsp = jsp; jsp.setWheelScrollingEnabled(true); jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); toolBarPanel.add(toolBarIOD, BorderLayout.NORTH); toolBarPanel.add(jsp, BorderLayout.CENTER); tabbedPane.addTab(s, IconManager.imgic17, toolBarPanel, "Opens interaction overview diagram"); - + return true; - + } - + public boolean addUseCaseDiagram(String s) { JPanel toolBarPanel = new JPanel(); toolBarPanel.setLayout(new BorderLayout()); - - UseCaseDiagramToolBar toolBarUC = new UseCaseDiagramToolBar(mgui); + + UseCaseDiagramToolBar toolBarUC = new UseCaseDiagramToolBar(mgui); toolbars.add(toolBarUC); - + UseCaseDiagramPanel ucdp = new UseCaseDiagramPanel(mgui, toolBarUC); ucdp.setName(s); ucdp.tp = this; panels.add(ucdp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(ucdp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(ucdp); ucdp.jsp = jsp; jsp.setWheelScrollingEnabled(true); jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); toolBarPanel.add(toolBarUC, BorderLayout.NORTH); toolBarPanel.add(jsp, BorderLayout.CENTER); tabbedPane.addTab(s, IconManager.imgic19, toolBarPanel, "Open the use case diagram of " + s); - + return true; } - - /*public boolean addAvatarContextDiagram(String s) { - JPanel toolBarPanel = new JPanel(); - toolBarPanel.setLayout(new BorderLayout()); - - AvatarCDToolBar toolBarACD = new AvatarCDToolBar(mgui); - toolbars.add(toolBarACD); - - AvatarCDPanel acdp = new AvatarCDPanel(mgui, toolBarACD); - acdp.setName(s); - acdp.tp = this; - panels.add(acdp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(acdp); - acdp.jsp = jsp; - jsp.setWheelScrollingEnabled(true); - jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); - toolBarPanel.add(toolBarACD, BorderLayout.NORTH); - toolBarPanel.add(jsp, BorderLayout.CENTER); - tabbedPane.addTab(s, IconManager.imgic80, toolBarPanel, "Open the context diagram of " + s); - - return true; - }*/ - + + /*public boolean addAvatarContextDiagram(String s) { + JPanel toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + AvatarCDToolBar toolBarACD = new AvatarCDToolBar(mgui); + toolbars.add(toolBarACD); + + AvatarCDPanel acdp = new AvatarCDPanel(mgui, toolBarACD); + acdp.setName(s); + acdp.tp = this; + panels.add(acdp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(acdp); + acdp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); + toolBarPanel.add(toolBarACD, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab(s, IconManager.imgic80, toolBarPanel, "Open the context diagram of " + s); + + return true; + }*/ + /*public boolean addAvatarActivityDiagram(String s) { - JPanel toolBarPanel = new JPanel(); - toolBarPanel.setLayout(new BorderLayout()); - - AvatarADToolBar toolBarAAD = new AvatarADToolBar(mgui); - toolbars.add(toolBarAAD); - - AvatarADPanel aadp = new AvatarADPanel(mgui, toolBarAAD); - aadp.setName(s); - aadp.tp = this; - panels.add(aadp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(aadp); - aadp.jsp = jsp; - jsp.setWheelScrollingEnabled(true); - jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); - toolBarPanel.add(toolBarAAD, BorderLayout.NORTH); - toolBarPanel.add(jsp, BorderLayout.CENTER); - tabbedPane.addTab(s, IconManager.imgic80, toolBarPanel, "Open the activity diagram of " + s); - - return true; - }*/ - - + JPanel toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + AvatarADToolBar toolBarAAD = new AvatarADToolBar(mgui); + toolbars.add(toolBarAAD); + + AvatarADPanel aadp = new AvatarADPanel(mgui, toolBarAAD); + aadp.setName(s); + aadp.tp = this; + panels.add(aadp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(aadp); + aadp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); + toolBarPanel.add(toolBarAAD, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab(s, IconManager.imgic80, toolBarPanel, "Open the activity diagram of " + s); + + return true; + }*/ + + public String saveHeaderInXml() { return "<Modeling type=\"Analysis\" nameTab=\"" + mgui.getTabName(this) + "\" >\n"; } - + public String saveTailInXml() { return "</Modeling>\n\n\n"; } - + public String toString() { return "TURTLE Analysis: " + mgui.getTitleAt(this); } - + public boolean removeEnabled(int index) { - if ((panels.elementAt(index) instanceof SequenceDiagramPanel) ||(panels.elementAt(index) instanceof UseCaseDiagramPanel) ||(panels.elementAt(index) instanceof AvatarCDPanel)||(panels.elementAt(index) instanceof AvatarADPanel) || ((panels.elementAt(index) instanceof InteractionOverviewDiagramPanel) & index != 0)){ + if ((panels.elementAt(index) instanceof ui.sd.SequenceDiagramPanel) ||(panels.elementAt(index) instanceof ui.sd2.SequenceDiagramPanel) ||(panels.elementAt(index) instanceof UseCaseDiagramPanel) ||(panels.elementAt(index) instanceof AvatarCDPanel)||(panels.elementAt(index) instanceof AvatarADPanel) || ((panels.elementAt(index) instanceof InteractionOverviewDiagramPanel) & index != 0)){ return true; } return false; } - + public boolean renameEnabled(int index) { - if ((panels.elementAt(index) instanceof SequenceDiagramPanel) ||(panels.elementAt(index) instanceof UseCaseDiagramPanel) ||(panels.elementAt(index) instanceof AvatarCDPanel)||(panels.elementAt(index) instanceof AvatarADPanel)|| ((panels.elementAt(index) instanceof InteractionOverviewDiagramPanel) & index != 0)){ + if ((panels.elementAt(index) instanceof ui.sd.SequenceDiagramPanel) ||(panels.elementAt(index) instanceof ui.sd2.SequenceDiagramPanel) ||(panels.elementAt(index) instanceof UseCaseDiagramPanel) ||(panels.elementAt(index) instanceof AvatarCDPanel)||(panels.elementAt(index) instanceof AvatarADPanel)|| ((panels.elementAt(index) instanceof InteractionOverviewDiagramPanel) & index != 0)){ return true; } return false; } - + public boolean isUCDEnabled() { return true; - } - - public boolean isSDEnabled() { + } + + public boolean isSDEnabled() { return true; - } - + } + public boolean isAvatarCDEnabled() { - return false; + return false; //return true; - } - - public boolean isAvatarADEnabled() { + } + + public boolean isAvatarADEnabled() { return false; - } - - public void addInstancesToLastSD(UseCaseDiagramPanel _ucdp) { - TraceManager.addDev("Adding instances to last SD"); - - TDiagramPanel panel = (TDiagramPanel)(panels.get(panels.size()-1)); - if (!(panel instanceof SequenceDiagramPanel)) { - return; - } - - //TraceManager.addDev("Adding instances to last SD Step 2"); - - ListIterator iterator = _ucdp.getComponentList().listIterator(); - TGComponent tgc; - - // To determine whether an actor is on the left, or on the right - int middleX = 0; - int cptTotal = 0; - String systemName; - UCDBorder border = _ucdp.getFirstUCDBorder(); - if (border != null) { - middleX = border.getX() + border.getWidth()/2; - systemName = border.getValue(); - } else { - systemName = "System"; - while(iterator.hasNext()) { - tgc = (TGComponent)(iterator.next()); - if ((tgc instanceof UCDActor) || (tgc instanceof UCDActorBox)) { - middleX = middleX + tgc.getX(); - cptTotal ++; - } - } - middleX = middleX / cptTotal; - } - - //TraceManager.addDev("Adding instances to last SD Step 3"); - - // Classify actors - LinkedList <TGComponent> actors = new LinkedList(); - iterator = _ucdp.getComponentList().listIterator(); - int i; - while(iterator.hasNext()) { - tgc = (TGComponent)(iterator.next()); - if ((tgc instanceof UCDActor) || (tgc instanceof UCDActorBox)) { - for(i=0; i<actors.size(); i++) { - if (actors.get(i).getX() > tgc.getX()) { - break; - } - } - // added at index i - actors.add(i, tgc); - } - } - - //TraceManager.addDev("Adding instances to last SD Step 3 nb of actors = " + actors.size()); - - int initX = 100; - int initY = 100; - int stepX = 150; - SDInstance sdi; - boolean systemAdded = false; - // Add actors (and the system) - for(TGComponent elt: actors) { - if (elt.getX() > middleX && !systemAdded) { - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); - sdi.setValue(systemName); - sdi.setActor(false); - panel.addComponent(sdi, initX, initY, false, true); - initX += stepX; - systemAdded = true; - } - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); - sdi.setValue(elt.getValue()); - sdi.setActor(true); - panel.addComponent(sdi, initX, initY, false, true); - initX += stepX; - } - - if (!systemAdded) { - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); - sdi.setValue(systemName); - sdi.setActor(false); - panel.addComponent(sdi, initX, initY, false, true); - initX += stepX; - systemAdded = true; - } - - while(initX > panel.getMaxX()) { - panel.setMaxX(panel.getMaxX() + panel.getIncrement()); - panel.updateSize(); - } - - panel.repaint(); - - TraceManager.addDev("initX = " + initX + " nb of components:" + panel.getComponentList().size()); - } -} \ No newline at end of file + } + + public void addInstancesToLastSD(UseCaseDiagramPanel _ucdp) { + TraceManager.addDev("Adding instances to last SD"); + + TDiagramPanel panel = (TDiagramPanel)(panels.get(panels.size()-1)); + if (!(panel instanceof ui.sd2.SequenceDiagramPanel)) { + return; + } + + //TraceManager.addDev("Adding instances to last SD Step 2"); + + ListIterator iterator = _ucdp.getComponentList().listIterator(); + TGComponent tgc; + + // To determine whether an actor is on the left, or on the right + int middleX = 0; + int cptTotal = 0; + String systemName; + UCDBorder border = _ucdp.getFirstUCDBorder(); + if (border != null) { + middleX = border.getX() + border.getWidth()/2; + systemName = border.getValue(); + } else { + systemName = "System"; + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if ((tgc instanceof UCDActor) || (tgc instanceof UCDActorBox)) { + middleX = middleX + tgc.getX(); + cptTotal ++; + } + } + middleX = middleX / cptTotal; + } + + //TraceManager.addDev("Adding instances to last SD Step 3"); + + // Classify actors + LinkedList <TGComponent> actors = new LinkedList(); + iterator = _ucdp.getComponentList().listIterator(); + int i; + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if ((tgc instanceof UCDActor) || (tgc instanceof UCDActorBox)) { + for(i=0; i<actors.size(); i++) { + if (actors.get(i).getX() > tgc.getX()) { + break; + } + } + // added at index i + actors.add(i, tgc); + } + } + + //TraceManager.addDev("Adding instances to last SD Step 3 nb of actors = " + actors.size()); + + int initX = 100; + int initY = 100; + int stepX = 150; + ui.sd2.SDInstance sdi; + boolean systemAdded = false; + // Add actors (and the system) + for(TGComponent elt: actors) { + if (elt.getX() > middleX && !systemAdded) { + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi.setValue(systemName); + sdi.setActor(false); + panel.addComponent(sdi, initX, initY, false, true); + initX += stepX; + systemAdded = true; + } + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi.setValue(elt.getValue()); + sdi.setActor(true); + panel.addComponent(sdi, initX, initY, false, true); + initX += stepX; + } + + if (!systemAdded) { + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi.setValue(systemName); + sdi.setActor(false); + panel.addComponent(sdi, initX, initY, false, true); + initX += stepX; + systemAdded = true; + } + + while(initX > panel.getMaxX()) { + panel.setMaxX(panel.getMaxX() + panel.getIncrement()); + panel.updateSize(); + } + + panel.repaint(); + + TraceManager.addDev("initX = " + initX + " nb of components:" + panel.getComponentList().size()); + } +} diff --git a/src/ui/AvatarAnalysisPanel.java b/src/ui/AvatarAnalysisPanel.java index 8182f2dbe2cee253df70c4a6d5409befc86554ef..a286eb445bc674f285daf58ab507f93357b01af2 100755 --- a/src/ui/AvatarAnalysisPanel.java +++ b/src/ui/AvatarAnalysisPanel.java @@ -53,6 +53,7 @@ import java.util.*; import ui.iod.*; import ui.sd.*; +import ui.sd2.*; import ui.ucd.*; import ui.avatarcd.*; import ui.avatarad.*; @@ -74,38 +75,16 @@ public class AvatarAnalysisPanel extends TURTLEPanel { public void init() { mgui.changeMade(null, TDiagramPanel.NEW_COMPONENT); - /*// Class Diagram toolbar - InteractionOverviewDiagramToolBar toolBarIOD = new InteractionOverviewDiagramToolBar(mgui); - toolbars.add(toolBarIOD); - - toolBarPanel = new JPanel(); - toolBarPanel.setLayout(new BorderLayout()); - - //Class diagram - iodp = new InteractionOverviewDiagramPanel(mgui, toolBarIOD); - iodp.setName("Interaction Overview Diagram"); - iodp.tp = this; - tdp = iodp; - panels.add(iodp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); - iodp.jsp = jsp; - jsp.setWheelScrollingEnabled(true); - jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); - toolBarPanel.add(toolBarIOD, BorderLayout.NORTH); - toolBarPanel.add(jsp, BorderLayout.CENTER); - tabbedPane.addTab("Interaction Overview Diagram", IconManager.imgic17, toolBarPanel, "Opens interaction overview diagram"); - tabbedPane.setSelectedIndex(0); */ - //jsp.setVisible(true); } public boolean addSequenceDiagram(String s) { JPanel toolBarPanel = new JPanel(); toolBarPanel.setLayout(new BorderLayout()); - SequenceDiagramToolBar toolBarSequence = new SequenceDiagramToolBar(mgui); + ui.sd.SequenceDiagramToolBar toolBarSequence = new ui.sd.SequenceDiagramToolBar(mgui); toolbars.add(toolBarSequence); - SequenceDiagramPanel sdp = new SequenceDiagramPanel(mgui, toolBarSequence); + ui.sd.SequenceDiagramPanel sdp = new ui.sd.SequenceDiagramPanel(mgui, toolBarSequence); sdp.setName(s); sdp.tp = this; panels.add(sdp); @@ -125,29 +104,33 @@ public class AvatarAnalysisPanel extends TURTLEPanel { } - /*public boolean addIODiagram(String s) { - InteractionOverviewDiagramToolBar toolBarIOD = new InteractionOverviewDiagramToolBar(mgui); - toolbars.add(toolBarIOD); + public boolean addSequenceDiagramZV(String s) { + JPanel toolBarPanel = new JPanel(); + toolBarPanel.setLayout(new BorderLayout()); + + ui.sd2.SequenceDiagramToolBar toolBarSequence = new ui.sd2.SequenceDiagramToolBar(mgui); + toolbars.add(toolBarSequence); - toolBarPanel = new JPanel(); - toolBarPanel.setLayout(new BorderLayout()); + ui.sd2.SequenceDiagramPanel sdp = new ui.sd2.SequenceDiagramPanel(mgui, toolBarSequence); + sdp.setName(s); + sdp.tp = this; + panels.add(sdp); + JScrollDiagramPanel jsp = new JScrollDiagramPanel(sdp); + sdp.jsp = jsp; + jsp.setWheelScrollingEnabled(true); + jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); + toolBarPanel.add(toolBarSequence, BorderLayout.NORTH); + toolBarPanel.add(jsp, BorderLayout.CENTER); + tabbedPane.addTab(s, IconManager.imgic18, toolBarPanel, "Open the sequence diagram of " + s); + //tabbedPane.setVisible(true); + //sdp.setVisible(true); + //jsp.setVisible(true); + //tabbedPane.setSelectedIndex(panels.size()-1); - iodp = new InteractionOverviewDiagramPanel(mgui, toolBarIOD); - iodp.setName(s); - iodp.tp = this; - tdp = iodp; - panels.add(iodp); - JScrollDiagramPanel jsp = new JScrollDiagramPanel(iodp); - iodp.jsp = jsp; - jsp.setWheelScrollingEnabled(true); - jsp.getVerticalScrollBar().setUnitIncrement(mgui.INCREMENT); - toolBarPanel.add(toolBarIOD, BorderLayout.NORTH); - toolBarPanel.add(jsp, BorderLayout.CENTER); - tabbedPane.addTab(s, IconManager.imgic17, toolBarPanel, "Opens interaction overview diagram"); + return true; - return true; + } - }*/ public boolean addUseCaseDiagram(String s) { JPanel toolBarPanel = new JPanel(); @@ -261,14 +244,14 @@ public class AvatarAnalysisPanel extends TURTLEPanel { } public boolean canFirstDiagramBeMoved() { - return true; + return true; } public void addInstancesToLastSD(UseCaseDiagramPanel _ucdp) { TraceManager.addDev("Adding instances to last SD"); TDiagramPanel panel = (TDiagramPanel)(panels.get(panels.size()-1)); - if (!(panel instanceof SequenceDiagramPanel)) { + if (!(panel instanceof ui.sd2.SequenceDiagramPanel)) { return; } @@ -321,12 +304,12 @@ public class AvatarAnalysisPanel extends TURTLEPanel { int initX = 100; int initY = 100; int stepX = 150; - SDInstance sdi; + ui.sd2.SDInstance sdi; boolean systemAdded = false; // Add actors (and the system) for(TGComponent elt: actors) { if (elt.getX() > middleX && !systemAdded) { - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SDZV_INSTANCE, panel)); sdi.setValue(systemName); sdi.setName(systemName); sdi.setActor(false); @@ -334,7 +317,7 @@ public class AvatarAnalysisPanel extends TURTLEPanel { initX += stepX; systemAdded = true; } - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SDZV_INSTANCE, panel)); sdi.setValue(elt.getValue()); sdi.setName(elt.getValue()); sdi.setActor(true); @@ -343,7 +326,7 @@ public class AvatarAnalysisPanel extends TURTLEPanel { } if (!systemAdded) { - sdi = (SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SD_INSTANCE, panel)); + sdi = (ui.sd2.SDInstance)(TGComponentManager.addComponent(initX, initY, TGComponentManager.SDZV_INSTANCE, panel)); sdi.setValue(systemName); sdi.setName(systemName); sdi.setActor(false); diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 898b99e88aaae6bf07481c687b928375b4759d85..82960c20b75e740acde1800ba1cd171e8140c1c0 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -202,7 +202,8 @@ import ui.procsd.ProactiveCSDPanel; import ui.prosmd.ProactiveSMDPanel; import ui.req.Requirement; import ui.req.RequirementDiagramPanel; -import ui.sd.SequenceDiagramPanel; +import ui.sd.*; +import ui.sd2.*; import ui.sysmlsecmethodology.SysmlsecMethodologyDiagramPanel; import ui.tmlad.TGConnectorTMLAD; import ui.tmlad.TMLADDecrypt; @@ -4505,7 +4506,7 @@ public class GTURTLEModeling { makePostLoading(iodp, beginIndex); } } - } else if (tdp instanceof SequenceDiagramPanel) { + } else if (tdp instanceof ui.sd.SequenceDiagramPanel) { //TraceManager.addDev("Sequence diagram!"); nl = doc.getElementsByTagName("SequenceDiagramPanelCopy"); @@ -4513,7 +4514,7 @@ public class GTURTLEModeling { return; } - SequenceDiagramPanel sdp = (SequenceDiagramPanel)tdp; + ui.sd.SequenceDiagramPanel sdp = (ui.sd.SequenceDiagramPanel)tdp; //TraceManager.addDev("Sequence diagram!"); @@ -4547,6 +4548,49 @@ public class GTURTLEModeling { makePostLoading(sdp, beginIndex); } } + } else if (tdp instanceof ui.sd2.SequenceDiagramPanel) { + //TraceManager.addDev("Sequence diagram!"); + nl = doc.getElementsByTagName("SequenceDiagramPanelCopy"); + + if (nl == null) { + return; + } + + ui.sd2.SequenceDiagramPanel sdp = (ui.sd2.SequenceDiagramPanel)tdp; + + //TraceManager.addDev("Sequence diagram!"); + + for(i=0; i<nl.getLength(); i++) { + adn = nl.item(i); + if (adn.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) adn; + + if (sdp == null) { + throw new MalformedModelingException(); + } + + //int xSel = Integer.decode(elt.getAttribute("xSel")).intValue(); + //int ySel = Integer.decode(elt.getAttribute("ySel")).intValue(); + //int widthSel = Integer.decode(elt.getAttribute("widthSel")).intValue(); + //int heightSel = Integer.decode(elt.getAttribute("heightSel")).intValue(); + + decX = _decX; + decY = _decY; + + //TraceManager.addDev("Sequence diagram: " + sdp.getName() + " components"); + makeXMLComponents(elt.getElementsByTagName("COMPONENT"), sdp); + //TraceManager.addDev("Sequence diagram: " + sdp.getName() + " connectors"); + makeXMLConnectors(elt.getElementsByTagName("CONNECTOR"), sdp); + //TraceManager.addDev("Sequence diagram: " + sdp.getName() + " subcomponents"); + makeXMLComponents(elt.getElementsByTagName("SUBCOMPONENT"), sdp); + //TraceManager.addDev("Sequence diagram: " + sdp.getName() + " real points"); + connectConnectorsToRealPoints(sdp); + sdp.structureChanged(); + //TraceManager.addDev("Sequence diagram: " + sdp.getName() + " post loading"); + makePostLoading(sdp, beginIndex); + } + } + } else if (tdp instanceof UseCaseDiagramPanel) { nl = doc.getElementsByTagName("UseCaseDiagramPanelCopy"); @@ -6158,7 +6202,10 @@ public class GTURTLEModeling { if (elt.getTagName().compareTo("SequenceDiagramPanel") == 0) { loadSequenceDiagram(elt, indexAnalysis); cpt ++; - } else if (elt.getTagName().compareTo("UseCaseDiagramPanel") == 0) { + } else if (elt.getTagName().compareTo("SequenceDiagramPanelZV") == 0) { + loadSequenceDiagramZV(elt, indexAnalysis); + cpt ++; + } else if (elt.getTagName().compareTo("UseCaseDiagramPanel") == 0) { // Managing use case diagrams loadUseCaseDiagram(elt, indexAnalysis, cpt); cpt ++; @@ -6234,6 +6281,11 @@ public class GTURTLEModeling { loadSequenceDiagram(elt, indexAnalysis); //TraceManager.addDev("Loading seq diag done"); cpt ++; + } else if (elt.getTagName().compareTo("SequenceDiagramPanelZV") == 0) { + //TraceManager.addDev("Loading seq diag"); + loadSequenceDiagramZV(elt, indexAnalysis); + //TraceManager.addDev("Loading seq diag done"); + cpt ++; } else if (elt.getTagName().compareTo("UseCaseDiagramPanel") == 0) { // Managing use case diagrams //TraceManager.addDev("Loading ucd diag"); @@ -7164,7 +7216,30 @@ public class GTURTLEModeling { mgui.createSequenceDiagram(indexAnalysis, name); } //TraceManager.addDev("Loading seq diag1"); - SequenceDiagramPanel sdp = mgui.getSequenceDiagramPanel(indexAnalysis, name); + ui.sd.SequenceDiagramPanel sdp = mgui.getSequenceDiagramPanel(indexAnalysis, name); + //TraceManager.addDev("Loading seq diag2"); + + if (sdp == null) { + throw new MalformedModelingException(); + } + //TraceManager.addDev("Loading seq diag3"); + + sdp.removeAll(); + //TraceManager.addDev("Loading seq diag4"); + + loadDiagram(elt, sdp); + //TraceManager.addDev("Loading seq diag5"); + } + + public void loadSequenceDiagramZV(Element elt, int indexAnalysis) throws MalformedModelingException, SAXException { + String name; + + name = elt.getAttribute("name"); + if (!(mgui.isSDZVCreated(indexAnalysis, name))) { + mgui.createSequenceDiagramZV(indexAnalysis, name); + } + //TraceManager.addDev("Loading seq diag1"); + ui.sd2.SequenceDiagramPanel sdp = mgui.getSequenceDiagramPanelZV(indexAnalysis, name); //TraceManager.addDev("Loading seq diag2"); if (sdp == null) { diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java index 8d01ebab4cde20902dc95ce6b31ae424b1b48d88..805c5a1ba69a91567ca6cd341ccbf89cd391c48d 100644 --- a/src/ui/MainGUI.java +++ b/src/ui/MainGUI.java @@ -151,7 +151,8 @@ import ui.osad.TURTLEOSActivityDiagramPanel; import ui.prosmd.ProactiveSMDPanel; import ui.req.Requirement; import ui.req.RequirementDiagramPanel; -import ui.sd.SequenceDiagramPanel; +import ui.sd.*; +import ui.sd2.*; import ui.tmlad.TMLActivityDiagramPanel; import ui.tmlcd.TMLTaskDiagramPanel; import ui.tmlcompd.TMLCCompositeComponent; @@ -5693,7 +5694,19 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe if (index == -1) { return false; } - return (tp.panelAt(index) instanceof SequenceDiagramPanel); + return (tp.panelAt(index) instanceof ui.sd.SequenceDiagramPanel); + } + + public boolean isSDZVCreated(int index, String s) { + return isSDZVCreated(((TURTLEPanel) (tabs.elementAt(index))), s); + } + + public boolean isSDZVCreated(TURTLEPanel tp, String s) { + int index = tp.tabbedPane.indexOfTab(s); + if (index == -1) { + return false; + } + return (tp.panelAt(index) instanceof ui.sd2.SequenceDiagramPanel); } public boolean isUseCaseDiagramCreated(TURTLEPanel tp, String s) { @@ -5745,6 +5758,15 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return false; } + public boolean openSequenceDiagramZV(String s) { + int index = getCurrentJTabbedPane().indexOfTab(s); + if (index > -1) { + getCurrentJTabbedPane().setSelectedIndex(index); + return true; + } + return false; + } + public boolean openIODiagram(String s) { int index = getCurrentJTabbedPane().indexOfTab(s); if (index > -1) { @@ -5754,6 +5776,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return false; } + // TMLCP public boolean openTMLCPSequenceDiagram(String s) { int index = getCurrentJTabbedPane().indexOfTab(s); if (index > -1) { @@ -5773,9 +5796,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe } - - // TMLCP - public boolean createTMLCPSequenceDiagram(int index, String s) { return createTMLCPSequenceDiagram((TURTLEPanel) (tabs.elementAt(index)), s); } @@ -5796,7 +5816,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return true; } - public boolean createUniqueTMLCPSequenceDiagram(TURTLEPanel tp, String s) { int i; for(i=0; i<1000; i++) { @@ -5811,9 +5830,6 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return true; } - - - public boolean createTMLCPDiagram(int index, String s) { return createTMLCPDiagram((TURTLEPanel) (tabs.elementAt(index)), s); } @@ -5835,12 +5851,20 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe // End of TMLCP - public SequenceDiagramPanel getSequenceDiagramPanel(int index, String s) { + public ui.sd.SequenceDiagramPanel getSequenceDiagramPanel(int index, String s) { //TraceManager.addDev("Searching for " + s); TURTLEPanel tp = (TURTLEPanel)(tabs.elementAt(index)); return getSequenceDiagramPanel(tp, s); } + + public ui.sd2.SequenceDiagramPanel getSequenceDiagramPanelZV(int index, String s) { + //TraceManager.addDev("Searching for " + s); + TURTLEPanel tp = (TURTLEPanel)(tabs.elementAt(index)); + return getSequenceDiagramPanelZV(tp, s); + } + + public AttackTreeDiagramPanel getAttackTreeDiagramPanel(int index, int indexTab, String s) { //TraceManager.addDev("Searching for " + s); TURTLEPanel tp = (TURTLEPanel)(tabs.elementAt(index)); @@ -5900,11 +5924,21 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe return getIODiagramPanel(tp, s); } - public SequenceDiagramPanel getSequenceDiagramPanel(TURTLEPanel tp, String s) { + public ui.sd.SequenceDiagramPanel getSequenceDiagramPanel(TURTLEPanel tp, String s) { + for(int i=0; i<tp.tabbedPane.getTabCount(); i++) { + if (tp.tabbedPane.getTitleAt(i).equals(s)) { + if (tp.panelAt(i) instanceof ui.sd.SequenceDiagramPanel) + return (ui.sd.SequenceDiagramPanel)(tp.panelAt(i)); + } + } + return null; + } + + public ui.sd2.SequenceDiagramPanel getSequenceDiagramPanelZV(TURTLEPanel tp, String s) { for(int i=0; i<tp.tabbedPane.getTabCount(); i++) { if (tp.tabbedPane.getTitleAt(i).equals(s)) { - if (tp.panelAt(i) instanceof SequenceDiagramPanel) - return (SequenceDiagramPanel)(tp.panelAt(i)); + if (tp.panelAt(i) instanceof ui.sd2.SequenceDiagramPanel) + return (ui.sd2.SequenceDiagramPanel)(tp.panelAt(i)); } } return null; @@ -5954,8 +5988,28 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe setPanelMode(); return true; } + public boolean createSequenceDiagramZV(int index, String s) { + return createSequenceDiagramZV((TURTLEPanel)(tabs.elementAt(index)), s); + } + public boolean createSequenceDiagramZV(TURTLEPanel tp, String s) { + if(isSDCreated(tp, s)) { + return false; + } + if (!((tp instanceof AnalysisPanel) || (tp instanceof AvatarAnalysisPanel))) { + return false; + } + + if (tp instanceof AnalysisPanel) { + ((AnalysisPanel)tp).addSequenceDiagramZV(s); + } else if (tp instanceof AvatarAnalysisPanel) { + ((AvatarAnalysisPanel)tp).addSequenceDiagramZV(s); + } + setPanelMode(); + return true; + } + public boolean createUniqueSequenceDiagram(TURTLEPanel tp, String s) { int i; for(i=0; i<1000; i++) { @@ -5973,9 +6027,28 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe setPanelMode(); return true; } + + + public boolean createUniqueSequenceDiagramZV(TURTLEPanel tp, String s) { + int i; + for(i=0; i<1000; i++) { + if(!isSDCreated(tp, s+i)) { + break; + } + } + + if (tp instanceof AnalysisPanel) { + ((AnalysisPanel)tp).addSequenceDiagramZV(s+i); + } else if (tp instanceof AvatarAnalysisPanel) { + ((AvatarAnalysisPanel)tp).addSequenceDiagramZV(s+i); + } + + setPanelMode(); + return true; + } public boolean createSequenceDiagramFromUCD(TURTLEPanel tp, String s, UseCaseDiagramPanel _ucdp) { - if (!createUniqueSequenceDiagram(tp, s)) { + if (!createUniqueSequenceDiagramZV(tp, s)) { return false; } @@ -6462,8 +6535,14 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe public void alignInstances() { //TraceManager.addDev("Align instances"); - if (getCurrentTDiagramPanel() instanceof SequenceDiagramPanel) { - ((SequenceDiagramPanel)(getCurrentTDiagramPanel())).alignInstances(); + if (getCurrentTDiagramPanel() instanceof ui.sd.SequenceDiagramPanel) { + ((ui.sd.SequenceDiagramPanel)(getCurrentTDiagramPanel())).alignInstances(); + changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT); + getCurrentTDiagramPanel().repaint(); + } + + if (getCurrentTDiagramPanel() instanceof ui.sd2.SequenceDiagramPanel) { + ((ui.sd2.SequenceDiagramPanel)(getCurrentTDiagramPanel())).alignInstances(); changeMade(getCurrentTDiagramPanel(), TDiagramPanel.MOVE_COMPONENT); getCurrentTDiagramPanel().repaint(); } @@ -6475,6 +6554,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe } } + public void alignPartitions() { //TraceManager.addDev("Align instances"); if (getCurrentTDiagramPanel() instanceof AvatarADPanel) { diff --git a/src/ui/TDiagramPanel.java b/src/ui/TDiagramPanel.java index a069a406196f4181fa0d96954d7234913abc643a..8d715967bcf9ff6d6556c03fd542254de6f1f933 100755 --- a/src/ui/TDiagramPanel.java +++ b/src/ui/TDiagramPanel.java @@ -899,6 +899,7 @@ public abstract class TDiagramPanel extends JPanel implements GenericTree { public TGComponent addComponent(int x, int y, int id, boolean swallow) { TGComponent tgc = TGComponentManager.addComponent(x, y, id, this); addComponent(tgc, x, y, swallow, true); + return tgc; } diff --git a/src/ui/TGComponentManager.java b/src/ui/TGComponentManager.java index ee8c2639d63817c1bdd3a7b30adec1740527d2f1..31ba78ff195f7a07d0537bbd667e71eebb7eccc6 100755 --- a/src/ui/TGComponentManager.java +++ b/src/ui/TGComponentManager.java @@ -56,6 +56,7 @@ import ui.cd.*; import ui.dd.*; import ui.iod.*; import ui.sd.*; +import ui.sd2.*; import ui.ucd.*; import ui.req.*; @@ -156,6 +157,10 @@ public class TGComponentManager { public static final int ATD_COMPOSITION_CONNECTOR = 132; public static final int ATD_ATTACK_CONNECTOR = 133; + public static final int CONNECTOR_MESSAGE_ASYNC_SDZV = 134; + public static final int CONNECTOR_MESSAGE_SYNC_SDZV = 135; + public static final int CONNECTOR_RELATIVE_TIME_SDZV = 136; + public static final int TCD_TCLASS = 201; public static final int TCD_PARALLEL_OPERATOR = 202; public static final int TCD_SEQUENCE_OPERATOR = 203; @@ -192,7 +197,19 @@ public class TGComponentManager { public static final int SD_TIMER_EXPIRATION = 605; public static final int SD_TIME_INTERVAL = 608; public static final int SD_COREGION = 600; - public static final int SD_PORT_MESSAGE = 610; + + + public static final int SDZV_INSTANCE = 620; + public static final int SDZV_ABSOLUTE_TIME_CONSTRAINT = 621; + public static final int SDZV_RELATIVE_TIME_CONSTRAINT = 622; + public static final int SDZV_ACTION_STATE = 623; + public static final int SDZV_GUARD = 624; + public static final int SDZV_TIMER_SETTING = 625; + public static final int SDZV_TIMER_CANCELLATION = 626; + public static final int SDZV_TIMER_EXPIRATION = 627; + public static final int SDZV_TIME_INTERVAL = 628; + public static final int SDZV_COREGION = 629; + public static final int SDZV_PORT_MESSAGE = 630; public static final int UCD_ACTOR = 700; public static final int UCD_ACTORBOX = 703; @@ -867,38 +884,70 @@ public class TGComponentManager { tgc = new IODSequence(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_INSTANCE: - tgc = new SDInstance(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); - break; - case SD_PORT_MESSAGE: - tgc = new SDPortForMessage(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDInstance(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_ABSOLUTE_TIME_CONSTRAINT: - tgc = new SDAbsoluteTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDAbsoluteTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_RELATIVE_TIME_CONSTRAINT: - tgc = new SDRelativeTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDRelativeTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_ACTION_STATE: - tgc = new SDActionState(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDActionState(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_GUARD: - tgc = new SDGuard(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDGuard(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_TIME_INTERVAL: - tgc = new SDTimeInterval(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDTimeInterval(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_TIMER_SETTING: - tgc = new SDTimerSetting(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDTimerSetting(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_TIMER_EXPIRATION: - tgc = new SDTimerExpiration(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDTimerExpiration(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_TIMER_CANCELLATION: - tgc = new SDTimerCancellation(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDTimerCancellation(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case SD_COREGION: - tgc = new SDCoregion(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + tgc = new ui.sd.SDCoregion(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + + case SDZV_INSTANCE: + tgc = new ui.sd2.SDInstance(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_PORT_MESSAGE: + tgc = new ui.sd2.SDPortForMessage(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_ABSOLUTE_TIME_CONSTRAINT: + tgc = new ui.sd2.SDAbsoluteTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_RELATIVE_TIME_CONSTRAINT: + tgc = new ui.sd2.SDRelativeTimeConstraint(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_ACTION_STATE: + tgc = new ui.sd2.SDActionState(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_GUARD: + tgc = new ui.sd2.SDGuard(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_TIME_INTERVAL: + tgc = new ui.sd2.SDTimeInterval(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_TIMER_SETTING: + tgc = new ui.sd2.SDTimerSetting(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; + case SDZV_TIMER_EXPIRATION: + tgc = new ui.sd2.SDTimerExpiration(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_TIMER_CANCELLATION: + tgc = new ui.sd2.SDTimerCancellation(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case SDZV_COREGION: + tgc = new ui.sd2.SDCoregion(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case UCD_ACTOR: tgc = new UCDActor(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; @@ -1595,34 +1644,62 @@ public class TGComponentManager { return IOD_PREEMPTION; } else if (tgc instanceof IODSequence) { return IOD_SEQUENCE; - } else if (tgc instanceof TGConnectorMessageAsyncSD) { + } else if (tgc instanceof ui.sd.TGConnectorMessageAsyncSD) { return CONNECTOR_MESSAGE_ASYNC_SD; - } else if (tgc instanceof TGConnectorMessageSyncSD) { + } else if (tgc instanceof ui.sd.TGConnectorMessageSyncSD) { return CONNECTOR_MESSAGE_SYNC_SD; - } else if (tgc instanceof TGConnectorRelativeTimeSD) { + } else if (tgc instanceof ui.sd.TGConnectorRelativeTimeSD) { return CONNECTOR_RELATIVE_TIME_SD; - } else if (tgc instanceof SDInstance) { + } else if (tgc instanceof ui.sd.SDInstance) { return SD_INSTANCE; - } else if (tgc instanceof SDPortForMessage) { - return SD_PORT_MESSAGE; - } else if (tgc instanceof SDAbsoluteTimeConstraint) { + } else if (tgc instanceof ui.sd.SDAbsoluteTimeConstraint) { return SD_ABSOLUTE_TIME_CONSTRAINT; - } else if (tgc instanceof SDRelativeTimeConstraint) { + } else if (tgc instanceof ui.sd.SDRelativeTimeConstraint) { return SD_RELATIVE_TIME_CONSTRAINT; - } else if (tgc instanceof SDActionState) { + } else if (tgc instanceof ui.sd.SDActionState) { return SD_ACTION_STATE; - } else if (tgc instanceof SDGuard) { + } else if (tgc instanceof ui.sd.SDGuard) { return SD_GUARD; - } else if (tgc instanceof SDTimeInterval) { + } else if (tgc instanceof ui.sd.SDTimeInterval) { return SD_TIME_INTERVAL; - } else if (tgc instanceof SDTimerSetting) { + } else if (tgc instanceof ui.sd.SDTimerSetting) { return SD_TIMER_SETTING; - } else if (tgc instanceof SDTimerExpiration) { + } else if (tgc instanceof ui.sd.SDTimerExpiration) { return SD_TIMER_EXPIRATION; - } else if (tgc instanceof SDTimerCancellation) { + } else if (tgc instanceof ui.sd.SDTimerCancellation) { return SD_TIMER_CANCELLATION; - } else if (tgc instanceof SDCoregion) { + } else if (tgc instanceof ui.sd.SDCoregion) { return SD_COREGION; + + } else if (tgc instanceof ui.sd2.TGConnectorMessageAsyncSD) { + return CONNECTOR_MESSAGE_ASYNC_SDZV; + } else if (tgc instanceof ui.sd2.TGConnectorMessageSyncSD) { + return CONNECTOR_MESSAGE_SYNC_SDZV; + } else if (tgc instanceof ui.sd2.TGConnectorRelativeTimeSD) { + return CONNECTOR_RELATIVE_TIME_SDZV; + } else if (tgc instanceof ui.sd2.SDInstance) { + return SDZV_INSTANCE; + } else if (tgc instanceof ui.sd2.SDPortForMessage) { + return SDZV_PORT_MESSAGE; + } else if (tgc instanceof ui.sd2.SDAbsoluteTimeConstraint) { + return SDZV_ABSOLUTE_TIME_CONSTRAINT; + } else if (tgc instanceof ui.sd2.SDRelativeTimeConstraint) { + return SDZV_RELATIVE_TIME_CONSTRAINT; + } else if (tgc instanceof ui.sd2.SDActionState) { + return SDZV_ACTION_STATE; + } else if (tgc instanceof ui.sd2.SDGuard) { + return SDZV_GUARD; + } else if (tgc instanceof ui.sd2.SDTimeInterval) { + return SDZV_TIME_INTERVAL; + } else if (tgc instanceof ui.sd2.SDTimerSetting) { + return SDZV_TIMER_SETTING; + } else if (tgc instanceof ui.sd2.SDTimerExpiration) { + return SDZV_TIMER_EXPIRATION; + } else if (tgc instanceof ui.sd2.SDTimerCancellation) { + return SDZV_TIMER_CANCELLATION; + } else if (tgc instanceof ui.sd2.SDCoregion) { + return SDZV_COREGION; + } else if (tgc instanceof UCDActor) { return UCD_ACTOR; } else if (tgc instanceof UCDActorBox) { @@ -2066,17 +2143,30 @@ public class TGComponentManager { //System.out.println("Connector interaction"); break; case CONNECTOR_MESSAGE_ASYNC_SD: - tgc = new TGConnectorMessageAsyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + tgc = new ui.sd.TGConnectorMessageAsyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); //System.out.println("Connector interaction"); break; case CONNECTOR_MESSAGE_SYNC_SD: - tgc = new TGConnectorMessageSyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + tgc = new ui.sd.TGConnectorMessageSyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); //System.out.println("Connector interaction"); break; case CONNECTOR_RELATIVE_TIME_SD: - tgc = new TGConnectorRelativeTimeSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + tgc = new ui.sd.TGConnectorRelativeTimeSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + //System.out.println("Connector interaction"); + break; + case CONNECTOR_MESSAGE_ASYNC_SDZV: + tgc = new ui.sd2.TGConnectorMessageAsyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + //System.out.println("Connector interaction"); + break; + case CONNECTOR_MESSAGE_SYNC_SDZV: + tgc = new ui.sd2.TGConnectorMessageSyncSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); + //System.out.println("Connector interaction"); + break; + case CONNECTOR_RELATIVE_TIME_SDZV: + tgc = new ui.sd2.TGConnectorRelativeTimeSD(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); //System.out.println("Connector interaction"); break; + case CONNECTOR_ACTOR_UCD: tgc = new TGConnectorUseCase(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); break; diff --git a/src/ui/TGUIAction.java b/src/ui/TGUIAction.java index 8459f744b456980fe4aa5a0f8bf98ffcabd83b5f..b307ddaa2d06e85f90e0826e77836e046ecc2ba0 100755 --- a/src/ui/TGUIAction.java +++ b/src/ui/TGUIAction.java @@ -147,6 +147,23 @@ public class TGUIAction extends AbstractAction { public static final int SD_COREGION = 96; public static final int SD_ALIGN_INSTANCES = 97; + public static final int SDZV_EDIT = 440; + public static final int SDZV_INSTANCE = 441; + public static final int SDZV_CONNECTOR_MESSAGE_ASYNC = 442; + public static final int SDZV_CONNECTOR_MESSAGE_SYNC = 443; + public static final int SDZV_ABSOLUTE_TIME_CONSTRAINT = 444; + public static final int SDZV_TIME_INTERVAL = 445; + public static final int SDZV_RELATIVE_TIME_CONSTRAINT = 446; + public static final int SDZV_RELATIVE_TIME_CONSTRAINT_CONNECTOR = 447; + public static final int SDZV_ACTION_STATE = 448; + public static final int SDZV_GUARD = 449; + public static final int SDZV_TIMER_SETTING = 450; + public static final int SDZV_TIMER_EXPIRATION = 451; + public static final int SDZV_TIMER_CANCELLATION = 452; + public static final int SDZV_COREGION = 453; + public static final int SDZV_ALIGN_INSTANCES = 454; + + public static final int UCD_EDIT = 104; public static final int UCD_ACTOR = 105; public static final int UCD_ACTORBOX = 333; @@ -582,7 +599,7 @@ public class TGUIAction extends AbstractAction { public static final int ACT_INTERNAL_SEARCH = 415; //-- - public static final int NB_ACTION = 440; + public static final int NB_ACTION = 455; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -862,6 +879,22 @@ public class TGUIAction extends AbstractAction { actions[SD_COREGION] = new TAction("add-sd-coregion", "Coregion", IconManager.imgic520, IconManager.imgic520, "Coregion", "Add a coregion to the currently opened sequence diagram", 0); actions[SD_ALIGN_INSTANCES] = new TAction("add-sd-align_instances", "Align instances", IconManager.imgic522, IconManager.imgic522, "Align instances", "align instances of the currently opened sequence diagram", 0); + actions[SDZV_EDIT] = new TAction("edit-sdzv-diagram", "Edit sequence diagram", IconManager.imgic100, IconManager.imgic101, "Edit sequence diagram", "Make it possible to edit the currently opened sequence diagram", 0); + actions[SDZV_INSTANCE] = new TAction("add-sdzv-instance", "Add an instance", IconManager.imgic500, IconManager.imgic500, "Instance", "Add a new instance to the currently opened sequence diagram", 0); + actions[SDZV_CONNECTOR_MESSAGE_ASYNC] = new TAction("add-sdzv-connector-message-async", "Add asynchronous message", IconManager.imgic504, IconManager.imgic504, "Asynchronous message", "Add an asynchronous message between two instances of the currently opened sequence diagram", 0); + actions[SDZV_CONNECTOR_MESSAGE_SYNC] = new TAction("add-sdzv-connector-message-sync", "Add synchronous message", IconManager.imgic502, IconManager.imgic502, "Synchronous message", "Add an synchronous message between two instances of the currently opened sequence diagram", 0); + actions[SDZV_ABSOLUTE_TIME_CONSTRAINT] = new TAction("add-sdzv-atc", "Absolute time constraint", IconManager.imgic506, IconManager.imgic506, "Absolute time constraint", "Add an absolute time constraint to the currently opened sequence diagram", 0); + actions[SDZV_RELATIVE_TIME_CONSTRAINT] = new TAction("add-sdzv-rtc", "Relative time constraint", IconManager.imgic508, IconManager.imgic508, "Relative time constraint", "Add a relative time constraint to the currently opened sequence diagram", 0); + actions[SDZV_RELATIVE_TIME_CONSTRAINT_CONNECTOR] = new TAction("add-sdzv-rtc-c", "Connect two relative time constraint lines", IconManager.imgic510, IconManager.imgic510, "Relative time constraint connector", "Add a connection between two relative time constraint lines of the currently opened sequence diagram", 0); + actions[SDZV_ACTION_STATE] = new TAction("add-sdzv-action-state", "Action state", IconManager.imgic512, IconManager.imgic512, "Action state", "Add an action state to the currently opened sequence diagram", 0); + actions[SDZV_GUARD] = new TAction("add-sdzv-guard", "Guard", IconManager.imgic524, IconManager.imgic524, "Guard", "Add a guard (non-deterministic, else, end) to the currently opened sequence diagram", 0); + actions[SDZV_TIMER_SETTING] = new TAction("add-sdzv-timer-set-state", "Timer setting", IconManager.imgic514, IconManager.imgic514, "Timer setting", "Add a timer setting to the currently opened sequence diagram", 0); + actions[SDZV_TIME_INTERVAL] = new TAction("add-sdzv-time-interval", "Time interval", IconManager.imgic224, IconManager.imgic224, "Time interval", "Add a time interval to the currently opened sequence diagram", 0); + actions[SDZV_TIMER_EXPIRATION] = new TAction("add-sdzv-timer-expiration-state", "Timer expiration", IconManager.imgic516, IconManager.imgic516, "Timer expiration", "Add a timer expiration to the currently opened sequence diagram", 0); + actions[SDZV_TIMER_CANCELLATION] = new TAction("add-sdzv-timer-cancellation-state", "Timer cancellation", IconManager.imgic518, IconManager.imgic518, "Timer cancellation", "Add a timer cancellation to the currently opened sequence diagram", 0); + actions[SDZV_COREGION] = new TAction("add-sdzv-coregion", "Coregion", IconManager.imgic520, IconManager.imgic520, "Coregion", "Add a coregion to the currently opened sequence diagram", 0); + actions[SDZV_ALIGN_INSTANCES] = new TAction("add-sdzv-align_instances", "Align instances", IconManager.imgic522, IconManager.imgic522, "Align instances", "align instances of the currently opened sequence diagram", 0); + actions[UCD_EDIT] = new TAction("edit-ucd-diagram", "Edit use case diagram", IconManager.imgic100, IconManager.imgic101, "Edit use case diagram", "Make it possible to edit the currently opened use case diagram", 0); actions[UCD_ACTOR] = new TAction("add-actor", "Add an actor", IconManager.imgic600, IconManager.imgic600, "Actor", "Add an actor to the currently opened use case diagram", 0); actions[UCD_ACTORBOX] = new TAction("add-actor-box", "Add an actor (box format)", IconManager.imgic614, IconManager.imgic614, "Actor (box format)", "Add an actor in box format to the currently opened use case diagram", 0); diff --git a/src/ui/TURTLEPanelPopupListener.java b/src/ui/TURTLEPanelPopupListener.java index 4d6a52872359a5319fa01daef96887560886eaf4..f1906a26c08647bfadca72672371ea402d79b195 100755 --- a/src/ui/TURTLEPanelPopupListener.java +++ b/src/ui/TURTLEPanelPopupListener.java @@ -59,7 +59,7 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t private JPopupMenu menu; protected MainGUI mgui; - private JMenuItem rename, remove, moveRight, moveLeft, sort, newucd, newsd, newsdfromucd, newreq, + private JMenuItem rename, remove, moveRight, moveLeft, sort, newucd, newsd, newsdzv, newsdfromucd, newreq, newebrdd, newprosmd, newavatarrd, newavatarpd, newavatarcd, newavatarad, newavatarmad; private JMenuItem newatd; @@ -94,7 +94,8 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t moveRight = createMenuItem("Move to the right"); sort = createMenuItem("Sort"); newucd = createMenuItem("New Use Case Diagram"); - newsd = createMenuItem("New Sequence Diagram"); + newsd = createMenuItem("New Sequence Diagram (old version)"); + newsdzv = createMenuItem("New Sequence Diagram"); newsdfromucd = createMenuItem("New Sequence Diagram (from Use Case Diagram)"); newreq = createMenuItem("New Requirement Diagram"); newebrdd = createMenuItem("New Event-Based Requirement Description Diagram"); @@ -121,6 +122,8 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t menu.add(newavatarad); } menu.add(newsd); + menu.add(newsdzv); + menu.add(newsdfromucd); menu.addSeparator(); menu.add(newreq); @@ -157,8 +160,8 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t } else { moveRight.setEnabled(false); } - } else { - if (index < 2) { + } else { + if (index < 2) { moveLeft.setEnabled(false); } else { moveLeft.setEnabled(true); @@ -184,6 +187,7 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t newucd.setEnabled(tp.isUCDEnabled()); newsd.setEnabled(tp.isSDEnabled()); + newsdzv.setEnabled(tp.isSDEnabled()); newsdfromucd.setEnabled(tp.isSDEnabled() && (mgui.getCurrentTDiagramPanel() instanceof UseCaseDiagramPanel)); newreq.setEnabled(tp.isReqEnabled()); newebrdd.setEnabled(tp.isReqEnabled()); @@ -198,58 +202,61 @@ public class TURTLEPanelPopupListener extends MouseAdapter /* popup menus onto t private Action listener = new AbstractAction() { - @Override - public void actionPerformed(ActionEvent e) { - JMenuItem item = (JMenuItem)e.getSource(); - String ac = item.getActionCommand(); - if(ac.equals("Rename")) { - tp.requestRenameTab(tp.tabbedPane.getSelectedIndex()); - } else if (ac.equals("Remove")) { - tp.requestRemoveTab(tp.tabbedPane.getSelectedIndex()); - } else if (ac.equals("Move to the left")) { - tp.requestMoveLeftTab(tp.tabbedPane.getSelectedIndex()); - } else if (ac.equals("Move to the right")) { - tp.requestMoveRightTab(tp.tabbedPane.getSelectedIndex()); - } else if (ac.equals("Sort")) { - GraphicLib.sortJTabbedPane(tp.tabbedPane, tp.panels, 1, tp.tabbedPane.getTabCount()); - mgui.changeMade(null, -1); - } else if (ac.equals("New Use Case Diagram")) { - mgui.createUniqueUseCaseDiagram(tp, "Use Case Diagram"); - mgui.changeMade(null, -1); - } else if (ac.equals("New Sequence Diagram")) { - mgui.createUniqueSequenceDiagram(tp, "MyScenario"); - mgui.changeMade(null, -1); - } else if (item == newsdfromucd) { - mgui.createSequenceDiagramFromUCD(tp, "ScenarioFromUCD", (UseCaseDiagramPanel)(mgui.getCurrentTDiagramPanel())); - mgui.changeMade(null, -1); - } else if (ac.equals("New Requirement Diagram")) { - mgui.createRequirementDiagram(tp, "Requirement Diagram"); - mgui.changeMade(null, -1); - } else if (ac.equals("New Attack Tree Diagram")) { - mgui.createAttackTreeDiagram(tp, "Attack Tree"); - mgui.changeMade(null, -1); - } else if (ac.equals("New Event-Based Requirement Description Diagram")) { - mgui.createEBRDD(tp, "EBRDD"); - mgui.changeMade(null, -1); - } else if (ac.equals("New ProActive State Machine Diagram")) { - mgui.createProActiveSMD(tp, "ProActive SMD"); - mgui.changeMade(null, -1); - } else if (e.getSource() == newavatarrd) { - mgui.createAvatarRD(tp, "AVATAR RD"); - mgui.changeMade(null, -1); - } else if (e.getSource() == newavatarpd) { - mgui.createAvatarPD(tp, "AVATAR PD"); - mgui.changeMade(null, -1); - } else if (e.getSource() == newavatarcd) { - mgui.createUniqueAvatarCD(tp, "Context Diagram"); - mgui.changeMade(null, -1); - } else if (e.getSource() == newavatarad) { - mgui.createUniqueAvatarAD(tp, "Activity Diagram"); - mgui.changeMade(null, -1); - } else if (e.getSource() == newavatarmad) { - mgui.createAvatarMAD(tp, "Modeling Assumptions Diagram"); - mgui.changeMade(null, -1); + @Override + public void actionPerformed(ActionEvent e) { + JMenuItem item = (JMenuItem)e.getSource(); + String ac = item.getActionCommand(); + if(ac.equals("Rename")) { + tp.requestRenameTab(tp.tabbedPane.getSelectedIndex()); + } else if (ac.equals("Remove")) { + tp.requestRemoveTab(tp.tabbedPane.getSelectedIndex()); + } else if (ac.equals("Move to the left")) { + tp.requestMoveLeftTab(tp.tabbedPane.getSelectedIndex()); + } else if (ac.equals("Move to the right")) { + tp.requestMoveRightTab(tp.tabbedPane.getSelectedIndex()); + } else if (ac.equals("Sort")) { + GraphicLib.sortJTabbedPane(tp.tabbedPane, tp.panels, 1, tp.tabbedPane.getTabCount()); + mgui.changeMade(null, -1); + } else if (ac.equals("New Use Case Diagram")) { + mgui.createUniqueUseCaseDiagram(tp, "Use Case Diagram"); + mgui.changeMade(null, -1); + } else if (item == newsd) { + mgui.createUniqueSequenceDiagram(tp, "MyScenario"); + mgui.changeMade(null, -1); + } else if (item == newsdzv) { + mgui.createUniqueSequenceDiagramZV(tp, "MyScenario"); + mgui.changeMade(null, -1); + } else if (item == newsdfromucd) { + mgui.createSequenceDiagramFromUCD(tp, "ScenarioFromUCD", (UseCaseDiagramPanel)(mgui.getCurrentTDiagramPanel())); + mgui.changeMade(null, -1); + } else if (ac.equals("New Requirement Diagram")) { + mgui.createRequirementDiagram(tp, "Requirement Diagram"); + mgui.changeMade(null, -1); + } else if (ac.equals("New Attack Tree Diagram")) { + mgui.createAttackTreeDiagram(tp, "Attack Tree"); + mgui.changeMade(null, -1); + } else if (ac.equals("New Event-Based Requirement Description Diagram")) { + mgui.createEBRDD(tp, "EBRDD"); + mgui.changeMade(null, -1); + } else if (ac.equals("New ProActive State Machine Diagram")) { + mgui.createProActiveSMD(tp, "ProActive SMD"); + mgui.changeMade(null, -1); + } else if (e.getSource() == newavatarrd) { + mgui.createAvatarRD(tp, "AVATAR RD"); + mgui.changeMade(null, -1); + } else if (e.getSource() == newavatarpd) { + mgui.createAvatarPD(tp, "AVATAR PD"); + mgui.changeMade(null, -1); + } else if (e.getSource() == newavatarcd) { + mgui.createUniqueAvatarCD(tp, "Context Diagram"); + mgui.changeMade(null, -1); + } else if (e.getSource() == newavatarad) { + mgui.createUniqueAvatarAD(tp, "Activity Diagram"); + mgui.changeMade(null, -1); + } else if (e.getSource() == newavatarmad) { + mgui.createAvatarMAD(tp, "Modeling Assumptions Diagram"); + mgui.changeMade(null, -1); + } } - } - }; + }; } diff --git a/src/ui/sd/SDAbsoluteTimeConstraint.java b/src/ui/sd/SDAbsoluteTimeConstraint.java index d9a79411e8f3c12af0a4b25f4ce77dc774faeb17..b8661742629f0d9bb6cf9d3e15b9627ee41b03e4 100755 --- a/src/ui/sd/SDAbsoluteTimeConstraint.java +++ b/src/ui/sd/SDAbsoluteTimeConstraint.java @@ -54,17 +54,16 @@ import myutil.*; import ui.*; import ui.window.*; -public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { +public class SDAbsoluteTimeConstraint extends TGCWithoutInternalComponent implements SwallowedTGComponent { private String minConstraint = "0"; private String maxConstraint = "0"; private int widthValue, heightValue; public SDAbsoluteTimeConstraint(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(40 * tdp.getZoom()); - height = (int)(15 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); + + width = 40; + height = 15; nbConnectingPoint = 0; nbInternalTGComponent = 0; @@ -82,12 +81,10 @@ public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponen } public void internalDrawing(Graphics g) { - widthValue = g.getFontMetrics().stringWidth(value); - heightValue = g.getFontMetrics().getHeight(); - /*if (!tdp.isScaled()) { + if (!tdp.isScaled()) { widthValue = g.getFontMetrics().stringWidth(value); heightValue = g.getFontMetrics().getHeight(); - }*/ + } g.drawString(value, x-widthValue-2, y); g.drawLine(x, y, x+width, y); } @@ -105,6 +102,7 @@ public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponen public int getMyCurrentMinX() { return Math.min(x-widthValue, x); + } @@ -135,9 +133,9 @@ public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponen array[0] = getMinConstraint(); array[1] = getMaxConstraint(); JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting absolute time constraints"); - // jdti.setSize(350, 250); - GraphicLib.centerOnParent(jdti, 350, 250); - jdti.setVisible( true ); // blocked until dialog has been closed + jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti); + jdti.show(); // blocked until dialog has been closed minConstraint = array[0]; maxConstraint = array[1]; @@ -173,8 +171,8 @@ public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponen //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; @@ -192,4 +190,4 @@ public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponen } makeValue(); } -} +} \ No newline at end of file diff --git a/src/ui/sd/SDActionState.java b/src/ui/sd/SDActionState.java index aab04c0755da1f9a1c1999d32a581dff9eba7551..33bd5acdf26a69733150ac9203bf40488db59a64 100755 --- a/src/ui/sd/SDActionState.java +++ b/src/ui/sd/SDActionState.java @@ -51,7 +51,7 @@ import java.awt.*; import myutil.*; import ui.*; -public class SDActionState extends TGCScalableOneLineText implements SwallowedTGComponent { +public class SDActionState extends TGCOneLineText implements SwallowedTGComponent { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -60,12 +60,11 @@ public class SDActionState extends TGCScalableOneLineText implements SwallowedTG public SDActionState(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(30 * tdp.getZoom()); - height = (int)(20 * tdp.getZoom()); - minWidth = (int)(30 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 30; + height = 20; + minWidth = 30; + nbConnectingPoint = 0; addTGConnectingPointsCommentMiddle(); @@ -81,14 +80,13 @@ public class SDActionState extends TGCScalableOneLineText implements SwallowedTG public void internalDrawing(Graphics g) { w = g.getFontMetrics().stringWidth(value); - int h = g.getFontMetrics().getHeight(); int w1 = Math.max(minWidth, w + 2 * textX); if ((w1 != width) && (!tdp.isScaled())) { width = w1; } g.drawRoundRect(x - width/2, y, width, height, arc, arc); - g.drawString(value, x - w / 2 , y + (int)(textY*tdp.getZoom())); + g.drawString(value, x - w / 2 , y + textY); } public TGComponent isOnMe(int _x, int _y) { @@ -132,4 +130,4 @@ public class SDActionState extends TGCScalableOneLineText implements SwallowedTG return TGComponentManager.SD_ACTION_STATE; } -} +} \ No newline at end of file diff --git a/src/ui/sd/SDCoregion.java b/src/ui/sd/SDCoregion.java index 0fb1758570987fe3fa1a5abaffdd83c04e8521bf..28f9f02a16c6282c8e4dc110d1bf8b460d7145ab 100755 --- a/src/ui/sd/SDCoregion.java +++ b/src/ui/sd/SDCoregion.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 SDCoregion - * Action state of a sequence diagram - * Creation: 07/10/2004 - * @version 2.0 08/03/2017 - * @author Ludovic APVRILLE - * @see - */ +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 SDCoregion + * Action state of a sequence diagram + * Creation: 07/10/2004 + * @version 1.0 07/10/2004 + * @author Ludovic APVRILLE + * @see + */ package ui.sd; @@ -51,44 +51,43 @@ import java.awt.*; import myutil.*; import ui.*; -public class SDCoregion extends TGCScalableOneLineText implements SwallowedTGComponent { - +public class SDCoregion extends TGCOneLineText implements SwallowedTGComponent { + public SDCoregion(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(20 * tdp.getZoom()); - height = (int)(100 * tdp.getZoom()); - minWidth = (int)(20 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 20; + height = 100; + minWidth = 20; + nbConnectingPoint = 0; addTGConnectingPointsComment(); - + moveable = true; editable = false; removable = true; - + value = "action"; name = "action state"; - + myImageIcon = IconManager.imgic520; - + } - + public void internalDrawing(Graphics g) { g.drawRect(x - width/2, y, width, height); } - + public TGComponent isOnMe(int _x, int _y) { if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { return this; } return null; } - - + + public int getType() { return TGComponentManager.SD_COREGION; } - -} + +} \ No newline at end of file diff --git a/src/ui/sd/SDGuard.java b/src/ui/sd/SDGuard.java index 622461460f59a8ab5cc83c84a2ea53a59837647e..a9a35a5d7c34986213d0b0eb0984b814e6b8190d 100755 --- a/src/ui/sd/SDGuard.java +++ b/src/ui/sd/SDGuard.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 SDGuard - * Guard of a sequence diagram - * Creation: 15/06/2007 - * @version 1.0 15/06/2007 - * @author Ludovic APVRILLE - * @see - */ +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 SDGuard + * Guard of a sequence diagram + * Creation: 15/06/2007 + * @version 1.0 15/06/2007 + * @author Ludovic APVRILLE + * @see + */ package ui.sd; @@ -51,67 +51,66 @@ import java.awt.*; import myutil.*; import ui.*; -public class SDGuard extends TGCScalableOneLineText implements SwallowedTGComponent { +public class SDGuard extends TGCOneLineText implements SwallowedTGComponent { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; protected int w; //w1; - + public SDGuard(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(30 * tdp.getZoom()); - height = (int)(20 * tdp.getZoom()); - minWidth = (int)(30 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 30; + height = 20; + minWidth = 30; + nbConnectingPoint = 0; addTGConnectingPointsCommentMiddle(); - + moveable = true; editable = true; removable = true; - - emptyText = true; - + + emptyText = true; + value = "guard"; name = "action state"; - + myImageIcon = IconManager.imgic512; } - + public void internalDrawing(Graphics g) { w = g.getFontMetrics().stringWidth(value); int w1 = Math.max(minWidth, w + 2 * textX); if ((w1 != width) && (!tdp.isScaled())) { width = w1; } - g.drawLine(x-width/2, y, x-width/2, y+height); - g.drawLine(x-width/2, y, x-width/2+lineLength, y); - g.drawLine(x-width/2, y+height, x-width/2+lineLength, y+height); - - g.drawLine(x+width/2, y, x+width/2, y+height); - g.drawLine(x+width/2, y, x+width/2-lineLength, y); - g.drawLine(x+width/2, y+height, x+width/2-lineLength, y+height); - - g.drawString(value, x - w / 2 , y + (int)(textY*tdp.getZoom())); - } - + g.drawLine(x-width/2, y, x-width/2, y+height); + g.drawLine(x-width/2, y, x-width/2+lineLength, y); + g.drawLine(x-width/2, y+height, x-width/2+lineLength, y+height); + + g.drawLine(x+width/2, y, x+width/2, y+height); + g.drawLine(x+width/2, y, x+width/2-lineLength, y); + g.drawLine(x+width/2, y+height, x+width/2-lineLength, y+height); + + g.drawString(value, x - w / 2 , y + textY); + } + public TGComponent isOnMe(int _x, int _y) { if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { return this; } return null; } - - + + public String getGuard() { return value; } - - + + public int getType() { return TGComponentManager.SD_GUARD; } - -} + +} \ No newline at end of file diff --git a/src/ui/sd/SDInstance.java b/src/ui/sd/SDInstance.java index b31e26067d31ab0814399c8b7e5543b892f671ca..6f048909c410c4e1840b30a30657f6ec06d69d26 100755 --- a/src/ui/sd/SDInstance.java +++ b/src/ui/sd/SDInstance.java @@ -50,6 +50,7 @@ package ui.sd; import java.awt.*; import javax.swing.*; import org.w3c.dom.*; +import java.awt.event.*; import myutil.*; import ui.*; @@ -57,12 +58,12 @@ import ui.window.*; -public class SDInstance extends TGCScalableWithInternalComponent implements SwallowTGComponent { +public class SDInstance extends TGCWithInternalComponent implements SwallowTGComponent { //private int lineLength = 5; //private int textX, textY; private int spacePt = 10; private int wText = 10, hText = 15; - //private int increaseSlice = 250; + private int increaseSlice = 250; private boolean isActor; private static int heightActor = 30; private static int widthActor = 16; @@ -71,31 +72,28 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal public SDInstance(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - width = (int)(10 * tdp.getZoom()); - height = (int)(500 * tdp.getZoom()); - minWidth = (int)(10 * tdp.getZoom()); - maxWidth = (int)(10 * tdp.getZoom()); - minHeight = (int)(250 * tdp.getZoom()); - maxHeight = (int)(1500 * tdp.getZoom()); - //TraceManager.addDev("Init tgc= " + this + " minHeight=" + minHeight); - //TraceManager.addDev("Init tgc= " + this + " maxHeight=" + maxHeight); - oldScaleFactor = tdp.getZoom(); + width = 10; + height = 500; + //textX = 0; + //textY = 2; + minWidth = 10; + maxWidth = 10; + minHeight = 250; + maxHeight = 1500; - - //makeTGConnectingPoints(); + + makeTGConnectingPoints(); //addTGConnectingPointsComment(); nbInternalTGComponent = 0; - makePortMessage(); - moveable = true; editable = true; removable = true; userResizable = true; value = "Instance name"; - name = "instance"; + name = "instance"; isActor = false; myImageIcon = IconManager.imgic500; @@ -167,74 +165,15 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal return TGComponentManager.SD_INSTANCE; } - public int spacePt() { - return (int)(Math.floor(spacePt*tdp.getZoom())); - } - - public double spacePtDouble() { - return spacePt*tdp.getZoom(); - } - - public void rescale(double scaleFactor){ - //TraceManager.addDev("my rescale"); - - super.rescale(scaleFactor); - - // update TG Connecting Points - int yh = spacePt(); - /*for(int i=0; i<nbConnectingPoint; i++, yh+=spacePt()) { - connectingPoint[i].setCdX(width/2); - connectingPoint[i].setCdY(yh); - }*/ - - //height = Math.max(getMinHeightSize(), height); - hasBeenResized(); - } - - public void computeMinHeight() { - height = Math.max(getMinHeightSize(), height); - } - - public int getNbOfConnectingPoints() { - return 100; - //return (int)(((height - (2 * spacePt())) / spacePt())); - } - - - private void makePortMessage() { - int nbOfInternal = 30; - for(int i=0; i<nbOfInternal; i ++) { - double ratio = ((i)/(double)(nbOfInternal));//+(spacePt*tdp.getZoom()/height); - SDPortForMessage port = new SDPortForMessage(100, 200+ (int)(y + ratio*height), tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); - - //tdp.addComponent(port, x+width/2, y+100, true, true); - - //TraceManager.addDev("Adding internal components"); - if (!addSwallowedTGComponent(port, x+width/2, (int)(5*spacePt*tdp.getZoom()) + (int)(y + ratio*height))) { - TraceManager.addDev("Adding PortForMessage failed"); - } else { - port.wasSwallowed(); - } - port.setMoveCd(0, (int)(10*spacePt*tdp.getZoom()) + (int)(ratio*height), false); - //TraceManager.addDev("Nb of internal components:" + nbInternalTGComponent); - - } - - } - private void makeTGConnectingPoints() { - //TraceManager.addDev("Making TG connecting points of " + name); - nbConnectingPoint = getNbOfConnectingPoints(); + + nbConnectingPoint = ((height - (2 * spacePt)) / spacePt) + 1; connectingPoint = new TGConnectingPoint[nbConnectingPoint]; - //int yh = spacePt(); - double div = 1.0/height - (nbConnectingPoint); - //TraceManager.addDev("Div=" + div); + int yh = spacePt; - for(int i=0; i<nbConnectingPoint; i ++) { - double ratio = ((i)/(double)(nbConnectingPoint));//+(spacePt*tdp.getZoom()/height); - //TraceManager.addDev("Ratio=" + ratio); - connectingPoint[i] = new TGConnectingPointMessageSD(this, 0, 0, true, true, 0.5, ratio); + for(int i=0; i<nbConnectingPoint; i ++, yh+=spacePt) { + connectingPoint[i] = new TGConnectingPointMessageSD(this, (width/2), yh, true, true); } } @@ -243,9 +182,9 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal String oldValue = name; JDialogSDInstance jdsdi = new JDialogSDInstance(frame, name, isActor, "Instance attributes"); - // jdsdi.setSize(300, 250); - GraphicLib.centerOnParent(jdsdi, 300, 250); - jdsdi.setVisible( true ); // blocked until dialog has been closed + jdsdi.setSize(300, 250); + GraphicLib.centerOnParent(jdsdi); + jdsdi.show(); // blocked until dialog has been closed String text = getName() + ": "; @@ -295,27 +234,20 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal if (tgc instanceof SDTimerCancellation) { return true; } - - if (tgc instanceof SDPortForMessage) { - return true; - } - return false; } public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { - TraceManager.addDev("Element 0" + tgc + " added to SDInstance"); if (!acceptSwallowedTGComponent(tgc)) { return false; } - TraceManager.addDev("Element 1" + tgc + " added to SDInstance"); //System.out.println("Add swallow component"); // Choose its position - int realY = Math.max(y, getY() + spacePt()); - realY = Math.min(realY, getY() + height + spacePt()); + int realY = Math.max(y, getY() + spacePt); + realY = Math.min(realY, getY() + height + spacePt); int realX = tgc.getX(); @@ -332,7 +264,7 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal tgc.setCd(realX, realY); } - if ((tgc instanceof SDActionState) || (tgc instanceof SDCoregion)|| (tgc instanceof SDGuard) || (tgc instanceof SDPortForMessage)) { + if ((tgc instanceof SDActionState) || (tgc instanceof SDCoregion)|| (tgc instanceof SDGuard)) { realX = getX()+(width/2); //tgc.setCdRectangle((width/2), (width/2), spacePt, height-spacePt-tgc.getHeight()); tgc.setCd(realX, realY); @@ -364,7 +296,6 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal //add it addInternalComponent(tgc, 0); - TraceManager.addDev("Element " + tgc + " added to SDInstance"); return true; } @@ -453,100 +384,145 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal } + /*public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) { + componentMenu.addSeparator(); - - public Point modifyInHeight(int newy) { - ((SequenceDiagramPanel)(tdp)).updateAllInstanceMinMaxSize(); - return super.modifyInHeight(newy); + JMenuItem decrease = new JMenuItem("Decrease size"); + decrease.addActionListener(menuAL); + componentMenu.add(decrease); + decrease.setEnabled(canDecreaseSize()); + JMenuItem increase = new JMenuItem("Increase size"); + increase.addActionListener(menuAL); + componentMenu.add(increase); + } + + public boolean eventOnPopup(ActionEvent e) { + if ((e.getActionCommand().compareTo("Decrease size")) == 0) { + decreaseSize(); + } else { + increaseSize(); + } + return true; + }*/ + + public void updateMinMaxSize() { + ((SequenceDiagramPanel)tdp).updateAllInstanceMinMaxSize(); } + public void setMinHeight(int _min) { + minHeight = _min; + } - // Used when there is a rescale or a component added public int getMinHeightSize() { - int msize = (int)(250*tdp.getZoom()); + int msize = 250; int i; - /*for(i=0; i<connectingPoint.length ; i++) { + for(i=0; i<connectingPoint.length ; i++) { if (!(connectingPoint[i].isFree())) { - TraceManager.addDev("Found a non free connecting point y=" + connectingPoint[i].getY() + " heightOfPt=" + (connectingPoint[i].getY() - y + spacePt())); - msize = Math.max(msize, connectingPoint[i].getY() - y + spacePt() ); + msize = Math.max(msize, connectingPoint[i].getY() - y +spacePt ); } - }*/ + } for(i=0; i<nbInternalTGComponent ; i++) { - msize = Math.max(msize, tgcomponent[i].getY() + tgcomponent[i].getHeight()- y + spacePt()); + msize = Math.max(msize, tgcomponent[i].getY() + tgcomponent[i].getHeight()- y + spacePt); } - TraceManager.addDev("Min height size of " + name + " =" + msize + " height=" + height); - return msize; } - // Method called when there is a resize order + public boolean canDecreaseSize() { + //TraceManager.addDev("Can decrease my size? " + getValue()); + + if (height <= increaseSlice) { + return false; + } + + int newNbConnectingPoint = (((height-increaseSlice) - (2 * spacePt)) / spacePt) + 1; + int i; + + for(i=newNbConnectingPoint; i<connectingPoint.length ; i++) { + if (!connectingPoint[i].isFree()) { + //System.out.println("Cannot reduce size because of a connecting point"); + return false; + } + } + + //SwallowedComponents + for(i=0; i<nbInternalTGComponent ; i++) { + //System.out.println("tgcomponent =" + tgc + " + if ((tgcomponent[i].getY() + tgcomponent[i].getHeight()) > (getY() + getHeight() - increaseSlice)) { + //System.out.println("Cannot reduce size because of a swallowed component"); + return false; + } + } + + //TraceManager.addDev("Can decrease my size! " + getValue()); + + return true; + } + public void setUserResize(int desired_x, int desired_y, int desired_width, int desired_height) { //System.out.println("newx = " + desired_x + " newy = " + desired_y + " minWidth = " + minWidth); - setCd(desired_x, desired_y); actionOnUserResize(desired_width, desired_height); ((SequenceDiagramPanel)tdp).instanceHasBeenResized(this, desired_width, desired_height); } - + public void decreaseSize() { + //System.out.println("Decrease size"); + //Check whether it is possible or not (swallowed components and tgconnecting points used + if (!canDecreaseSize()) { + return; + } + // new nb of connectingPoints + + // If ok, do the modification + height = height - increaseSlice; + hasBeenResized(); + } + + public void increaseSize() { + //System.out.println("Increase size"); + height = height + increaseSlice; + hasBeenResized(); + } + public void hasBeenResized(){ - /*TraceManager.addDev("Has been resized: " + name + " height=" + height); int i; - for (int k=0; k<nbConnectingPoint; k++) { - if (!connectingPoint[k].isFree()) { - TraceManager.addDev("Non free TG point in " + name); - } - } - TGConnectingPoint [] connectingPointTmp = connectingPoint; - makeTGConnectingPoints(); - //nbConnectingPoint = getNbOfConnectingPoints(); - //connectingPoint = new TGConnectingPoint[nbConnectingPoint]; - for(i=0; i<Math.min(connectingPointTmp.length, connectingPoint.length); i++) { + makeTGConnectingPoints(); + for(i=0; i<Math.min(connectingPointTmp.length, connectingPoint.length) ; i++) { connectingPoint[i] = connectingPointTmp[i]; - - if (!connectingPoint[i].isFree()) { - TraceManager.addDev("Non free point in " + name); - } } - for (int j=nbConnectingPoint; j<connectingPointTmp.length; j++) { - if (!connectingPointTmp[j].isFree()) { - TraceManager.addDev("Non free TG point"); - } - }*/ - // Increase tdp if necessary? // Reposition each swallowed component - for(int i=0; i<nbInternalTGComponent ; i++) { + for(i=0; i<nbInternalTGComponent ; i++) { setCDRectangleOfSwallowed(tgcomponent[i]); } } private void setCDRectangleOfSwallowed(TGComponent tgc) { if ((tgc instanceof SDAbsoluteTimeConstraint) || (tgc instanceof SDRelativeTimeConstraint)){ - tgc.setCdRectangle((width/2) - tgc.getWidth(), (width/2), (int)(spacePt()), height-(int)(spacePt())); + tgc.setCdRectangle((width/2) - tgc.getWidth(), (width/2), spacePt, height-spacePt); } - if ((tgc instanceof SDActionState) || (tgc instanceof SDGuard) || (tgc instanceof SDCoregion) || (tgc instanceof SDTimeInterval) || (tgc instanceof SDPortForMessage)) { - tgc.setCdRectangle((width/2), (width/2), (int)(spacePt()), height-(int)(spacePt())-tgc.getHeight()); + if ((tgc instanceof SDActionState) || (tgc instanceof SDGuard) || (tgc instanceof SDCoregion) || (tgc instanceof SDTimeInterval)) { + tgc.setCdRectangle((width/2), (width/2), spacePt, height-spacePt-tgc.getHeight()); } if (tgc instanceof SDTimerSetting) { - tgc.setCdRectangle((width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + tgc.setCdRectangle((width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); } if (tgc instanceof SDTimerExpiration) { - tgc.setCdRectangle((width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + tgc.setCdRectangle((width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); } if (tgc instanceof SDTimerCancellation) { - tgc.setCdRectangle((width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + tgc.setCdRectangle((width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); } } @@ -571,8 +547,8 @@ public class SDInstance extends TGCScalableWithInternalComponent implements Swal //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/sd/SDRelativeTimeConstraint.java b/src/ui/sd/SDRelativeTimeConstraint.java index d4fc02b440e029f31842a3dd2d6f0747bf5425c6..23796a4fec0b9f27680ba367d9fd67c1021ea3c0 100755 --- a/src/ui/sd/SDRelativeTimeConstraint.java +++ b/src/ui/sd/SDRelativeTimeConstraint.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 SDRelativeTimeConstraint - * Line of the relative time constraint. To be used in Sequence Diagrams. - * Creation: 30/09/2004 - * @version 1.0 30/09/2004 - * @author Ludovic APVRILLE - * @see - */ +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 SDRelativeTimeConstraint + * Line of the relative time constraint. To be used in Sequence Diagrams. + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see + */ package ui.sd; @@ -51,48 +51,45 @@ import java.awt.*; import myutil.*; import ui.*; -public class SDRelativeTimeConstraint extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { - +public class SDRelativeTimeConstraint extends TGCWithoutInternalComponent implements SwallowedTGComponent { + public SDRelativeTimeConstraint(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(40 * tdp.getZoom()); - height = (int)(15 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - //width = 40; - //height = 15; - + + width = 40; + height = 15; + nbConnectingPoint = 1; connectingPoint = new TGConnectingPoint[nbConnectingPoint]; connectingPoint[0] = new TGConnectingPointTimeConstraintSD(this, 10, 0, true, true); addTGConnectingPointsComment(); - + nbInternalTGComponent = 0; - + moveable = true; editable = false; removable = true; - + name = "Line of relative time constraint"; value = "rtc"; - + myImageIcon = IconManager.imgic508; } - + public void internalDrawing(Graphics g) { g.drawLine(x, y, x+width, y); } - + public TGComponent isOnMe(int _x, int _y) { if (GraphicLib.isInRectangle(_x, _y, x, y - height/2, width, height)) { return this; } - + return null; } - + public int getType() { return TGComponentManager.SD_RELATIVE_TIME_CONSTRAINT; } -} +} \ No newline at end of file diff --git a/src/ui/sd/SDTimeInterval.java b/src/ui/sd/SDTimeInterval.java index 550950937b2017f62873c6a396150218d3e25c00..3f5c483c2971c1689e29bb563de108bc07226457 100755 --- a/src/ui/sd/SDTimeInterval.java +++ b/src/ui/sd/SDTimeInterval.java @@ -57,61 +57,58 @@ public class SDTimeInterval extends TGCTimeInterval implements SwallowedTGCompon private int segment = 4; private int wtext = 0; private int htext = 0; - + public SDTimeInterval(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(10 * tdp.getZoom()); - height = (int)(30 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 10; + height = 30; + textX = width/2 + 5; + textY = height/2 + 5; + nbConnectingPoint = 0; addTGConnectingPointsCommentMiddle(); - + nbInternalTGComponent = 0; tgcomponent = new TGComponent[nbInternalTGComponent]; - - + + moveable = true; editable = true; removable = true; - + name = "time interval"; makeValue(); - + myImageIcon = IconManager.imgic512; } - + public void internalDrawing(Graphics g) { - textX = width/2 + 5; - textY = height/2 + 5; - g.drawRect(x-width/2, y, width, height); //g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); //g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); - //w = g.getFontMetrics().stringWidth(value); - + //w = g.getFontMetrics().stringWidth(value); + g.drawString(value, x + textX, y + textY); - + if (!tdp.isScaled()) { wtext = g.getFontMetrics().stringWidth(value); htext = g.getFontMetrics().getHeight(); //System.out.println("wtext=" + wtext + " htext=" + htext); } - + int y1 = y + 4; int x1 = x + 2 - width/2; int width1 = width - 4; - int incrementYtmp = (int)(incrementY*tdp.getZoom()); - + for (int i=0; i<segment; i++) { - g.drawLine(x1, y1, x1+width1, y1+incrementYtmp); - y1 += incrementYtmp; - g.drawLine(x1+width1, y1, x1, y1+incrementYtmp); - y1 += incrementYtmp; + g.drawLine(x1, y1, x1+width1, y1+incrementY); + y1 += incrementY; + g.drawLine(x1+width1, y1, x1, y1+incrementY); + y1 += incrementY; } } - + public TGComponent isOnMe(int _x, int _y) { if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { return this; @@ -121,9 +118,9 @@ public class SDTimeInterval extends TGCTimeInterval implements SwallowedTGCompon } return null; } - + public int getType() { return TGComponentManager.SD_TIME_INTERVAL; } - -} + +} \ No newline at end of file diff --git a/src/ui/sd/SDTimerCancellation.java b/src/ui/sd/SDTimerCancellation.java index ea9552b037313c7f7ba09832cc3d3ab9d92a9208..ecfe2d33e8a9d2f31ac07c02307e99163fe11fa9 100755 --- a/src/ui/sd/SDTimerCancellation.java +++ b/src/ui/sd/SDTimerCancellation.java @@ -53,7 +53,7 @@ import org.w3c.dom.*; import myutil.*; import ui.*; -public class SDTimerCancellation extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { +public class SDTimerCancellation extends TGCWithoutInternalComponent implements SwallowedTGComponent { private String timer = "myTimer"; private int widthValue, heightValue; private int lineWidth = 20; @@ -61,9 +61,8 @@ public class SDTimerCancellation extends TGCScalableWithoutInternalComponent imp public SDTimerCancellation(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - width = (int)(15 * tdp.getZoom()); - height = (int)(25 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); + width = 15; + height = 25; nbConnectingPoint = 0; addTGConnectingPointsComment(); @@ -219,4 +218,4 @@ public class SDTimerCancellation extends TGCScalableWithoutInternalComponent imp } makeValue(); } -} +} \ No newline at end of file diff --git a/src/ui/sd/SDTimerExpiration.java b/src/ui/sd/SDTimerExpiration.java index eedf33b0f4881ff157e4e39f76b4b33463e4b0a0..3f4c68e8fb165d0a953d1b393d544db1c44852d0 100755 --- a/src/ui/sd/SDTimerExpiration.java +++ b/src/ui/sd/SDTimerExpiration.java @@ -53,18 +53,17 @@ import org.w3c.dom.*; import myutil.*; import ui.*; -public class SDTimerExpiration extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { +public class SDTimerExpiration extends TGCWithoutInternalComponent implements SwallowedTGComponent { private String timer = "myTimer"; private int widthValue, heightValue; private int lineWidth = 20; public SDTimerExpiration(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(15 * tdp.getZoom()); - height = (int)(25 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 15; + height = 25; + nbConnectingPoint = 0; addTGConnectingPointsComment(); @@ -211,4 +210,4 @@ public class SDTimerExpiration extends TGCScalableWithoutInternalComponent imple } makeValue(); } -} +} \ No newline at end of file diff --git a/src/ui/sd/SDTimerSetting.java b/src/ui/sd/SDTimerSetting.java index d7561bab1ce42445351832ef6256f2ccd29a0546..66c3db110ee2edf644b4e4639de5990c611c4952 100755 --- a/src/ui/sd/SDTimerSetting.java +++ b/src/ui/sd/SDTimerSetting.java @@ -54,7 +54,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class SDTimerSetting extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { +public class SDTimerSetting extends TGCWithoutInternalComponent implements SwallowedTGComponent { private String timer = "myTimer"; private String duration = "10"; private int widthValue, heightValue; @@ -62,11 +62,10 @@ public class SDTimerSetting extends TGCScalableWithoutInternalComponent implemen public SDTimerSetting(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); - - width = (int)(15 * tdp.getZoom()); - height = (int)(25 * tdp.getZoom()); - oldScaleFactor = tdp.getZoom(); - + + width = 15; + height = 25; + nbConnectingPoint = 0; addTGConnectingPointsComment(); @@ -151,9 +150,9 @@ public class SDTimerSetting extends TGCScalableWithoutInternalComponent implemen array[0] = getTimer(); array[1] = getDuration(); JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting absolute time constraints", "timer", "duration"); - //jdti.setSize(350, 250); - GraphicLib.centerOnParent(jdti, 350, 250); - jdti.setVisible( true ); // blocked until dialog has been closed + jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti); + jdti.show(); // blocked until dialog has been closed timer = array[0]; duration = array[1]; @@ -172,7 +171,7 @@ public class SDTimerSetting extends TGCScalableWithoutInternalComponent implemen boolean isInteger = true; try { - /*int tg =*/ Integer.parseInt(duration); + int tg = Integer.parseInt(duration); } catch (NumberFormatException nfe) { isInteger = false; } @@ -219,8 +218,8 @@ public class SDTimerSetting extends TGCScalableWithoutInternalComponent implemen //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; @@ -241,4 +240,4 @@ public class SDTimerSetting extends TGCScalableWithoutInternalComponent implemen } makeValue(); } -} +} \ No newline at end of file diff --git a/src/ui/sd/SequenceDiagramPanel.java b/src/ui/sd/SequenceDiagramPanel.java index 66257cd848f9eda75f72b20b92cd4223b9ac2a32..687ebe8a9f8173e0acd5fa0b71df86d976884858 100755 --- a/src/ui/sd/SequenceDiagramPanel.java +++ b/src/ui/sd/SequenceDiagramPanel.java @@ -53,7 +53,7 @@ import java.util.*; import ui.*; -public class SequenceDiagramPanel extends TDiagramPanel { +public class SequenceDiagramPanel extends TDiagramPanel{ public SequenceDiagramPanel(MainGUI mgui, TToolBar _ttb) { super(mgui, _ttb); @@ -88,9 +88,6 @@ public class SequenceDiagramPanel extends TDiagramPanel { mgui.addTClass(tgcc.getClassName()); return true; }*/ - - - //TraceManager.addDev("Added elt"); return false; } @@ -101,7 +98,6 @@ public class SequenceDiagramPanel extends TDiagramPanel { resetAllInstancesOf(tgcc); return true; }*/ - //TraceManager.addDev("Removed elt"); return false; } @@ -109,7 +105,6 @@ public class SequenceDiagramPanel extends TDiagramPanel { /*if (tgc instanceof TCDTClass) { return actionOnDoubleClick(tgc); }*/ - //TraceManager.addDev("Value changed"); return false; } @@ -313,7 +308,6 @@ public class SequenceDiagramPanel extends TDiagramPanel { return found; } - // For MSCDrawer public void increaseInstanceSize(int size) { Iterator iterator = componentList.listIterator(); TGComponent tgc; @@ -347,10 +341,19 @@ public class SequenceDiagramPanel extends TDiagramPanel { tgc = (TGComponent)(iterator.next()); if (tgc instanceof SDInstance) { - ((SDInstance)tgc).computeMinHeight(); + minSize = Math.max(((SDInstance)tgc).getMinHeightSize(), minSize); } } + iterator = componentList.listIterator(); + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + + if (tgc instanceof SDInstance) { + ((SDInstance)tgc).setMinHeight(minSize); + } + } + } @@ -358,6 +361,7 @@ public class SequenceDiagramPanel extends TDiagramPanel { Iterator iterator = componentList.listIterator(); TGComponent tgc; + while(iterator.hasNext()) { tgc = (TGComponent)(iterator.next()); diff --git a/src/ui/sd/SequenceDiagramToolBar.java b/src/ui/sd/SequenceDiagramToolBar.java index f67506303e89c91ccdba4a89fbc59e5f3f8e8be8..0c05a8376b8098cd95bf2937fca4dbb3e1489722 100755 --- a/src/ui/sd/SequenceDiagramToolBar.java +++ b/src/ui/sd/SequenceDiagramToolBar.java @@ -1,61 +1,64 @@ /**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 SequenceDiagramToolBar - * Implements the toolbar to be used in conjunction with the panel of a sequence diagram - * Creation: 30/09/2004 - * @version 1.0 30/09/2004 - * @author Ludovic APVRILLE - * @see SequenceDiagramPanel - */ +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 SequenceDiagramToolBar + * Implements the toolbar to be used in conjunction with the panel of a sequence diagram + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see SequenceDiagramPanel + */ package ui.sd; import javax.swing.*; +//import java.awt.*; +//import java.awt.event.*; import ui.*; public class SequenceDiagramToolBar extends TToolBar { - + public SequenceDiagramToolBar(MainGUI _mgui) { super(_mgui); + } - + protected void setActive(boolean b) { mgui.actions[TGUIAction.SD_EDIT].setEnabled(b); mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); @@ -63,8 +66,8 @@ public class SequenceDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.SD_CONNECTOR_MESSAGE_SYNC].setEnabled(b); mgui.actions[TGUIAction.SD_CONNECTOR_MESSAGE_ASYNC].setEnabled(b); mgui.actions[TGUIAction.SD_INSTANCE].setEnabled(b); - mgui.actions[TGUIAction.SD_ACTION_STATE].setEnabled(b); - mgui.actions[TGUIAction.SD_GUARD].setEnabled(b); + mgui.actions[TGUIAction.SD_ACTION_STATE].setEnabled(b); + mgui.actions[TGUIAction.SD_GUARD].setEnabled(b); mgui.actions[TGUIAction.SD_COREGION].setEnabled(b); mgui.actions[TGUIAction.SD_TIME_INTERVAL].setEnabled(b); mgui.actions[TGUIAction.SD_TIMER_SETTING].setEnabled(b); @@ -74,83 +77,84 @@ public class SequenceDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.SD_RELATIVE_TIME_CONSTRAINT].setEnabled(b); mgui.actions[TGUIAction.SD_RELATIVE_TIME_CONSTRAINT_CONNECTOR].setEnabled(b); mgui.actions[TGUIAction.SD_ALIGN_INSTANCES].setEnabled(b); - - mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(b); - mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(b); - mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); - mgui.updateZoomInfo(); + + mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(false); + mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(false); + mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(false); + mgui.updateZoomInfo(); } - + protected void setButtons() { JButton button; - + button = this.add(mgui.actions[TGUIAction.SD_EDIT]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.UML_NOTE]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.CONNECTOR_COMMENT]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_CONNECTOR_MESSAGE_SYNC]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_CONNECTOR_MESSAGE_ASYNC]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_INSTANCE]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_ACTION_STATE]); button.addMouseListener(mgui.mouseHandler); - - button = this.add(mgui.actions[TGUIAction.SD_GUARD]); + + button = this.add(mgui.actions[TGUIAction.SD_GUARD]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_COREGION]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_TIMER_SETTING]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_TIMER_CANCELLATION]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_TIMER_EXPIRATION]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_TIME_INTERVAL]); button.addMouseListener(mgui.mouseHandler); - + this.addSeparator(); - + button = this.add(mgui.actions[TGUIAction.SD_ABSOLUTE_TIME_CONSTRAINT]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_RELATIVE_TIME_CONSTRAINT]); button.addMouseListener(mgui.mouseHandler); - + button = this.add(mgui.actions[TGUIAction.SD_RELATIVE_TIME_CONSTRAINT_CONNECTOR]); button.addMouseListener(mgui.mouseHandler); - - this.addSeparator(); + this.addSeparator(); - + this.addSeparator(); + button = this.add(mgui.actions[TGUIAction.SD_ALIGN_INSTANCES]); button.addMouseListener(mgui.mouseHandler); + } - + } // Class diff --git a/src/ui/sd/TGConnectingPointMessageSD.java b/src/ui/sd/TGConnectingPointMessageSD.java index 69a78bfd1602c6f35feaf83b57c53056043d6512..b3a68496060e7b56ea63f304de545abf550bd35a 100755 --- a/src/ui/sd/TGConnectingPointMessageSD.java +++ b/src/ui/sd/TGConnectingPointMessageSD.java @@ -1,48 +1,48 @@ /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - ludovic.apvrille AT enst.fr +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 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". +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. +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. +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. +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 TGConnectingPointMessageSD - * Definition of connecting points on which connectors of sequence diagrams can be connected - * Creation: 06/10/2004 - * @version 1.0 06/10/2004 - * @author Ludovic APVRILLE - * @see - */ +/** + * Class TGConnectingPointMessageSD + * Definition of connecting points on which connectors of sequence diagrams can be connected + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ package ui.sd; @@ -50,23 +50,20 @@ package ui.sd; import ui.*; -import myutil.*; - -public class TGConnectingPointMessageSD extends TGConnectingPointWidthHeight { - - public TGConnectingPointMessageSD(CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h) { - super(_container, _x, _y, _in, _out, _w, _h); +public class TGConnectingPointMessageSD extends TGConnectingPoint{ + + public TGConnectingPointMessageSD(CDElement _container, int _x, int _y, boolean _in, boolean _out) { + super(_container, _x, _y, _in, _out); } - + public boolean isCompatibleWith(int type) { - //TraceManager.addDev("is compatible with " + type); + //System.out.println("is compatible with " + type); if ((type == TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SD) || (type == TGComponentManager.CONNECTOR_MESSAGE_SYNC_SD)) { - //TraceManager.addDev("is compatible with " + type + " x= " + getX() + " y=" + getY()) ; //System.out.println("is compatible with:true"); return true; } //System.out.println("is compatible with:false"); return false; } - -} + +} \ No newline at end of file diff --git a/src/ui/sd/TGConnectorRelativeTimeSD.java b/src/ui/sd/TGConnectorRelativeTimeSD.java index e32ddfbf13de35a58e7eeeb65c4a90361a17e6f6..52c620d7f3c78637fc5af6378ba57adae19b1da0 100755 --- a/src/ui/sd/TGConnectorRelativeTimeSD.java +++ b/src/ui/sd/TGConnectorRelativeTimeSD.java @@ -120,9 +120,9 @@ public class TGConnectorRelativeTimeSD extends TGConnector { array[0] = getMinConstraint(); array[1] = getMaxConstraint(); JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting relative time constraints"); - //jdti.setSize(350, 250); - GraphicLib.centerOnParent(jdti, 350, 250); - jdti.setVisible( true ); // blocked until dialog has been closed + jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti); + jdti.show(); // blocked until dialog has been closed minConstraint = array[0]; maxConstraint = array[1]; @@ -159,8 +159,8 @@ public class TGConnectorRelativeTimeSD extends TGConnector { //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/sd2/SDAbsoluteTimeConstraint.java b/src/ui/sd2/SDAbsoluteTimeConstraint.java new file mode 100755 index 0000000000000000000000000000000000000000..3e9ae124038473b8b1a8b7595f092e18f893d07a --- /dev/null +++ b/src/ui/sd2/SDAbsoluteTimeConstraint.java @@ -0,0 +1,195 @@ +/**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 SDAbsoluteTimeConstraint + * Absolute time constraint of the form @{1..2}. To be used in Sequence Diagrams. + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; +import javax.swing.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + +public class SDAbsoluteTimeConstraint extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { + private String minConstraint = "0"; + private String maxConstraint = "0"; + private int widthValue, heightValue; + + public SDAbsoluteTimeConstraint(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(40 * tdp.getZoom()); + height = (int)(15 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + nbInternalTGComponent = 0; + addTGConnectingPointsComment(); + + moveable = true; + editable = true; + removable = true; + + name = "absolute time constraint"; + value = "@ {0..0}"; + widthValue = 0; heightValue=0; + + myImageIcon = IconManager.imgic506; + } + + public void internalDrawing(Graphics g) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + /*if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + }*/ + g.drawString(value, x-widthValue-2, y); + g.drawLine(x, y, x+width, y); + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y-height/2, width, height)) { + return this; + } + + if (GraphicLib.isInRectangle(_x, _y, x-widthValue-2, y-heightValue, widthValue, heightValue)) { + return this; + } + return null; + } + + public int getMyCurrentMinX() { + return Math.min(x-widthValue, x); + } + + + public int getMyCurrentMinY() { + return y-heightValue; + } + + public int getType() { + return TGComponentManager.SDZV_ABSOLUTE_TIME_CONSTRAINT; + } + + public String getMinConstraint() { + return minConstraint; + } + + public String getMaxConstraint() { + return maxConstraint; + } + + public void makeValue() { + value = "@ {" + minConstraint + ".." + maxConstraint + "}"; + } + + public boolean editOndoubleClick(JFrame frame) { + String oldMin = getMinConstraint(); + String oldMax = getMaxConstraint(); + String[] array = new String[2]; + array[0] = getMinConstraint(); array[1] = getMaxConstraint(); + + JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting absolute time constraints"); + // jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti, 350, 250); + jdti.setVisible( true ); // blocked until dialog has been closed + + minConstraint = array[0]; maxConstraint = array[1]; + + if ((minConstraint != null) && (maxConstraint != null) && ((!minConstraint.equals(oldMin)) || (!maxConstraint.equals(oldMax)))){ + makeValue(); + return true; + } + minConstraint = oldMin; + maxConstraint = oldMax; + return false; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Interval minConstraint=\""); + sb.append(getMinConstraint()); + sb.append("\" maxConstraint=\""); + sb.append(getMaxConstraint()); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra synchro ***"); + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //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); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Interval")) { + minConstraint = elt.getAttribute("minConstraint"); + maxConstraint = elt.getAttribute("maxConstraint"); + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + makeValue(); + } +} diff --git a/src/ui/sd2/SDActionState.java b/src/ui/sd2/SDActionState.java new file mode 100755 index 0000000000000000000000000000000000000000..239481fffa192135074d90601080c93b215da4a5 --- /dev/null +++ b/src/ui/sd2/SDActionState.java @@ -0,0 +1,135 @@ +/**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 SDActionState + * Action state of a sequence diagram + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class SDActionState extends TGCScalableOneLineText implements SwallowedTGComponent { + protected int lineLength = 5; + protected int textX = 5; + protected int textY = 15; + protected int arc = 5; + protected int w; //w1; + + public SDActionState(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(30 * tdp.getZoom()); + height = (int)(20 * tdp.getZoom()); + minWidth = (int)(30 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsCommentMiddle(); + + moveable = true; + editable = true; + removable = true; + + value = "action"; + name = "action state"; + + myImageIcon = IconManager.imgic512; + } + + public void internalDrawing(Graphics g) { + w = g.getFontMetrics().stringWidth(value); + int h = g.getFontMetrics().getHeight(); + int w1 = Math.max(minWidth, w + 2 * textX); + if ((w1 != width) && (!tdp.isScaled())) { + width = w1; + } + g.drawRoundRect(x - width/2, y, width, height, arc, arc); + + g.drawString(value, x - w / 2 , y + (int)(textY*tdp.getZoom())); + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { + return this; + } + return null; + } + + + public String getAction() { + return value; + } + + public String getAction(int cpt) { + if (cpt <0) { + return value; + } + + String ret; + + try { + ret = value; + while(cpt >0) { + ret = ret.substring(ret.indexOf(';') + 1, ret.length()); + cpt --; + } + + int index = ret.indexOf(';'); + + if (index > 0) { + ret = ret.substring(0, index+1); + } + } catch (Exception e) { + return value; + } + return ret; + } + + public int getType() { + return TGComponentManager.SDZV_ACTION_STATE; + } + +} diff --git a/src/ui/sd2/SDCoregion.java b/src/ui/sd2/SDCoregion.java new file mode 100755 index 0000000000000000000000000000000000000000..99050c05b7045b0512588b46c90b7ae47fd14bd0 --- /dev/null +++ b/src/ui/sd2/SDCoregion.java @@ -0,0 +1,94 @@ +/**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 SDCoregion + * Action state of a sequence diagram + * Creation: 07/10/2004 + * @version 2.0 08/03/2017 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class SDCoregion extends TGCScalableOneLineText implements SwallowedTGComponent { + + public SDCoregion(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(20 * tdp.getZoom()); + height = (int)(100 * tdp.getZoom()); + minWidth = (int)(20 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + moveable = true; + editable = false; + removable = true; + + value = "action"; + name = "action state"; + + myImageIcon = IconManager.imgic520; + + } + + public void internalDrawing(Graphics g) { + g.drawRect(x - width/2, y, width, height); + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { + return this; + } + return null; + } + + + public int getType() { + return TGComponentManager.SDZV_COREGION; + } + +} diff --git a/src/ui/sd2/SDGuard.java b/src/ui/sd2/SDGuard.java new file mode 100755 index 0000000000000000000000000000000000000000..94b385a97d4320105ab96693bc0b60c9f6d9bbb9 --- /dev/null +++ b/src/ui/sd2/SDGuard.java @@ -0,0 +1,117 @@ +/**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 SDGuard + * Guard of a sequence diagram + * Creation: 15/06/2007 + * @version 1.0 15/06/2007 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class SDGuard extends TGCScalableOneLineText implements SwallowedTGComponent { + protected int lineLength = 5; + protected int textX = 5; + protected int textY = 15; + protected int w; //w1; + + public SDGuard(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(30 * tdp.getZoom()); + height = (int)(20 * tdp.getZoom()); + minWidth = (int)(30 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsCommentMiddle(); + + moveable = true; + editable = true; + removable = true; + + emptyText = true; + + value = "guard"; + name = "action state"; + + myImageIcon = IconManager.imgic512; + } + + public void internalDrawing(Graphics g) { + w = g.getFontMetrics().stringWidth(value); + int w1 = Math.max(minWidth, w + 2 * textX); + if ((w1 != width) && (!tdp.isScaled())) { + width = w1; + } + g.drawLine(x-width/2, y, x-width/2, y+height); + g.drawLine(x-width/2, y, x-width/2+lineLength, y); + g.drawLine(x-width/2, y+height, x-width/2+lineLength, y+height); + + g.drawLine(x+width/2, y, x+width/2, y+height); + g.drawLine(x+width/2, y, x+width/2-lineLength, y); + g.drawLine(x+width/2, y+height, x+width/2-lineLength, y+height); + + g.drawString(value, x - w / 2 , y + (int)(textY*tdp.getZoom())); + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { + return this; + } + return null; + } + + + public String getGuard() { + return value; + } + + + public int getType() { + return TGComponentManager.SDZV_GUARD; + } + +} diff --git a/src/ui/sd2/SDInstance.java b/src/ui/sd2/SDInstance.java new file mode 100755 index 0000000000000000000000000000000000000000..a77294f353019440b5898d1f017a09e62b4a7458 --- /dev/null +++ b/src/ui/sd2/SDInstance.java @@ -0,0 +1,602 @@ +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille, Andrea Enrici + + ludovic.apvrille AT telecom-paristech.fr + andrea.enrici AT telecom-paritech.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 SDInstance + * Fixed duration operator. To be used in sequence diagrams + * Creation: 04/10/2004 + * @version 1.1 10/06/2014 + * @author Ludovic APVRILLE, Andrea ENRICI + * @see + */ + +package ui.sd2; + +import java.awt.*; +import javax.swing.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + + + +public class SDInstance extends TGCScalableWithInternalComponent implements SwallowTGComponent, SpecificActionAfterAdd { + //private int lineLength = 5; + //private int textX, textY; + private int spacePt = 10; + private int wText = 10, hText = 15; + //private int increaseSlice = 250; + private boolean isActor; + private static int heightActor = 30; + private static int widthActor = 16; + + + public SDInstance(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(10 * tdp.getZoom()); + height = (int)(500 * tdp.getZoom()); + minWidth = (int)(10 * tdp.getZoom()); + maxWidth = (int)(10 * tdp.getZoom()); + minHeight = (int)(250 * tdp.getZoom()); + maxHeight = (int)(1500 * tdp.getZoom()); + //TraceManager.addDev("Init tgc= " + this + " minHeight=" + minHeight); + //TraceManager.addDev("Init tgc= " + this + " maxHeight=" + maxHeight); + oldScaleFactor = tdp.getZoom(); + + + //makeTGConnectingPoints(); + //addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + //makePortMessage(); + + moveable = true; + editable = true; + removable = true; + userResizable = true; + + value = "Instance name"; + name = "instance"; + isActor = false; + + myImageIcon = IconManager.imgic500; + } + + + public void internalDrawing(Graphics g) { + + if( !tdp.isScaled() ) { + wText = g.getFontMetrics().stringWidth(name); + hText = g.getFontMetrics().getHeight(); + } + g.drawString( name, x - (wText / 2) + width/2, y - 3 ); + g.drawLine(x - (wText / 2) + width/2, y-2, x + (wText / 2) + width/2, y-2); + g.drawLine(x+(width/2), y, x+(width/2), y +height); + + if( isActor ) { + int xtmp = x + (width-widthActor) / 2; + int ytmp = y-hText; + // Head + g.drawOval(xtmp+(widthActor/4)-1, ytmp-heightActor, 2+widthActor/2, 2+widthActor/2); + //Body + g.drawLine(xtmp+widthActor/2, ytmp-heightActor/3, xtmp+widthActor/2, ytmp-(2*heightActor)/3); + //Arms + g.drawLine(xtmp, ytmp-(heightActor/2) - 2, xtmp+widthActor, ytmp-(heightActor/2) - 2); + //Left leg + g.drawLine(xtmp+widthActor, ytmp, xtmp+widthActor/2, ytmp-heightActor/3); + //right leg + g.drawLine(xtmp, ytmp, xtmp+widthActor/2, ytmp-heightActor/3); + } + } + + + public TGComponent isOnOnlyMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + + if (GraphicLib.isInRectangle(_x, _y, x + (width/2) - (wText/2) , y-hText, wText, hText)) { + return this; + } + + if (isActor) { + if (GraphicLib.isInRectangle(_x, _y, x + (width-widthActor) / 2, y-heightActor-hText, widthActor, heightActor)) { + return this; + } + } + return null; + } + + public int getMyCurrentMinX() { + return Math.min(x + (width/2) - (wText/2), x); + + } + + public int getMyCurrentMaxX() { + return Math.max(x + (width/2) + (wText/2), x + width); + } + + public int getMyCurrentMinY() { + return Math.min(y-hText-heightActor, y); + } + + public String getInstanceName() { + return getValue(); + } + + public int getType() { + return TGComponentManager.SDZV_INSTANCE; + } + + public int spacePt() { + return (int)(Math.floor(spacePt*tdp.getZoom())); + } + + public double spacePtDouble() { + return spacePt*tdp.getZoom(); + } + + public void rescale(double scaleFactor){ + //TraceManager.addDev("my rescale"); + + super.rescale(scaleFactor); + + // update TG Connecting Points + int yh = spacePt(); + /*for(int i=0; i<nbConnectingPoint; i++, yh+=spacePt()) { + connectingPoint[i].setCdX(width/2); + connectingPoint[i].setCdY(yh); + }*/ + + //height = Math.max(getMinHeightSize(), height); + hasBeenResized(); + } + + public void computeMinHeight() { + height = Math.max(getMinHeightSize(), height); + } + + public int getNbOfConnectingPoints() { + return 100; + //return (int)(((height - (2 * spacePt())) / spacePt())); + } + + + public void makePortMessage() { + int nbOfInternal = 30; + for(int i=0; i<nbOfInternal; i ++) { + double ratio = ((i)/(double)(nbOfInternal));//+(spacePt*tdp.getZoom()/height); + SDPortForMessage port = new SDPortForMessage(100, 200+ (int)(y + ratio*height), tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + + //tdp.addComponent(port, x+width/2, y+100, true, true); + + //TraceManager.addDev("Adding internal components"); + if (!addSwallowedTGComponent(port, x+width/2, (int)(5*spacePt*tdp.getZoom()) + (int)(y + ratio*height))) { + TraceManager.addDev("Adding PortForMessage failed"); + } else { + port.wasSwallowed(); + } + port.setMoveCd(0, (int)(10*spacePt*tdp.getZoom()) + (int)(ratio*height), false); + //TraceManager.addDev("Nb of internal components:" + nbInternalTGComponent); + + } + + } + + /*private void makeTGConnectingPoints() { + //TraceManager.addDev("Making TG connecting points of " + name); + nbConnectingPoint = getNbOfConnectingPoints(); + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + + //int yh = spacePt(); + double div = 1.0/height - (nbConnectingPoint); + //TraceManager.addDev("Div=" + div); + + for(int i=0; i<nbConnectingPoint; i ++) { + double ratio = ((i)/(double)(nbConnectingPoint));//+(spacePt*tdp.getZoom()/height); + //TraceManager.addDev("Ratio=" + ratio); + connectingPoint[i] = new TGConnectingPointMessageSD(this, 0, 0, true, true, 0.5, ratio); + } + + }*/ + + public boolean editOndoubleClick(JFrame frame) { + String oldValue = name; + + JDialogSDInstance jdsdi = new JDialogSDInstance(frame, name, isActor, "Instance attributes"); + // jdsdi.setSize(300, 250); + GraphicLib.centerOnParent(jdsdi, 300, 250); + jdsdi.setVisible( true ); // blocked until dialog has been closed + + + String text = getName() + ": "; + if (hasFather()) { + text = getTopLevelName() + " / " + text; + } + + if (jdsdi.hasBeenUpdated()) { + isActor = jdsdi.isAnActor(); + String s = jdsdi.getInstanceName(); + + if (s != null) { + s = s.trim(); + } + + if((s != null) && (s.length() > 0) && (!s.equals(oldValue))) { + if(!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog( frame, + "Could not change the name of the instance: the new name is not a valid name", + "Error", JOptionPane.INFORMATION_MESSAGE ); + return false; + } + setName(s); + return true; + } + } + return false; + } + + public boolean acceptSwallowedTGComponent(TGComponent tgc) { + if ((tgc instanceof ui.sd2.SDAbsoluteTimeConstraint) || (tgc instanceof ui.sd2.SDRelativeTimeConstraint) || (tgc instanceof ui.sd2.SDTimeInterval)){ + return true; + } + + if ((tgc instanceof ui.sd2.SDActionState) || (tgc instanceof ui.sd2.SDCoregion)|| (tgc instanceof ui.sd2.SDGuard)) { + return true; + } + + if (tgc instanceof ui.sd2.SDTimerSetting) { + return true; + } + + if (tgc instanceof ui.sd2.SDTimerExpiration) { + return true; + } + + if (tgc instanceof ui.sd2.SDTimerCancellation) { + return true; + } + + if (tgc instanceof ui.sd2.SDPortForMessage) { + return true; + } + + + return false; + } + + public boolean addSwallowedTGComponent(TGComponent tgc, int x, int y) { + //TraceManager.addDev("Element 0" + tgc + " added to SDInstance"); + if (!acceptSwallowedTGComponent(tgc)) { + return false; + } + + //TraceManager.addDev("Element 1" + tgc + " added to SDInstance"); + + //System.out.println("Add swallow component"); + // Choose its position + int realY = Math.max(y, getY() + spacePt()); + realY = Math.min(realY, getY() + height + spacePt()); + int realX = tgc.getX(); + + + // Make it an internal component + // It's one of my son + tgc.setFather(this); + tgc.setDrawingZone(true); + + // Set its coordinates + if ((tgc instanceof SDAbsoluteTimeConstraint) || (tgc instanceof SDRelativeTimeConstraint) || (tgc instanceof SDTimeInterval)){ + realX = getX() + (width/2) - tgc.getWidth(); + //tgc.setCdRectangle((width/2) - tgc.getWidth(), (width/2), spacePt, height-spacePt); + //tgc.setCdRectangle(0, -50, 0, 50); + tgc.setCd(realX, realY); + } + + if ((tgc instanceof SDActionState) || (tgc instanceof SDCoregion)|| (tgc instanceof SDGuard) || (tgc instanceof SDPortForMessage)) { + realX = getX()+(width/2); + //tgc.setCdRectangle((width/2), (width/2), spacePt, height-spacePt-tgc.getHeight()); + tgc.setCd(realX, realY); + } + + if (tgc instanceof SDTimerSetting) { + realX = getX()+(width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2; + //tgc.setCdRectangle((width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); + tgc.setCd(realX, realY); + } + + if (tgc instanceof SDTimerExpiration) { + realX = getX()+(width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2; + //tgc.setCdRectangle((width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); + tgc.setCd(realX, realY); + } + + if (tgc instanceof SDTimerCancellation) { + realX = getX()+(width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2; + //tgc.setCdRectangle((width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, spacePt - tgc.getHeight()/2, height-spacePt-tgc.getHeight() / 2); + tgc.setCd(realX, realY); + } + + setCDRectangleOfSwallowed(tgc); + + // coregions -> in the middle ! + + // else unknown + + //add it + addInternalComponent(tgc, 0); + TraceManager.addDev("Element " + tgc + " added to SDInstance"); + + return true; + } + + public void removeSwallowedTGComponent(TGComponent tgc) { + removeInternalComponent(tgc); + } + + public boolean isInCoregion(int yy) { + TGComponent tgc; + for(int i=0; i<nbInternalTGComponent; i++) { + tgc = tgcomponent[i]; + if (tgc instanceof SDCoregion) { + //System.out.println("Coregion found from " + tgc.getY() + " to " + (tgc.getY() + tgc.getHeight())); + if (tgc.isOnMe(tgc.getX(), yy) != null) { + return true; + } + } + } + return false; + } + + public boolean isInSameCoregion(int y1, int y2) { + //System.out.println("Is in same coregion y1=" + y1 + " y2=" + y2); + int y11 = Math.min(y1, y2); + int y22 = Math.max(y1, y2) +1; + for(int i=y11; i<y22; i++) { + if (!isInCoregion(i)) { + //System.out.println("No!"); + return false; + } + } + //System.out.println("YES !"); + return true; + } + + public boolean inSameCoregion(TGComponent tgc1, TGComponent tgc2) { + TGComponent tgctmp; + if (tgc2.getY() < tgc1.getY()) { + tgctmp = tgc1; + tgc1 = tgc2; + tgc2 = tgctmp; + } + + // each y between the two components should be in a coregion + for(int i=tgc1.getY(); i<tgc2.getY()+1; i++) { + if (!isInCoregion(i)) { + return false; + } + } + + return true; + + } + + // previous in the sense of with y the closer and before + public TGComponent getPreviousTGComponent(TGComponent tgcToAnalyse) { + int close = Integer.MAX_VALUE; + TGComponent tgc; + TGComponent tgcfound = null; + int diff; + + for(int i=0; i<nbInternalTGComponent; i++) { + tgc = tgcomponent[i]; + if (tgc != tgcToAnalyse) { + diff = tgcToAnalyse.getY() - tgc.getY(); + if ((diff > 0) && (diff < close)) { + if (!inSameCoregion(tgcToAnalyse, tgc)) { + close = diff; + tgcfound = tgc; + } + + } + } + } + + return tgcfound; + } + + public TGComponent getTGComponentActionCloserTo(TGComponent tgc) { + /* action : message send, message receive, other ? */ + /* timers ? */ + /* now: only message! */ + + return ((SequenceDiagramPanel)tdp).messageActionCloserTo(tgc, this); + + } + + + + public Point modifyInHeight(int newy) { + ((SequenceDiagramPanel)(tdp)).updateAllInstanceMinMaxSize(); + return super.modifyInHeight(newy); + } + + + // Used when there is a rescale or a component added + public int getMinHeightSize() { + int msize = (int)(250*tdp.getZoom()); + int i; + + /*for(i=0; i<connectingPoint.length ; i++) { + if (!(connectingPoint[i].isFree())) { + TraceManager.addDev("Found a non free connecting point y=" + connectingPoint[i].getY() + " heightOfPt=" + (connectingPoint[i].getY() - y + spacePt())); + msize = Math.max(msize, connectingPoint[i].getY() - y + spacePt() ); + } + }*/ + + for(i=0; i<nbInternalTGComponent ; i++) { + msize = Math.max(msize, tgcomponent[i].getY() + tgcomponent[i].getHeight()- y + spacePt()); + } + + TraceManager.addDev("Min height size of " + name + " =" + msize + " height=" + height); + + return msize; + } + + // Method called when there is a resize order + public void setUserResize(int desired_x, int desired_y, int desired_width, int desired_height) { + //System.out.println("newx = " + desired_x + " newy = " + desired_y + " minWidth = " + minWidth); + + setCd(desired_x, desired_y); + actionOnUserResize(desired_width, desired_height); + ((SequenceDiagramPanel)tdp).instanceHasBeenResized(this, desired_width, desired_height); + } + + + public void hasBeenResized(){ + /*TraceManager.addDev("Has been resized: " + name + " height=" + height); + int i; + + for (int k=0; k<nbConnectingPoint; k++) { + if (!connectingPoint[k].isFree()) { + TraceManager.addDev("Non free TG point in " + name); + } + } + + TGConnectingPoint [] connectingPointTmp = connectingPoint; + makeTGConnectingPoints(); + //nbConnectingPoint = getNbOfConnectingPoints(); + //connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + for(i=0; i<Math.min(connectingPointTmp.length, connectingPoint.length); i++) { + connectingPoint[i] = connectingPointTmp[i]; + + if (!connectingPoint[i].isFree()) { + TraceManager.addDev("Non free point in " + name); + } + } + + for (int j=nbConnectingPoint; j<connectingPointTmp.length; j++) { + if (!connectingPointTmp[j].isFree()) { + TraceManager.addDev("Non free TG point"); + } + }*/ + + // Increase tdp if necessary? + + // Reposition each swallowed component + for(int i=0; i<nbInternalTGComponent ; i++) { + setCDRectangleOfSwallowed(tgcomponent[i]); + } + } + + private void setCDRectangleOfSwallowed(TGComponent tgc) { + if ((tgc instanceof SDAbsoluteTimeConstraint) || (tgc instanceof SDRelativeTimeConstraint)){ + tgc.setCdRectangle((width/2) - tgc.getWidth(), (width/2), (int)(spacePt()), height-(int)(spacePt())); + } + + if ((tgc instanceof SDActionState) || (tgc instanceof SDGuard) || (tgc instanceof SDCoregion) || (tgc instanceof SDTimeInterval) || (tgc instanceof SDPortForMessage)) { + tgc.setCdRectangle((width/2), (width/2), (int)(spacePt()), height-(int)(spacePt())-tgc.getHeight()); + } + + if (tgc instanceof SDTimerSetting) { + tgc.setCdRectangle((width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerSetting)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + } + + if (tgc instanceof SDTimerExpiration) { + tgc.setCdRectangle((width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerExpiration)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + } + + if (tgc instanceof SDTimerCancellation) { + tgc.setCdRectangle((width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (width/2) + ((SDTimerCancellation)tgc).getLineLength() - tgc.getWidth()/2, (int)(spacePt()) - tgc.getHeight()/2, height-(int)(spacePt())-tgc.getHeight() / 2); + } + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Actor data=\""); + sb.append(""+isActor); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra synchro ***"); + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //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); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Actor")) { + if (elt.getAttribute("data").compareTo("true") == 0) { + isActor = true; + } + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + + public void setActor(boolean b) { + isActor = b; + } + + public void specificActionAfterAdd() { + makePortMessage(); + } + +} diff --git a/src/ui/sd/SDPortForMessage.java b/src/ui/sd2/SDPortForMessage.java similarity index 87% rename from src/ui/sd/SDPortForMessage.java rename to src/ui/sd2/SDPortForMessage.java index e68d30b0eb4d904e6132d6df3dd526d47c1a56d4..ceeeb3c53b3d7390f05169c82ce32f69eafd7ea3 100755 --- a/src/ui/sd/SDPortForMessage.java +++ b/src/ui/sd2/SDPortForMessage.java @@ -45,7 +45,7 @@ * @see */ -package ui.sd; +package ui.sd2; import java.awt.*; import javax.swing.*; @@ -57,7 +57,7 @@ import ui.window.*; -public class SDPortForMessage extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { +public class SDPortForMessage extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { //private int lineLength = 5; //private int textX, textY; @@ -89,8 +89,18 @@ public class SDPortForMessage extends TGCScalableWithoutInternalComponent imple public void internalDrawing(Graphics g) { //TraceManager.addDev("Internal drawing of SDProtForMessage"); - //g.drawString("Coucou", x, y); - g.drawOval(x-width/2, y, width, height); + //g.drawString("Coucou", x, y + + if (state == TGState.POINTER_ON_ME){ + int r = width/2; + int xOrigin = x - r/2; + int yOrigin = y + (height/2) - (r/2); + + //TraceManager.addDev("xOrigin=" + xOrigin + " y=" + yOrigin); + + g.fillOval(xOrigin, yOrigin, r, r); + g.drawRect(x-width/2, y, width, height); + } } @@ -104,7 +114,7 @@ public class SDPortForMessage extends TGCScalableWithoutInternalComponent imple public int getType() { - return TGComponentManager.SD_PORT_MESSAGE; + return TGComponentManager.SDZV_PORT_MESSAGE; } private void makeTGConnectingPoints() { diff --git a/src/ui/sd2/SDRelativeTimeConstraint.java b/src/ui/sd2/SDRelativeTimeConstraint.java new file mode 100755 index 0000000000000000000000000000000000000000..29a1ee80029cdf47a50fe297cd586fc59f5a479d --- /dev/null +++ b/src/ui/sd2/SDRelativeTimeConstraint.java @@ -0,0 +1,98 @@ +/**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 SDRelativeTimeConstraint + * Line of the relative time constraint. To be used in Sequence Diagrams. + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class SDRelativeTimeConstraint extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { + + public SDRelativeTimeConstraint(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(40 * tdp.getZoom()); + height = (int)(15 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + //width = 40; + //height = 15; + + nbConnectingPoint = 1; + connectingPoint = new TGConnectingPoint[nbConnectingPoint]; + connectingPoint[0] = new TGConnectingPointTimeConstraintSD(this, 10, 0, true, true); + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + editable = false; + removable = true; + + name = "Line of relative time constraint"; + value = "rtc"; + + myImageIcon = IconManager.imgic508; + } + + public void internalDrawing(Graphics g) { + g.drawLine(x, y, x+width, y); + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y - height/2, width, height)) { + return this; + } + + return null; + } + + + public int getType() { + return TGComponentManager.SDZV_RELATIVE_TIME_CONSTRAINT; + } +} diff --git a/src/ui/sd2/SDTimeInterval.java b/src/ui/sd2/SDTimeInterval.java new file mode 100755 index 0000000000000000000000000000000000000000..5b43e9a1b34d3d62efaf342b33f01a4286770b22 --- /dev/null +++ b/src/ui/sd2/SDTimeInterval.java @@ -0,0 +1,129 @@ +/**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 SDTimeInterval + * Time interval in a scenario + * Creation: 23/08/2006 + * @version 1.0 23/08/2006 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class SDTimeInterval extends TGCTimeInterval implements SwallowedTGComponent { + private int textX, textY; + private int incrementY = 3; + private int segment = 4; + private int wtext = 0; + private int htext = 0; + + public SDTimeInterval(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(10 * tdp.getZoom()); + height = (int)(30 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsCommentMiddle(); + + nbInternalTGComponent = 0; + tgcomponent = new TGComponent[nbInternalTGComponent]; + + + moveable = true; + editable = true; + removable = true; + + name = "time interval"; + makeValue(); + + myImageIcon = IconManager.imgic512; + } + + public void internalDrawing(Graphics g) { + textX = width/2 + 5; + textY = height/2 + 5; + + g.drawRect(x-width/2, y, width, height); + //g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); + //g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); + //w = g.getFontMetrics().stringWidth(value); + + g.drawString(value, x + textX, y + textY); + + if (!tdp.isScaled()) { + wtext = g.getFontMetrics().stringWidth(value); + htext = g.getFontMetrics().getHeight(); + //System.out.println("wtext=" + wtext + " htext=" + htext); + } + + int y1 = y + 4; + int x1 = x + 2 - width/2; + int width1 = width - 4; + int incrementYtmp = (int)(incrementY*tdp.getZoom()); + + for (int i=0; i<segment; i++) { + g.drawLine(x1, y1, x1+width1, y1+incrementYtmp); + y1 += incrementYtmp; + g.drawLine(x1+width1, y1, x1, y1+incrementYtmp); + y1 += incrementYtmp; + } + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x - width/2, y, width, height)) { + return this; + } + if (GraphicLib.isInRectangle(_x, _y, x +textX, y-htext+textY+2, wtext, htext)) { + return this; + } + return null; + } + + public int getType() { + return TGComponentManager.SDZV_TIME_INTERVAL; + } + +} diff --git a/src/ui/sd2/SDTimerCancellation.java b/src/ui/sd2/SDTimerCancellation.java new file mode 100755 index 0000000000000000000000000000000000000000..42b98e391b30d6766d07529e88502ac0894bf623 --- /dev/null +++ b/src/ui/sd2/SDTimerCancellation.java @@ -0,0 +1,222 @@ +/**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 SDTimerCancellation +* Setting of a timer for a given duration. To be used in Sequence Diagrams. +* Creation: 07/10/2004 +* @version 1.0 07/10/2004 +* @author Ludovic APVRILLE +* @see +*/ + +package ui.sd2; + +import java.awt.*; +import javax.swing.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; + +public class SDTimerCancellation extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { + private String timer = "myTimer"; + private int widthValue, heightValue; + private int lineWidth = 20; + + public SDTimerCancellation(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(15 * tdp.getZoom()); + height = (int)(25 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + + moveable = true; + editable = true; + removable = true; + + name = "timer cancellation"; + makeValue(); + widthValue = 0; heightValue=0; + + myImageIcon = IconManager.imgic518; + } + + public void internalDrawing(Graphics g) { + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, x+width, y+height/2+3); + + g.drawLine(x, y, x+width, y+height); + //g.drawLine(x, y, x+width, y); + //g.drawLine(x, y+height, x+width, y+height); + g.drawLine(x+width, y, x, y+height); + + g.drawLine(x+width/2-lineWidth, y+height/2, x+width/2, y+height/2); + } + + public int getLineLength() { + return lineWidth; + } + + public int getYOrder() { + return y+height/2; + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + + /* text */ + if (GraphicLib.isInRectangle(_x, _y, x+width, y+height/2-heightValue+3, widthValue, heightValue)) { + return this; + } + + /* line */ + if (GraphicLib.isInRectangle(_x, _y, x+width/2-lineWidth, y+height/2-2, lineWidth, 4)) { + return this; + } + return null; + } + + public int getMyCurrentMaxX() { + return x+width + widthValue; + } + + + public int getType() { + return TGComponentManager.SDZV_TIMER_CANCELLATION; + } + + public String getTimer() { + return timer; + } + + public void makeValue() { + value = "{timer=" + timer + "}"; + } + + public boolean editOndoubleClick(JFrame frame) { + String oldValue = timer; + String text = getName() + ": "; + if (hasFather()) { + text = getTopLevelName() + " / " + text; + } + String s = (String)JOptionPane.showInputDialog(frame, text, + "setting timer value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, + null, + getTimer()); + + if (s != null) { + s = s.trim(); + } + if ((s != null) && (s.length() > 0) && (!s.equals(oldValue))) { + if (!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not perform any change: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + timer = s; + makeValue(); + return true; + } + return false; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Interval timer=\""); + sb.append(getTimer()); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra timer name ***"); + boolean timerSet = false; + + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //System.out.println(n1); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + for(int j=0; i<nli.getLength(); j++) { + n2 = nli.item(j); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + //System.out.println("towards Interval"); + elt = (Element) n2; + //System.out.println("No more Interval"); + if (elt.getTagName().equals("Interval")) { + //System.out.println("working on Interval"); + timer = elt.getAttribute("timer"); + timerSet = true; + //System.out.println("timer=" + timer); + } + } + } + } + } + + } catch (Exception e) { + //System.out.println("Exception =" + e.getMessage()); + if (!timerSet) { + throw new MalformedModelingException(); + } + + } + makeValue(); + } +} diff --git a/src/ui/sd2/SDTimerExpiration.java b/src/ui/sd2/SDTimerExpiration.java new file mode 100755 index 0000000000000000000000000000000000000000..2a267dc426865eff99a1db0bc97f30c216941e6c --- /dev/null +++ b/src/ui/sd2/SDTimerExpiration.java @@ -0,0 +1,214 @@ +/**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 SDTimerExpiration + * Setting of a timer for a given duration. To be used in Sequence Diagrams. + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; +import javax.swing.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; + +public class SDTimerExpiration extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { + private String timer = "myTimer"; + private int widthValue, heightValue; + private int lineWidth = 20; + + public SDTimerExpiration(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(15 * tdp.getZoom()); + height = (int)(25 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + editable = true; + removable = true; + + name = "timer expiration"; + makeValue(); + widthValue = 0; heightValue=0; + + myImageIcon = IconManager.imgic516; + } + + public void internalDrawing(Graphics g) { + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, x+width, y+height/2+3); + + g.drawLine(x, y, x+width, y+height); + g.drawLine(x, y, x+width, y); + g.drawLine(x, y+height, x+width, y+height); + g.drawLine(x+width, y, x, y+height); + + GraphicLib.arrowWithLine(g, 2, 0, 10, x+width/2-lineWidth, y+height/2, x+width/2, y+height/2, true); + } + + public int getLineLength() { + return lineWidth; + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + + /* text */ + if (GraphicLib.isInRectangle(_x, _y, x+width, y+height/2-heightValue+3, widthValue, heightValue)) { + return this; + } + + /* line */ + if (GraphicLib.isInRectangle(_x, _y, x+width/2-lineWidth, y+height/2-2, lineWidth, 4)) { + return this; + } + return null; + } + + public int getMyCurrentMaxX() { + return x+width + widthValue; + } + + public int getType() { + return TGComponentManager.SDZV_TIMER_EXPIRATION; + } + + public String getTimer() { + return timer; + } + + public int getYOrder() { + return y+height/2; + } + + public void makeValue() { + value = "{timer=" + timer + "}"; + } + + public boolean editOndoubleClick(JFrame frame) { + String oldValue = timer; + String text = getName() + ": "; + if (hasFather()) { + text = getTopLevelName() + " / " + text; + } + String s = (String)JOptionPane.showInputDialog(frame, text, + "setting timer value", JOptionPane.PLAIN_MESSAGE, IconManager.imgic101, + null, + getTimer()); + + if (s != null) { + s = s.trim(); + } + if ((s != null) && (s.length() > 0) && (!s.equals(oldValue))) { + if (!TAttribute.isAValidId(s, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not perform any change: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + return false; + } + timer = s; + makeValue(); + return true; + } + return false; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Interval timer=\""); + sb.append(getTimer()); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra synchro ***"); + boolean timerSet = false; + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //System.out.println(n1); + if (n1.getNodeType() == Node.ELEMENT_NODE) { + nli = n1.getChildNodes(); + 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; + if (elt.getTagName().equals("Interval")) { + timer = elt.getAttribute("timer"); + timerSet = true; + } + } + } + } + } + + } catch (Exception e) { + //System.out.println("Exception =" + e.getMessage()); + if (!timerSet) { + throw new MalformedModelingException(); + } + } + makeValue(); + } +} diff --git a/src/ui/sd2/SDTimerSetting.java b/src/ui/sd2/SDTimerSetting.java new file mode 100755 index 0000000000000000000000000000000000000000..87925ffee7d085ec371a90b9fd7e06ff0d43a512 --- /dev/null +++ b/src/ui/sd2/SDTimerSetting.java @@ -0,0 +1,244 @@ +/**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 SDTimerSetting + * Setting of a timer for a given duration. To be used in Sequence Diagrams. + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; +import javax.swing.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + +public class SDTimerSetting extends TGCScalableWithoutInternalComponent implements SwallowedTGComponent { + private String timer = "myTimer"; + private String duration = "10"; + private int widthValue, heightValue; + private int lineWidth = 20; + + public SDTimerSetting(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) { + super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); + + width = (int)(15 * tdp.getZoom()); + height = (int)(25 * tdp.getZoom()); + oldScaleFactor = tdp.getZoom(); + + nbConnectingPoint = 0; + addTGConnectingPointsComment(); + + nbInternalTGComponent = 0; + + moveable = true; + editable = true; + removable = true; + + name = "setting timer"; + makeValue(); + widthValue = 0; heightValue=0; + + myImageIcon = IconManager.imgic514; + } + + public void internalDrawing(Graphics g) { + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, x+width, y+height/2+3); + + g.drawLine(x, y, x+width, y+height); + g.drawLine(x, y, x+width, y); + g.drawLine(x, y+height, x+width, y+height); + g.drawLine(x+width, y, x, y+height); + + g.drawLine(x+width/2-lineWidth, y+height/2, x+width/2, y+height/2); + } + + public int getLineLength() { + return lineWidth; + } + + public int getYOrder() { + return y+height/2; + } + + public TGComponent isOnMe(int _x, int _y) { + if (GraphicLib.isInRectangle(_x, _y, x, y, width, height)) { + return this; + } + + /* text */ + if (GraphicLib.isInRectangle(_x, _y, x+width, y+height/2-heightValue+3, widthValue, heightValue)) { + return this; + } + + /* line */ + if (GraphicLib.isInRectangle(_x, _y, x+width/2-lineWidth, y+height/2-2, lineWidth, 4)) { + return this; + } + return null; + } + + public int getMyCurrentMaxX() { + return x+width + widthValue; + } + + public int getType() { + return TGComponentManager.SDZV_TIMER_SETTING; + } + + public String getTimer() { + return timer; + } + + public String getDuration() { + return duration; + } + + public void makeValue() { + value = "{timer=" + timer + ", duration=" + duration + "}"; + } + + public boolean editOndoubleClick(JFrame frame) { + String oldMin = getTimer(); + String oldMax = getDuration(); + String[] array = new String[2]; + array[0] = getTimer(); array[1] = getDuration(); + + JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting absolute time constraints", "timer", "duration"); + //jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti, 350, 250); + jdti.setVisible( true ); // blocked until dialog has been closed + + timer = array[0]; duration = array[1]; + + if ((timer != null) && (duration != null) && ((!timer.equals(oldMin)) || (!duration.equals(oldMax)))){ + timer = timer.trim(); + duration = duration.trim(); + if (!TAttribute.isAValidId(timer, false, false)) { + JOptionPane.showMessageDialog(frame, + "Could not perform any change: the new name is not a valid name", + "Error", + JOptionPane.INFORMATION_MESSAGE); + timer = oldMin; + duration = oldMax; + return false; + } + + boolean isInteger = true; + try { + /*int tg =*/ Integer.parseInt(duration); + } catch (NumberFormatException nfe) { + isInteger = false; + } + + if ((!TAttribute.isAValidId(duration, false, false)) && (isInteger == false)) { + JOptionPane.showMessageDialog(frame, + "Could not perform any change: the new duration is not a valid duration", + "Error", + JOptionPane.INFORMATION_MESSAGE); + timer = oldMin; + duration = oldMax; + return false; + } + makeValue(); + return true; + } + + timer = oldMin; + duration = oldMax; + return false; + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Interval timer=\""); + sb.append(getTimer()); + sb.append("\" duration=\""); + sb.append(getDuration()); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra synchro ***"); + boolean timerSet = false; + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //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); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("Interval")) { + timer = elt.getAttribute("timer"); + duration = elt.getAttribute("duration"); + timerSet = true; + } + } + } + } + } + + } catch (Exception e) { + if (!timerSet) { + throw new MalformedModelingException(); + } + } + makeValue(); + } +} diff --git a/src/ui/sd2/SequenceDiagramPanel.java b/src/ui/sd2/SequenceDiagramPanel.java new file mode 100755 index 0000000000000000000000000000000000000000..3f17dde1bd192886593e64cd71c875e1cc113bf7 --- /dev/null +++ b/src/ui/sd2/SequenceDiagramPanel.java @@ -0,0 +1,397 @@ +/**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 SequenceDiagramPanel + * Panel for drawing a sequence diagram + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import myutil.*; + +//import java.awt.*; +import java.util.*; + +import ui.*; + +public class SequenceDiagramPanel extends TDiagramPanel { + + public SequenceDiagramPanel(MainGUI mgui, TToolBar _ttb) { + super(mgui, _ttb); + /*TDiagramMouseManager tdmm = new TDiagramMouseManager(this); + addMouseListener(tdmm); + addMouseMotionListener(tdmm);*/ + } + + public boolean actionOnDoubleClick(TGComponent tgc) { + //System.out.println("Action"); + /*if (tgc instanceof TCDTClass) { + TCDTClass t = (TCDTClass)tgc; + return mgui.newTClassName(t.oldValue, t.getValue()); + } else if (tgc instanceof TCDActivityDiagramBox) { + if (tgc.getFather() instanceof TCDTClass) { + mgui.selectTab(tgc.getFather().getValue()); + } else if (tgc.getFather() instanceof TCDTObject) { + TCDTObject to = (TCDTObject)(tgc.getFather()); + TCDTClass t = to.getMasterTClass(); + if (t != null) { + mgui.selectTab(t.getValue()); + } + } + return false; // because no change made on any diagram + }*/ + return false; + } + + public boolean actionOnAdd(TGComponent tgc) { + /*if (tgc instanceof TCDTClass) { + TCDTClass tgcc = (TCDTClass)(tgc); + mgui.addTClass(tgcc.getClassName()); + return true; + }*/ + + + //TraceManager.addDev("Added elt"); + return false; + } + + public boolean actionOnRemove(TGComponent tgc) { + /*if (tgc instanceof TCDTClass) { + TCDTClass tgcc = (TCDTClass)(tgc); + mgui.removeTClass(tgcc.getClassName()); + resetAllInstancesOf(tgcc); + return true; + }*/ + //TraceManager.addDev("Removed elt"); + return false; + } + + public boolean actionOnValueChanged(TGComponent tgc) { + /*if (tgc instanceof TCDTClass) { + return actionOnDoubleClick(tgc); + }*/ + //TraceManager.addDev("Value changed"); + return false; + } + + public String getXMLHead() { + return "<SequenceDiagramPanelZV name=\"" + name + "\"" + sizeParam() + " >"; + } + + public String getXMLTail() { + return "</SequenceDiagramPanelZV>"; + } + + public String getXMLSelectedHead() { + return "<SequenceDiagramPanelZVCopy name=\"" + name + "\" xSel=\"" + xSel + "\" ySel=\"" + ySel + "\" widthSel=\"" + widthSel + "\" heightSel=\"" + heightSel + "\" >"; + } + + public String getXMLSelectedTail() { + return "</SequenceDiagramPanelZVCopy>"; + } + + public String getXMLCloneHead() { + return "<SequenceDiagramPanelZVCopy name=\"" + name + "\" xSel=\"" + 0 + "\" ySel=\"" + 0 + "\" widthSel=\"" + 0 + "\" heightSel=\"" + 0 + "\" >"; + } + + public String getXMLCloneTail() { + return "</SequenceDiagramPanelZVCopy>"; + } + + public void makePostLoadingProcessing() throws MalformedModelingException { + TGComponent tgc; + + /*for(int i=0; i<componentList.size(); i++) { + tgc = (TGComponent)(componentList.elementAt(i)); + if (tgc instanceof TCDTObject) { + ((TCDTObject)tgc).postLoadingProcessing(); + } + }*/ + } + + public SDInstance getSDInstance(String name) { + TGComponent tgc; + Iterator iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if (tgc instanceof SDInstance) { + if (tgc.getValue().compareTo(name) ==0) { + return (SDInstance)tgc; + } + } + } + return null; + } + + + public void alignInstances() { + SDInstance ontheLeft = null, sdi; + int x = getMaxX(),xtmp; + int y; + int i; + TGComponent tgc; + Iterator iterator = componentList.listIterator(); + + // search for the instances which is the most on the left + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if (tgc instanceof SDInstance) { + xtmp = tgc.getX(); + if (xtmp < x) { + x = xtmp; + ontheLeft = (SDInstance)tgc; + } + } + } + + if (ontheLeft == null) + return; + + // move accordingly other instances + y = ontheLeft.getY(); + iterator = componentList.listIterator(); + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + if ((tgc instanceof SDInstance) && (tgc != ontheLeft)){ + tgc.setCd(tgc.getX(), y); + } + } + + } + + public TGConnectorRelativeTimeSD firstAndConnectedSDRelativeTimeConstraint(TGComponent tgc) { + TGComponent tmp; + TGConnectingPoint p1; + Iterator iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tmp = (TGComponent)(iterator.next()); + if (tmp instanceof TGConnectorRelativeTimeSD){ + p1 = ((TGConnector)tmp).getTGConnectingPointP1(); + if (tgc.belongsToMe(p1)) { + return (TGConnectorRelativeTimeSD)tmp; + } + } + } + return null; + } + + public TGComponent getSecondTGComponent(TGConnector tgco) { + TGComponent tmp; + TGComponent tmp1; + TGConnectingPoint p2 = tgco.getTGConnectingPointP2(); + Iterator iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tmp = (TGComponent)(iterator.next()); + tmp1 = tmp.belongsToMeOrSon(p2); + if (tmp1 != null) { + return tmp1; + } + } + + return null; + } + + public TGConnector messageActionCloserTo(TGComponent tgc, SDInstance sd) { + int distance = 25; + TGConnector found = null; + TGComponent tmp; + TGConnectingPoint p; + Iterator iterator = componentList.listIterator(); + + while(iterator.hasNext()) { + tmp = (TGComponent)(iterator.next()); + if (tmp instanceof TGConnectorMessageSD){ + p = ((TGConnector)tmp).getTGConnectingPointP1(); + if (sd.belongsToMe(p)) { + if (Math.abs(p.getY() - tgc.getY()) < distance) { + distance = Math.abs(p.getY() - tgc.getY()); + found = (TGConnector)tmp; + } + } + p = ((TGConnector)tmp).getTGConnectingPointP2(); + if (sd.belongsToMe(p)) { + if (Math.abs(p.getY() - tgc.getY()) < distance) { + distance = Math.abs(p.getY() - tgc.getY()); + found = (TGConnector)tmp; + } + } + } + } + return found; + } + + public TGConnectingPoint TGConnectingPointActionCloserTo(TGComponent tc1, TGConnector tgco, SDInstance sdi) { + TGConnectingPoint p1, p2; + p1 = tgco.getTGConnectingPointP1(); + p2 = tgco.getTGConnectingPointP2(); + + boolean hasp1 = sdi.belongsToMe(p1); + boolean hasp2 = sdi.belongsToMe(p2); + + if ((!hasp1) && (!hasp2)) { + return null; + } + + if ((hasp1) && (!hasp2)) { + return p1; + } + + if ((!hasp1) && (hasp2)) { + return p2; + } + + // both belongs to the sdinstance + int y1 = p1.getY(); + int y2 = p2.getY(); + + if ((Math.abs(y2-tc1.getY())) < ((Math.abs(y1-tc1.getY())))) { + return p2; + } else { + return p1; + } + } + + public TGComponent getActionCloserTo(int y, SDInstance sdi) { + int distance = 25; + TGComponent tgc, found = null; + //System.out.println("GetActionCloserTo y=" + y); + for(int i=0; i<sdi.getNbInternalTGComponent(); i++) { + tgc = sdi.getInternalTGComponent(i) ; + //System.out.println("tgc=" + tgc.getName() + " y=" + tgc.getY()); + if (tgc instanceof SDActionState) { + if (Math.abs(y-tgc.getY()) < distance) { + //System.out.println("Found!"); + found = tgc; + distance = Math.abs(y-tgc.getY()); + } else { + //System.out.println("Not found!"); + } + } + } + return found; + } + + // For MSCDrawer + public void increaseInstanceSize(int size) { + Iterator iterator = componentList.listIterator(); + TGComponent tgc; + int maxYH = 0; + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + + if (tgc instanceof SDInstance) { + tgc.setUserResize(tgc.getX(), tgc.getY(), tgc.getWidth(), tgc.getHeight() + size); + } + + maxYH = Math.max(maxYH, tgc.getY() + tgc.getHeight()); + } + + if (maxYH > getMaxY()) { + setMaxY(getMaxY() + increment); + updateSize(); + } + } + + + public void updateAllInstanceMinMaxSize() { + Iterator iterator = componentList.listIterator(); + TGComponent tgc; + + int minSize = 0; + + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + + if (tgc instanceof SDInstance) { + ((SDInstance)tgc).computeMinHeight(); + } + } + + } + + + public void instanceHasBeenResized(SDInstance _ins, int _w, int _h) { + Iterator iterator = componentList.listIterator(); + TGComponent tgc; + + while(iterator.hasNext()) { + tgc = (TGComponent)(iterator.next()); + + if ((tgc instanceof SDInstance) && (tgc != _ins)) { + tgc.actionOnUserResize(_w, _h); + } + } + } + + public void switchToSynchronousMessage(TGConnectorMessageAsyncSD oldOne) { + int x1 = oldOne.getX(); + int y1 = oldOne.getY(); + TGConnectingPoint p1 = oldOne.getTGConnectingPointP1(); + TGConnectingPoint p2 = oldOne.getTGConnectingPointP2(); + + Vector listPoint = oldOne.getListOfPoints(); + removeComponent(oldOne); + TGConnector newOne = TGComponentManager.addConnector(x1, y1, TGComponentManager.CONNECTOR_MESSAGE_SYNC_SD, this, p1, p2, listPoint); + addBuiltConnector(newOne); + //TraceManager.addDev("Element added"); + repaint(); + } + + public void switchToAsynchronousMessage(TGConnectorMessageSyncSD oldOne) { + int x1 = oldOne.getX(); + int y1 = oldOne.getY(); + TGConnectingPoint p1 = oldOne.getTGConnectingPointP1(); + TGConnectingPoint p2 = oldOne.getTGConnectingPointP2(); + + Vector listPoint = oldOne.getListOfPoints(); + removeComponent(oldOne); + TGConnector newOne = TGComponentManager.addConnector(x1, y1, TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SD, this, p1, p2, listPoint); + addBuiltConnector(newOne); + //TraceManager.addDev("Element added"); + repaint(); + } +} diff --git a/src/ui/sd2/SequenceDiagramToolBar.java b/src/ui/sd2/SequenceDiagramToolBar.java new file mode 100755 index 0000000000000000000000000000000000000000..0b3513ec124f12588644383af827dc72bb4173c3 --- /dev/null +++ b/src/ui/sd2/SequenceDiagramToolBar.java @@ -0,0 +1,156 @@ +/**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 SequenceDiagramToolBar + * Implements the toolbar to be used in conjunction with the panel of a sequence diagram + * Creation: 30/09/2004 + * @version 1.0 30/09/2004 + * @author Ludovic APVRILLE + * @see SequenceDiagramPanel + */ + +package ui.sd2; + +import javax.swing.*; + +import ui.*; + +public class SequenceDiagramToolBar extends TToolBar { + + public SequenceDiagramToolBar(MainGUI _mgui) { + super(_mgui); + } + + protected void setActive(boolean b) { + mgui.actions[TGUIAction.SDZV_EDIT].setEnabled(b); + mgui.actions[TGUIAction.UML_NOTE].setEnabled(b); + mgui.actions[TGUIAction.CONNECTOR_COMMENT].setEnabled(b); + mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_SYNC].setEnabled(b); + mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_ASYNC].setEnabled(b); + mgui.actions[TGUIAction.SDZV_INSTANCE].setEnabled(b); + mgui.actions[TGUIAction.SDZV_ACTION_STATE].setEnabled(b); + mgui.actions[TGUIAction.SDZV_GUARD].setEnabled(b); + mgui.actions[TGUIAction.SDZV_COREGION].setEnabled(b); + mgui.actions[TGUIAction.SDZV_TIME_INTERVAL].setEnabled(b); + mgui.actions[TGUIAction.SDZV_TIMER_SETTING].setEnabled(b); + mgui.actions[TGUIAction.SDZV_TIMER_EXPIRATION].setEnabled(b); + mgui.actions[TGUIAction.SDZV_TIMER_CANCELLATION].setEnabled(b); + mgui.actions[TGUIAction.SDZV_ABSOLUTE_TIME_CONSTRAINT].setEnabled(b); + mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT].setEnabled(b); + mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT_CONNECTOR].setEnabled(b); + mgui.actions[TGUIAction.SDZV_ALIGN_INSTANCES].setEnabled(b); + + mgui.actions[TGUIAction.ACT_ZOOM_MORE].setEnabled(b); + mgui.actions[TGUIAction.ACT_ZOOM_LESS].setEnabled(b); + mgui.actions[TGUIAction.ACT_SHOW_ZOOM].setEnabled(b); + mgui.updateZoomInfo(); + } + + protected void setButtons() { + JButton button; + + button = this.add(mgui.actions[TGUIAction.SDZV_EDIT]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.UML_NOTE]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.CONNECTOR_COMMENT]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_SYNC]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_CONNECTOR_MESSAGE_ASYNC]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_INSTANCE]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_ACTION_STATE]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_GUARD]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_COREGION]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_TIMER_SETTING]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_TIMER_CANCELLATION]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_TIMER_EXPIRATION]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_TIME_INTERVAL]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_ABSOLUTE_TIME_CONSTRAINT]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT]); + button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.SDZV_RELATIVE_TIME_CONSTRAINT_CONNECTOR]); + button.addMouseListener(mgui.mouseHandler); + + this.addSeparator(); + this.addSeparator(); + + button = this.add(mgui.actions[TGUIAction.SDZV_ALIGN_INSTANCES]); + button.addMouseListener(mgui.mouseHandler); + } + +} // Class diff --git a/src/ui/sd2/TGConnectingPointMessageSD.java b/src/ui/sd2/TGConnectingPointMessageSD.java new file mode 100755 index 0000000000000000000000000000000000000000..a15c6e0baf2185dfadcca6227c4947c2a7e04343 --- /dev/null +++ b/src/ui/sd2/TGConnectingPointMessageSD.java @@ -0,0 +1,72 @@ +/**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 TGConnectingPointMessageSD + * Definition of connecting points on which connectors of sequence diagrams can be connected + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +//import java.awt.*; + +import ui.*; + +import myutil.*; + +public class TGConnectingPointMessageSD extends TGConnectingPointWidthHeight { + + public TGConnectingPointMessageSD(CDElement _container, int _x, int _y, boolean _in, boolean _out, double _w, double _h) { + super(_container, _x, _y, _in, _out, _w, _h); + } + + public boolean isCompatibleWith(int type) { + //TraceManager.addDev("is compatible with " + type); + if ((type == TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SDZV) || (type == TGComponentManager.CONNECTOR_MESSAGE_SYNC_SDZV)) { + //TraceManager.addDev("is compatible with " + type + " x= " + getX() + " y=" + getY()) ; + //System.out.println("is compatible with:true"); + return true; + } + //System.out.println("is compatible with:false"); + return false; + } + +} diff --git a/src/ui/sd2/TGConnectingPointTimeConstraintSD.java b/src/ui/sd2/TGConnectingPointTimeConstraintSD.java new file mode 100755 index 0000000000000000000000000000000000000000..b856937c3bd35a618f15b16d75ec93bb5a5f80a8 --- /dev/null +++ b/src/ui/sd2/TGConnectingPointTimeConstraintSD.java @@ -0,0 +1,69 @@ +/**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 TGConnectingPointTimeConstraintSD + * Definition of connecting points on which connectors of sequence diagrams can be connected + * Creation: 04/10/2004 + * @version 1.0 04/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +//import java.awt.*; + +import ui.*; + +public class TGConnectingPointTimeConstraintSD extends TGConnectingPoint{ + + public TGConnectingPointTimeConstraintSD(CDElement _container, int _x, int _y, boolean _in, boolean _out) { + super(_container, _x, _y, _in, _out); + } + + public boolean isCompatibleWith(int type) { + //System.out.println("is compatible with " + type); + if (type == TGComponentManager.CONNECTOR_RELATIVE_TIME_SDZV) { + //System.out.println("is compatible with:true"); + return true; + } + //System.out.println("is compatible with:false"); + return false; + } + +} diff --git a/src/ui/sd2/TGConnectorMessageAsyncOrSyncSD.java b/src/ui/sd2/TGConnectorMessageAsyncOrSyncSD.java new file mode 100755 index 0000000000000000000000000000000000000000..a0045a82a86d8935538a4e9071bf771bcb7370f6 --- /dev/null +++ b/src/ui/sd2/TGConnectorMessageAsyncOrSyncSD.java @@ -0,0 +1,164 @@ +/**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 TGConnectorMessageAsyncOrSyncSD + * Connector used in SD for exchanging messages between instances + * Creation: 18/04/2016 + * @version 1.0 18/04/2016 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + + +import java.awt.*; +import java.awt.geom.*; +import java.util.*; + +import myutil.*; +import ui.*; + + +public class TGConnectorMessageAsyncOrSyncSD extends TGConnectorMessageSD { + public boolean isAsync; + + protected int arrowLength = 10; + + public TGConnectorMessageAsyncOrSyncSD( int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, + TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, + Vector _listPoint ) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic504; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + if (isAsync) { + if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { + g.drawLine(x1, y1, x2, y2); + } else { + GraphicLib.arrowWithLine(g, 1, 1, 10, x1, y1, x2, y2, false); + } + + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); + } else { + if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { + g.drawLine(x1, y1, x2, y2); + } else { + GraphicLib.arrowWithLine(g, 1, 0, 10, x1, y1, x2, y2, true); + } + + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + //g.drawString(value, (p1.getX() + p2.getX()) / 2, ((p1.getY() + p2.getY()) / 2) - 5); + g.drawString(value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); + } + } + + public void setType(boolean _isAsync) { + isAsync = _isAsync; + } + + public int getType() { + if (isAsync) { + return TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SD; + } else { + return TGComponentManager.CONNECTOR_MESSAGE_SYNC_SD; + } + } + + protected String translateExtraParam() { + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<isAsync value=\"" + isAsync + "\" /> "); + sb.append("</extraparam>\n"); + return new String(sb); + } + + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + + String s; + String tmpGlobalCode = ""; + + try { + NodeList nli; + Node n1, n2; + Element elt; + isAsync = false; + + + //System.out.println("Loading attributes"); + //System.out.println(nl.toString()); + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //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); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + if (elt.getTagName().equals("isAsync")) { + s = elt.getAttribute("value"); + if (s.equals("true")) { + isAsync = true; + } else { + isAsync = false; + } + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + } + +} diff --git a/src/ui/sd2/TGConnectorMessageAsyncSD.java b/src/ui/sd2/TGConnectorMessageAsyncSD.java new file mode 100755 index 0000000000000000000000000000000000000000..7e7ac3afa682de8c86ae2ffc12e5ae9e423977a1 --- /dev/null +++ b/src/ui/sd2/TGConnectorMessageAsyncSD.java @@ -0,0 +1,101 @@ +/**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 TGConnectorMessageAsyncSD + * Connector used in SD for exchanging messages between instances + * Creation: 04/10/2004 + * @version 1.0 04/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + + +import java.awt.*; +import java.awt.geom.*; +import java.util.*; +import java.awt.event.*; +import javax.swing.*; + + + +import myutil.*; +import ui.*; + + +public class TGConnectorMessageAsyncSD extends TGConnectorMessageSD { + + protected int arrowLength = 10; + + public TGConnectorMessageAsyncSD( int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, + TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, + Vector _listPoint ) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic504; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { + g.drawLine(x1, y1, x2, y2); + } else { + GraphicLib.arrowWithLine(g, 1, 1, 10, x1, y1, x2, y2, false); + } + + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); + } + + public int getType() { + return TGComponentManager.CONNECTOR_MESSAGE_ASYNC_SD; + } + + public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) { + componentMenu.addSeparator(); + JMenuItem generate = null; + // Should verify first whether it is connected to a formal requirement with a verify relation, or not + generate = new JMenuItem(TO_SYNC); + + generate.addActionListener(menuAL); + componentMenu.add(generate); + } +} diff --git a/src/ui/sd2/TGConnectorMessageSD.java b/src/ui/sd2/TGConnectorMessageSD.java new file mode 100755 index 0000000000000000000000000000000000000000..5ecbcbe51838be3a8cdc7deab74e4e21ea6fe329 --- /dev/null +++ b/src/ui/sd2/TGConnectorMessageSD.java @@ -0,0 +1,181 @@ +/**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 TGConnectorMessageSD + * Connector used in SD for exchanging messages between instances + * Creation: 04/10/2004 + * @version 1.0 04/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + + + +import java.awt.event.*; +//import java.awt.geom.*; +import javax.swing.*; +import java.util.*; + +import myutil.*; +import ui.*; + +public abstract class TGConnectorMessageSD extends TGConnector { + public final String TO_SYNC = "To synchronous message"; + public final String TO_ASYNC = "To asynchronous message"; + + protected int arrowLength = 10; + protected int widthValue, heightValue; + + + + public TGConnectorMessageSD(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic202; + value = "msg?"; + editable = true; + } + + public String getMessage() { + return value; + } + + // Part before '()' section + public String getFirstPartMessage() { + int index0 = value.indexOf('('); + if (index0 == -1) { + return value; + } else { + return value.substring(0, index0); + } + } + + public String getSecondPartMessage() { + String tmp = value.trim(); + int index0 = tmp.indexOf('('); + if (index0 == -1) { + return ""; + } else { + return tmp.substring(index0, tmp.length()); + } + } + + public boolean isMessageWellFormed() { + //System.out.println("Analyzing message:" + value); + + int index0 = value.indexOf('('); + String name; + + if (index0 == -1) { + name = value; + } else { + name = value.substring(0, index0); + } + + if (!TAttribute.isAValidId(name, false, false)) { + return false; + } + + if (index0 == -1) { + return true; + } + + String tmp = value.trim(); + if (!tmp.endsWith(")")) { + return false; + } + + // Check for individual parameters + index0 = tmp.indexOf('('); + tmp = tmp.substring(index0+1, tmp.length()-1); + + String[] params = tmp.split(","); + for(int i=0; i<params.length; i++) { + tmp = params[i].trim(); + //System.out.println("First=" + tmp); + if (!TAttribute.isAValidId(tmp, false, false)) { + return false; + } + } + + return true; + } + + + + public boolean editOndoubleClick(JFrame frame) { + //System.out.println("Double click"); + String text = getName() + ": "; + if (hasFather()) { + text = getTopLevelName() + " / " + text; + } + String s = (String)JOptionPane.showInputDialog(frame, text, + "setting message name", JOptionPane.PLAIN_MESSAGE, IconManager.imgic100, + null, + getValue()); + if ((s != null) && (s.length() > 0)) { + setValue(s); + return true; + } + return false; + } + + public TGComponent extraIsOnOnlyMe(int x1, int y1) { + //System.out.println("Extra"); + if (GraphicLib.isInRectangle(x1, y1, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5 - heightValue, widthValue, heightValue)) { + return this; + } + return null; + } + + public boolean eventOnPopup(ActionEvent e) { + String s = e.getActionCommand(); + TraceManager.addDev("action: " + s); + if (s.indexOf(TO_SYNC) > -1) { + ((SequenceDiagramPanel)tdp).switchToSynchronousMessage((TGConnectorMessageAsyncSD)this); + TraceManager.addDev("To Sync message"); + } + if (s.indexOf(TO_ASYNC) > -1) { + ((SequenceDiagramPanel)tdp).switchToAsynchronousMessage((TGConnectorMessageSyncSD)this); + TraceManager.addDev("To async message"); + } + + return true; + } +} diff --git a/src/ui/sd2/TGConnectorMessageSyncSD.java b/src/ui/sd2/TGConnectorMessageSyncSD.java new file mode 100755 index 0000000000000000000000000000000000000000..67a46993c294caedafeae3e2f2d56495fa71ed87 --- /dev/null +++ b/src/ui/sd2/TGConnectorMessageSyncSD.java @@ -0,0 +1,96 @@ +/**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 TGConnectorMessageSyncSD + * Connector used in SD for exchanging messages between instances + * Creation: 04/10/2004 + * @version 1.0 04/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; +import java.awt.geom.*; +import java.util.*; +import java.awt.event.*; +import javax.swing.*; + +import myutil.*; +import ui.*; + +public class TGConnectorMessageSyncSD extends TGConnectorMessageSD { + protected int arrowLength = 10; + + public TGConnectorMessageSyncSD(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic502; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { + g.drawLine(x1, y1, x2, y2); + } else { + GraphicLib.arrowWithLine(g, 1, 0, 10, x1, y1, x2, y2, true); + } + + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + //g.drawString(value, (p1.getX() + p2.getX()) / 2, ((p1.getY() + p2.getY()) / 2) - 5); + g.drawString(value, ((p1.getX() + p2.getX()) / 2)-widthValue/2, ((p1.getY() + p2.getY()) / 2) - 5); + } + + public void addActionToPopupMenu(JPopupMenu componentMenu, ActionListener menuAL, int x, int y) { + componentMenu.addSeparator(); + JMenuItem generate = null; + // Should verify first whether it is connected to a formal requirement with a verify relation, or not + generate = new JMenuItem(TO_ASYNC); + + generate.addActionListener(menuAL); + componentMenu.add(generate); + } + + + public int getType() { + return TGComponentManager.CONNECTOR_MESSAGE_SYNC_SD; + } +} diff --git a/src/ui/sd2/TGConnectorRelativeTimeSD.java b/src/ui/sd2/TGConnectorRelativeTimeSD.java new file mode 100755 index 0000000000000000000000000000000000000000..ea8c5a8d156aaa5856e1e69156f4970bef7fc383 --- /dev/null +++ b/src/ui/sd2/TGConnectorRelativeTimeSD.java @@ -0,0 +1,189 @@ +/**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 TGConnectorRelativeTimeSD + * Connector used in SD for connecting relative time constraint lines + * Creation: 06/10/2004 + * @version 1.0 06/10/2004 + * @author Ludovic APVRILLE + * @see + */ + +package ui.sd2; + +import java.awt.*; +import java.awt.geom.*; +import javax.swing.*; +import java.util.*; +import org.w3c.dom.*; + +import myutil.*; +import ui.*; +import ui.window.*; + +public class TGConnectorRelativeTimeSD extends TGConnector { + protected int arrowLength = 10; + private String minConstraint = "0"; + private String maxConstraint = "0"; + private int widthValue, heightValue; + + public TGConnectorRelativeTimeSD(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { + super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); + myImageIcon = IconManager.imgic510; + name = "relative time constraint"; + value = "{0..0}"; + editable = true; + } + + protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ + if (Point2D.distance(x1, y1, x2, y2) < GraphicLib.longueur * 1.5) { + g.drawLine(x1, y1, x2, y2); + } else { + GraphicLib.arrowWithLine(g, 1, 0, 10, x1, y1, x2, y2, true); + } + + if (!tdp.isScaled()) { + widthValue = g.getFontMetrics().stringWidth(value); + heightValue = g.getFontMetrics().getHeight(); + } + + g.drawString(value, ((p1.getX() + p2.getX()) / 2) - widthValue - 2, ((p1.getY() + p2.getY()) / 2)); + } + + public TGComponent extraIsOnOnlyMe(int x1, int y1) { + if (GraphicLib.isInRectangle(x1, y1, ((p1.getX() + p2.getX()) / 2) - widthValue - 2, ((p1.getY() + p2.getY()) / 2 - heightValue), widthValue, heightValue)) { + return this; + } + return null; + } + + public int getMyCurrentMinX() { + return ((p1.getX() + p2.getX()) / 2) - widthValue - 2; + } + + public int getType() { + return TGComponentManager.CONNECTOR_RELATIVE_TIME_SDZV; + } + + public String getMinConstraint() { + return minConstraint; + } + + public String getMaxConstraint() { + return maxConstraint; + } + + public void makeValue() { + //System.out.println("Making value with min=" + minConstraint + " max= " + maxConstraint); + value = "{" + minConstraint + ".." + maxConstraint + "}"; + } + + public boolean editOndoubleClick(JFrame frame) { + String oldMin = getMinConstraint(); + String oldMax = getMaxConstraint(); + String[] array = new String[2]; + array[0] = getMinConstraint(); array[1] = getMaxConstraint(); + + JDialogTimeInterval jdti = new JDialogTimeInterval(frame, array, "Setting relative time constraints"); + //jdti.setSize(350, 250); + GraphicLib.centerOnParent(jdti, 350, 250); + jdti.setVisible( true ); // blocked until dialog has been closed + + minConstraint = array[0]; maxConstraint = array[1]; + + if ((minConstraint != null) && (maxConstraint != null) && ((!minConstraint.equals(oldMin)) || (!maxConstraint.equals(oldMax)))){ + makeValue(); + return true; + } + minConstraint = oldMin; + maxConstraint = oldMax; + return false; + } + + protected String translateExtraParam() { + //System.out.println("Translate extra"); + StringBuffer sb = new StringBuffer("<extraparam>\n"); + sb.append("<Interval minConstraint=\""); + sb.append(getMinConstraint()); + sb.append("\" maxConstraint=\""); + sb.append(getMaxConstraint()); + sb.append("\" />\n"); + sb.append("</extraparam>\n"); + return new String(sb); + } + + public void loadExtraParam(NodeList nl, int decX, int decY, int decId) throws MalformedModelingException{ + //System.out.println("*** load extra relative time ***"); + try { + NodeList nli; + Node n1, n2; + Element elt; + + for(int i=0; i<nl.getLength(); i++) { + n1 = nl.item(i); + //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); + //System.out.println(n2); + if (n2.getNodeType() == Node.ELEMENT_NODE) { + elt = (Element) n2; + //System.out.println("Reading constraints"); + if (elt.getTagName().equals("Interval")) { + minConstraint = elt.getAttribute("minConstraint"); + maxConstraint = elt.getAttribute("maxConstraint"); + } + } + } + } + } + + } catch (Exception e) { + throw new MalformedModelingException(); + } + makeValue(); + } +} + + + + + + +