From 01c4bc4df5cd8b466bd3f1440111d42d6d6a2103 Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paris.fr> Date: Wed, 6 Nov 2024 13:09:35 +0100 Subject: [PATCH] Handling reachability annotations in avatar drawing --- modeling/AVATAR/CoffeeMachine_Avatar.xml | 80 ++++++++++--------- .../java/avatartranslator/AvatarElement.java | 1 - .../AvatarStateMachineElement.java | 6 +- src/main/java/ui/AvatarPanelDrawer.java | 9 +++ 4 files changed, 53 insertions(+), 43 deletions(-) diff --git a/modeling/AVATAR/CoffeeMachine_Avatar.xml b/modeling/AVATAR/CoffeeMachine_Avatar.xml index 7851820e7..02b388789 100644 --- a/modeling/AVATAR/CoffeeMachine_Avatar.xml +++ b/modeling/AVATAR/CoffeeMachine_Avatar.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<TURTLEGMODELING version="3.0 beta" ANIMATE_INTERACTIVE_SIMULATION="false" ACTIVATE_PENALTIES="true" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="1" LAST_SELECTED_SUB_TAB="0" TAGS="deactivated root" SHOW_TAGS="true"> +<TURTLEGMODELING version="3.0 beta" ANIMATE_INTERACTIVE_SIMULATION="false" ACTIVATE_PENALTIES="true" UPDATE_INFORMATION_DIPLO_SIM="false" ANIMATE_WITH_INFO_DIPLO_SIM="true" OPEN_DIAG_DIPLO_SIM="false" LAST_SELECTED_MAIN_TAB="1" LAST_SELECTED_SUB_TAB="3" TAGS="deactivated root" SHOW_TAGS="true"> <Modeling type="Avatar Requirement" nameTab="AVATAR Requirements" > <AvatarRDPanel name="AVATAR RD" minX="10" maxX="1900" minY="10" maxY="1400" zoom="1.0" > @@ -1519,45 +1519,11 @@ <FIFOType asynchronous="false" synchronousCH="true" size="1024" blocking="false" private="true" broadcast="false" lossy="false" ams="false" /> </extraparam> </CONNECTOR> -<COMPONENT type="301" id="788" index="1" uid="788d80a6-f583-42b8-be69-7af080a786f0" > -<cdparam x="956" y="143" /> -<sizeparam width="274" height="39" minWidth="20" minHeight="10" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="9" maxX="1399" minY="9" maxY="1524" /> -<infoparam name="UML Note" value="CoffeeMachine featuring two main functions: -- coin ejection -- tea or coffee selection -" /> -<new d="false" /> -<TGConnectingPoint num="0" id="772" /> -<TGConnectingPoint num="1" id="773" /> -<TGConnectingPoint num="2" id="774" /> -<TGConnectingPoint num="3" id="775" /> -<TGConnectingPoint num="4" id="776" /> -<TGConnectingPoint num="5" id="777" /> -<TGConnectingPoint num="6" id="778" /> -<TGConnectingPoint num="7" id="779" /> -<TGConnectingPoint num="8" id="780" /> -<TGConnectingPoint num="9" id="781" /> -<TGConnectingPoint num="10" id="782" /> -<TGConnectingPoint num="11" id="783" /> -<TGConnectingPoint num="12" id="784" /> -<TGConnectingPoint num="13" id="785" /> -<TGConnectingPoint num="14" id="786" /> -<TGConnectingPoint num="15" id="787" /> -<tags value="" /> -<extraparam> -<Line value="CoffeeMachine featuring two main functions:" /> -<Line value="- coin ejection" /> -<Line value="- tea or coffee selection" /> -</extraparam> -</COMPONENT> - -<CONNECTOR type="5002" id="790" index="2" uid="403b1fb9-e973-4050-b3c2-b7e92680c5b4" > +<CONNECTOR type="5002" id="773" index="1" uid="403b1fb9-e973-4050-b3c2-b7e92680c5b4" > <cdparam x="274" y="112" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block0 to Block0" value="" /> -<TGConnectingPoint num="0" id="789" /> +<TGConnectingPoint num="0" id="772" /> <P1 x="302" y="106" id="838" /> <P2 x="442" y="106" id="960" /> <AutomaticDrawing data="true" /> @@ -1570,11 +1536,11 @@ <FIFOType asynchronous="false" synchronousCH="true" size="1024" blocking="false" private="true" broadcast="false" lossy="false" ams="false" /> </extraparam> </CONNECTOR> -<CONNECTOR type="5002" id="792" index="3" uid="2f759ef7-69b3-40e9-9fea-acea53f78b16" > +<CONNECTOR type="5002" id="775" index="2" uid="2f759ef7-69b3-40e9-9fea-acea53f78b16" > <cdparam x="620" y="562" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block1 to Block0" value="" /> -<TGConnectingPoint num="0" id="791" /> +<TGConnectingPoint num="0" id="774" /> <P1 x="787" y="345" id="874" /> <P2 x="787" y="373" id="965" /> <AutomaticDrawing data="true" /> @@ -1585,6 +1551,40 @@ <FIFOType asynchronous="false" synchronousCH="true" size="1024" blocking="false" private="true" broadcast="false" lossy="false" ams="false" /> </extraparam> </CONNECTOR> +<COMPONENT type="301" id="792" index="3" uid="788d80a6-f583-42b8-be69-7af080a786f0" > +<cdparam x="956" y="143" /> +<sizeparam width="274" height="39" minWidth="20" minHeight="10" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<hidden value="false" /> +<cdrectangleparam minX="9" maxX="1399" minY="9" maxY="1524" /> +<infoparam name="UML Note" value="CoffeeMachine featuring two main functions: +- coin ejection +- tea or coffee selection +" /> +<new d="false" /> +<TGConnectingPoint num="0" id="776" /> +<TGConnectingPoint num="1" id="777" /> +<TGConnectingPoint num="2" id="778" /> +<TGConnectingPoint num="3" id="779" /> +<TGConnectingPoint num="4" id="780" /> +<TGConnectingPoint num="5" id="781" /> +<TGConnectingPoint num="6" id="782" /> +<TGConnectingPoint num="7" id="783" /> +<TGConnectingPoint num="8" id="784" /> +<TGConnectingPoint num="9" id="785" /> +<TGConnectingPoint num="10" id="786" /> +<TGConnectingPoint num="11" id="787" /> +<TGConnectingPoint num="12" id="788" /> +<TGConnectingPoint num="13" id="789" /> +<TGConnectingPoint num="14" id="790" /> +<TGConnectingPoint num="15" id="791" /> +<tags value="" /> +<extraparam> +<Line value="CoffeeMachine featuring two main functions:" /> +<Line value="- coin ejection" /> +<Line value="- tea or coffee selection" /> +</extraparam> +</COMPONENT> + <COMPONENT type="307" id="809" index="4" uid="28981fc4-d8e0-4312-b12f-cb73edb1a15f" > <cdparam x="716" y="457" /> <sizeparam width="548" height="105" minWidth="80" minHeight="10" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> @@ -3376,6 +3376,7 @@ CoffeeMachine.CoffeeDelivered --> CoffeeMachine.nbOfCoins<2 <TGConnectingPoint num="7" id="1579" /> <TGConnectingPoint num="8" id="1580" /> <TGConnectingPoint num="9" id="1581" /> +<accessibility /> <tags value="" /> </COMPONENT> @@ -3685,6 +3686,7 @@ CoffeeMachine.CoffeeDelivered --> CoffeeMachine.nbOfCoins<2 <TGConnectingPoint num="69" id="1822" /> <TGConnectingPoint num="70" id="1823" /> <TGConnectingPoint num="71" id="1824" /> +<accessibility /> <latencyCheck /> <tags value="" /> <extraparam> diff --git a/src/main/java/avatartranslator/AvatarElement.java b/src/main/java/avatartranslator/AvatarElement.java index 9b404b993..3231e8c14 100644 --- a/src/main/java/avatartranslator/AvatarElement.java +++ b/src/main/java/avatartranslator/AvatarElement.java @@ -63,7 +63,6 @@ public class AvatarElement implements NameChecker.NamedElement, CanBeTagged { protected Object referenceObject; protected Vector<Object> otherReferenceObjects; private int myID; - protected boolean isNew; protected Tags tags; diff --git a/src/main/java/avatartranslator/AvatarStateMachineElement.java b/src/main/java/avatartranslator/AvatarStateMachineElement.java index 41b7cb5c0..3eb73897f 100644 --- a/src/main/java/avatartranslator/AvatarStateMachineElement.java +++ b/src/main/java/avatartranslator/AvatarStateMachineElement.java @@ -63,9 +63,9 @@ public abstract class AvatarStateMachineElement extends AvatarElement implements protected List<AvatarStateMachineElement> nexts; private AvatarState myState; - private boolean isCheckable; - private boolean isChecked; - private boolean canBeVerified; //Right or not to check liveness / reachability / etc. + private boolean isCheckable; // Reachability and liveness + private boolean isChecked; // Reachability and liveness have been selected + private boolean canBeVerified; // Right or not to check liveness / reachability / etc. private boolean isHidden = false; diff --git a/src/main/java/ui/AvatarPanelDrawer.java b/src/main/java/ui/AvatarPanelDrawer.java index 131833aa1..6244b4acf 100644 --- a/src/main/java/ui/AvatarPanelDrawer.java +++ b/src/main/java/ui/AvatarPanelDrawer.java @@ -667,6 +667,9 @@ public class AvatarPanelDrawer { false, null, smp); tgcomp = smdrs; + if (asme.isCheckable() && asme.isChecked()) { + smdrs.setCheckableAccessibility(asme.isChecked()); + } smp.addComponent(smdrs, newX, newY, false, true); // String name=sig.minString(); // @@ -712,6 +715,9 @@ public class AvatarPanelDrawer { AvatarSMDSendSignal smdss = new AvatarSMDSendSignal(newX, newY, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp); + if (asme.isCheckable() && asme.isChecked()) { + smdss.setCheckableAccessibility(asme.isChecked()); + } tgcomp = smdss; smp.addComponent(smdss, newX, newY, false, true); if (tgc != null) smdss.resize(width, height); @@ -826,6 +832,9 @@ public class AvatarPanelDrawer { } }*/ AvatarSMDState smdstate = new AvatarSMDState(newX, newY, smp.getMinX(), smp.getMaxX(), smp.getMinY(), smp.getMaxY(), false, null, smp); + if (asme.isCheckable() && asme.isChecked()) { + smdstate.setCheckableAccessibility(asme.isChecked()); + } tgcomp = smdstate; smp.addComponent(smdstate, newX, newY, false, true); if (tgc != null) smdstate.resize(width, height); -- GitLab