From 3d63ec3512853d95f6850b50d0587926c147eec0 Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Tue, 23 Jun 2009 15:39:32 +0000 Subject: [PATCH] --- modeling/DrinkMachineV7.xml | 93 ++++++++++------------------ src/ui/ColorManager.java | 15 +++-- src/ui/GTMLModeling.java | 33 ++++++++++ src/ui/tmlad/TMLADChoice.java | 25 +++++++- src/ui/tmlad/TMLADDelay.java | 22 ++++++- src/ui/tmlad/TMLADDelayInterval.java | 22 ++++++- src/ui/tmlad/TMLADExecC.java | 20 +++++- src/ui/tmlad/TMLADExecCInterval.java | 19 +++++- src/ui/tmlad/TMLADExecI.java | 19 +++++- src/ui/tmlad/TMLADExecIInterval.java | 20 +++++- src/ui/tmlad/TMLADForEverLoop.java | 22 ++++++- src/ui/tmlad/TMLADForLoop.java | 22 ++++++- src/ui/tmlad/TMLADForStaticLoop.java | 22 ++++++- src/ui/tmlad/TMLADNotifiedEvent.java | 26 +++++++- src/ui/tmlad/TMLADRandom.java | 22 ++++++- src/ui/tmlad/TMLADReadChannel.java | 27 +++++++- src/ui/tmlad/TMLADSelectEvt.java | 23 ++++++- src/ui/tmlad/TMLADSendEvent.java | 26 +++++++- src/ui/tmlad/TMLADSendRequest.java | 24 ++++++- src/ui/tmlad/TMLADWaitEvent.java | 25 +++++++- src/ui/tmlad/TMLADWriteChannel.java | 25 +++++++- 21 files changed, 462 insertions(+), 90 deletions(-) diff --git a/modeling/DrinkMachineV7.xml b/modeling/DrinkMachineV7.xml index 167dc04be0..c6b85cbec3 100755 --- a/modeling/DrinkMachineV7.xml +++ b/modeling/DrinkMachineV7.xml @@ -26,14 +26,13 @@ <SUBCOMPONENT type="-1" id="7" > <father id="35" num="0" /> <cdparam x="23" y="41" /> -<sizeparam width="157" height="90" minWidth="150" minHeight="30" maxWidth="1000" maxHeight="2000" minDesiredWidth="157" minDesiredHeight="90" /> +<sizeparam width="157" height="75" minWidth="150" minHeight="30" maxWidth="1000" maxHeight="2000" minDesiredWidth="157" minDesiredHeight="75" /> <hidden value="false" /> <cdrectangleparam minX="0" maxX="0" minY="30" maxY="30" /> <infoparam name="Tclass attributes" value="- coin = 2 : Natural; - x : Natural; - userDelay = 2 : Natural; - userLatency = 4 : Natural; -+ tab [2] : Array_nat; " /> <TGConnectingPoint num="0" id="1" /> <TGConnectingPoint num="1" id="2" /> @@ -46,15 +45,14 @@ <Attribute access="0" id="x" value="" type="0" typeOther="" /> <Attribute access="0" id="userDelay" value="2" type="0" typeOther="" /> <Attribute access="0" id="userLatency" value="4" type="0" typeOther="" /> -<Attribute access="2" id="tab" value="2" type="7" typeOther="" /> </extraparam> </SUBCOMPONENT> <SUBCOMPONENT type="-1" id="10" > <father id="35" num="1" /> -<cdparam x="23" y="131" /> +<cdparam x="23" y="116" /> <sizeparam width="157" height="45" minWidth="150" minHeight="30" maxWidth="1000" maxHeight="2000" minDesiredWidth="150" minDesiredHeight="45" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="0" minY="120" maxY="120" /> +<cdrectangleparam minX="0" maxX="0" minY="105" maxY="105" /> <infoparam name="Tclass gates" value="+ coinBack : InGate; + putCoin : Gate; " /> @@ -67,10 +65,10 @@ </SUBCOMPONENT> <SUBCOMPONENT type="-1" id="17" > <father id="35" num="2" /> -<cdparam x="23" y="176" /> +<cdparam x="23" y="161" /> <sizeparam width="157" height="30" minWidth="150" minHeight="30" maxWidth="1000" maxHeight="2000" minDesiredWidth="150" minDesiredHeight="30" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="0" minY="165" maxY="165" /> +<cdrectangleparam minX="0" maxX="0" minY="150" maxY="150" /> <infoparam name="Tclass operations" value="+ Wallet(Natural coin)" /> <TGConnectingPoint num="0" id="11" /> <TGConnectingPoint num="1" id="12" /> @@ -81,10 +79,10 @@ </SUBCOMPONENT> <SUBCOMPONENT type="-1" id="26" > <father id="35" num="3" /> -<cdparam x="23" y="206" /> +<cdparam x="23" y="191" /> <sizeparam width="157" height="30" minWidth="150" minHeight="30" maxWidth="1000" maxHeight="2000" minDesiredWidth="150" minDesiredHeight="30" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="0" minY="195" maxY="195" /> +<cdrectangleparam minX="0" maxX="0" minY="180" maxY="180" /> <infoparam name="Tclass activity Diagram" value="" /> <TGConnectingPoint num="0" id="18" /> <TGConnectingPoint num="1" id="19" /> @@ -505,7 +503,7 @@ are ejected. <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Tclass gates to Tclass gates" value="null" /> <TGConnectingPoint num="0" id="192" /> -<P1 x="180" y="153" id="9" /> +<P1 x="180" y="138" id="9" /> <P2 x="525" y="141" id="71" /> <AutomaticDrawing data="true" /> </CONNECTOR> @@ -513,7 +511,7 @@ are ejected. <cdparam x="383" y="253" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Tclass gates to synchro composition operator" value="null" /> -<P1 x="352" y="147" id="192" /> +<P1 x="352" y="139" id="192" /> <P2 x="352" y="92" id="109" /> <Point x="352" y="115" /> <AutomaticDrawing data="true" /> @@ -592,27 +590,14 @@ are ejected. </TClassDiagramPanel> <TActivityDiagramPanel name="Wallet" minX="10" maxX="1900" minY="10" maxY="900" java="false" > -<COMPONENT type="26" id="216" > -<cdparam x="282" y="420" /> -<sizeparam width="74" height="20" minWidth="30" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<hidden value="false" /> -<cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> -<infoparam name="array set" value="tab[z] = coin" /> -<TGConnectingPoint num="0" id="206" /> -<TGConnectingPoint num="1" id="207" /> -<TGConnectingPoint num="2" id="208" /> -<TGConnectingPoint num="3" id="209" /> -<TGConnectingPoint num="4" id="210" /> -<TGConnectingPoint num="5" id="211" /> -<TGConnectingPoint num="6" id="212" /> -<TGConnectingPoint num="7" id="213" /> -<TGConnectingPoint num="8" id="214" /> -<TGConnectingPoint num="9" id="215" /> -<extraparam> -<Prop expr="coin" array="tab" index="z" /> -</extraparam> -</COMPONENT> - +<CONNECTOR type="101" id="714" > +<cdparam x="321" y="406" /> +<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<infoparam name="connector from action state to deterministic delay" value="null" /> +<P1 x="321" y="406" id="331" /> +<P2 x="321" y="416" id="342" /> +<AutomaticDrawing data="true" /> +</CONNECTOR> <COMPONENT type="14" id="218" > <cdparam x="353" y="102" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> @@ -843,7 +828,7 @@ are ejected. </COMPONENT> <COMPONENT type="11" id="352" > -<cdparam x="322" y="478" /> +<cdparam x="316" y="421" /> <sizeparam width="10" height="30" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> @@ -861,15 +846,15 @@ are ejected. </COMPONENT> <SUBCOMPONENT type="-1" id="341" > <father id="352" num="0" /> -<cdparam x="337" y="498" /> -<sizeparam width="72" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="331" y="441" /> +<sizeparam width="57" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="-75" maxX="30" minY="10" maxY="30" /> -<infoparam name="value of the delay" value="userDelay - z" /> +<infoparam name="value of the delay" value="userDelay" /> </SUBCOMPONENT> <COMPONENT type="18" id="364" > -<cdparam x="326" y="535" /> +<cdparam x="320" y="478" /> <sizeparam width="8" height="32" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> @@ -887,21 +872,13 @@ are ejected. </COMPONENT> <SUBCOMPONENT type="-1" id="353" > <father id="364" num="0" /> -<cdparam x="339" y="556" /> +<cdparam x="333" y="499" /> <sizeparam width="68" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="8" maxX="18" minY="11" maxY="31" /> <infoparam name="value of the latency" value="userLatency" /> </SUBCOMPONENT> -<CONNECTOR type="101" id="365" > -<cdparam x="319" y="445" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from array set to deterministic delay" value="null" /> -<P1 x="319" y="445" id="207" /> -<P2 x="327" y="473" id="342" /> -<AutomaticDrawing data="true" /> -</CONNECTOR> <CONNECTOR type="101" id="366" > <cdparam x="360" y="122" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> @@ -1022,15 +999,15 @@ are ejected. <cdparam x="321" y="412" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from action state to junction" value="null" /> -<P1 x="326" y="572" id="355" /> +<P1 x="320" y="515" id="355" /> <P2 x="346" y="154" id="252" /> -<Point x="323" y="589" /> -<Point x="255" y="589" /> +<Point x="320" y="525" /> +<Point x="252" y="525" /> <Point x="252" y="154" /> <AutomaticDrawing data="true" /> </CONNECTOR><SUBCOMPONENT type="-1" id="380" > <father id="383" num="0" /> -<cdparam x="323" y="589" /> +<cdparam x="320" y="525" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> @@ -1038,7 +1015,7 @@ are ejected. </SUBCOMPONENT> <SUBCOMPONENT type="-1" id="381" > <father id="383" num="1" /> -<cdparam x="255" y="589" /> +<cdparam x="252" y="525" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1900" minY="10" maxY="900" /> @@ -1053,20 +1030,12 @@ are ejected. <infoparam name="point " value="null" /> </SUBCOMPONENT> -<CONNECTOR type="101" id="384" > -<cdparam x="321" y="406" /> -<sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> -<infoparam name="connector from action state to deterministic delay" value="null" /> -<P1 x="321" y="406" id="331" /> -<P2 x="319" y="415" id="206" /> -<AutomaticDrawing data="true" /> -</CONNECTOR> <CONNECTOR type="101" id="385" > -<cdparam x="327" y="513" /> +<cdparam x="321" y="456" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from deterministic delay to non deterministic delay" value="null" /> -<P1 x="327" y="513" id="343" /> -<P2 x="326" y="530" id="354" /> +<P1 x="321" y="456" id="343" /> +<P2 x="320" y="473" id="354" /> <AutomaticDrawing data="true" /> </CONNECTOR> diff --git a/src/ui/ColorManager.java b/src/ui/ColorManager.java index da814d5a73..06a3d217f3 100755 --- a/src/ui/ColorManager.java +++ b/src/ui/ColorManager.java @@ -82,7 +82,14 @@ public class ColorManager { public static final Color OPERATION_BOX = new Color(243, 207, 158); public static final Color ACTIVITY_BOX = new Color(255, 208, 255); public static final Color RESIZE_POINTED = new Color(26, 114, 244); - public static final Color UNKNOWN_BOX_ACTION = new Color(239, 44, 12, 125); + //public static final Color UNKNOWN_BOX_ACTION = new Color(239, 44, 12, 125); + public static final Color UNKNOWN_BOX_ACTION = new Color(255, 12, 27); + + public static final Color RANDOM = new Color(113, 170, 155); + public static final Color CHOICE = new Color(255, 255, 0); + public static final Color FOR = new Color(255, 167, 11); + public static final Color EXEC = new Color(143, 149, 255); + public static final Color REQ_ATTRIBUTE_BOX = new Color(179, 249, 179); //public static final Color REQ_ATTRIBUTE_BOX = new Color(190, 229, 158); @@ -98,9 +105,9 @@ public class ColorManager { public static final Color TML_COMPOSITE_COMPONENT = new Color(239, 212, 176, 125); - public static final Color TML_PORT_CHANNEL = new Color(104, 229, 255, 200); - public static final Color TML_PORT_EVENT = new Color(216, 187, 249, 200); - public static final Color TML_PORT_REQUEST = new Color(196, 166, 122, 200); + public static final Color TML_PORT_CHANNEL = new Color(104, 229, 255); + public static final Color TML_PORT_EVENT = new Color(216, 187, 249); + public static final Color TML_PORT_REQUEST = new Color(196, 166, 122); public static final Color UML_NOTE = Color.lightGray; diff --git a/src/ui/GTMLModeling.java b/src/ui/GTMLModeling.java index 5e5ebd3153..259e6854ac 100755 --- a/src/ui/GTMLModeling.java +++ b/src/ui/GTMLModeling.java @@ -941,37 +941,44 @@ public class GTMLModeling { tmlrandom.setMaxValue(tmp); tmlrandom.setFunctionId(tmladrandom.getFunctionId()); activity.addElement(tmlrandom); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlrandom, tgc); } else if (tgc instanceof TMLADChoice) { tmlchoice = new TMLChoice("choice", tgc); // Guards are added at the same time as next activities activity.addElement(tmlchoice); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlchoice, tgc); } else if (tgc instanceof TMLADSelectEvt) { tmlselectevt = new TMLSelectEvt("select", tgc); activity.addElement(tmlselectevt); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlselectevt, tgc); } else if (tgc instanceof TMLADExecI) { tmlexeci = new TMLExecI("execi", tgc); tmlexeci.setAction(((TMLADExecI)tgc).getDelayValue()); activity.addElement(tmlexeci); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlexeci, tgc); } else if (tgc instanceof TMLADExecIInterval) { tmlexecii = new TMLExecIInterval("execi", tgc); tmlexecii.setMinDelay(((TMLADExecIInterval)tgc).getMinDelayValue()); tmlexecii.setMaxDelay(((TMLADExecIInterval)tgc).getMaxDelayValue()); activity.addElement(tmlexecii); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlexecii, tgc); } else if (tgc instanceof TMLADExecC) { tmlexecc = new TMLExecC("execc", tgc); tmlexecc.setAction(((TMLADExecC)tgc).getDelayValue()); activity.addElement(tmlexecc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlexecc, tgc); } else if (tgc instanceof TMLADExecCInterval) { tmlexecci = new TMLExecCInterval("execci", tgc); tmlexecci.setMinDelay(((TMLADExecCInterval)tgc).getMinDelayValue()); tmlexecci.setMaxDelay(((TMLADExecCInterval)tgc).getMaxDelayValue()); activity.addElement(tmlexecci); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlexecci, tgc); } else if (tgc instanceof TMLADDelay) { tmldelay = new TMLDelay("d-delay", tgc); @@ -979,6 +986,7 @@ public class GTMLModeling { tmldelay.setMaxDelay(((TMLADDelay)tgc).getDelayValue()); tmldelay.setUnit(((TMLADDelay)tgc).getUnit()); activity.addElement(tmldelay); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmldelay, tgc); } else if (tgc instanceof TMLADDelayInterval) { tmldelay = new TMLDelay("nd-delay", tgc); @@ -986,6 +994,7 @@ public class GTMLModeling { tmldelay.setMaxDelay(((TMLADDelayInterval)tgc).getMaxDelayValue()); tmldelay.setUnit(((TMLADDelayInterval)tgc).getUnit()); activity.addElement(tmldelay); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmldelay, tgc); } else if (tgc instanceof TMLADForLoop) { tmlforloop = new TMLForLoop("loop", tgc); @@ -993,6 +1002,7 @@ public class GTMLModeling { tmlforloop.setCondition(((TMLADForLoop)tgc).getCondition()); tmlforloop.setIncrement(modifyActionString(((TMLADForLoop)tgc).getIncrement())); activity.addElement(tmlforloop); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlforloop, tgc); } else if (tgc instanceof TMLADForStaticLoop) { @@ -1007,6 +1017,7 @@ public class GTMLModeling { //System.out.println("Condition=" + tmlforloop.getCondition()); tmlforloop.setIncrement(sl + " = " + sl + " + 1"); activity.addElement(tmlforloop); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlforloop, tgc); staticLoopIndex++; @@ -1022,6 +1033,7 @@ public class GTMLModeling { //System.out.println("Condition=" + tmlforloop.getCondition()); tmlforloop.setIncrement(sl + " = " + sl); activity.addElement(tmlforloop); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlforloop, tgc); staticLoopIndex++; @@ -1045,12 +1057,14 @@ public class GTMLModeling { ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); warnings.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); activity.addElement(new TMLJunction("void junction", tgc)); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADReadChannel)tgc).getChannelName() + " is an unknown channel"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); checkingErrors.add(ce); } } else { @@ -1058,6 +1072,7 @@ public class GTMLModeling { tmlreadchannel.setNbOfSamples(((TMLADReadChannel)tgc).getSamplesValue()); tmlreadchannel.setChannel(channel); activity.addElement(tmlreadchannel); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlreadchannel, tgc); } } else if (tgc instanceof TMLADSendEvent) { @@ -1070,12 +1085,14 @@ public class GTMLModeling { ce.setTGComponent(tgc); warnings.add(ce); activity.addElement(new TMLJunction("void junction", tgc)); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADSendEvent)tgc).getEventName() + " is an unknown event"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); checkingErrors.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } } else { if (event.getNbOfParams() != ((TMLADSendEvent)tgc).realNbOfParams()) { @@ -1084,6 +1101,7 @@ public class GTMLModeling { ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); checkingErrors.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } else { tmlsendevent = new TMLSendEvent("send event", tgc); tmlsendevent.setEvent(event); @@ -1092,6 +1110,7 @@ public class GTMLModeling { } activity.addElement(tmlsendevent); listE.addCor(tmlsendevent, tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); } } } else if (tgc instanceof TMLADSendRequest) { @@ -1104,12 +1123,14 @@ public class GTMLModeling { ce.setTGComponent(tgc); warnings.add(ce); activity.addElement(new TMLJunction("void junction", tgc)); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADSendRequest)tgc).getRequestName() + " is an unknown request"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); checkingErrors.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } } else { if (request.getNbOfParams() != ((TMLADSendRequest)tgc).realNbOfParams()) { @@ -1118,6 +1139,7 @@ public class GTMLModeling { ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); checkingErrors.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } else { tmlsendrequest = new TMLSendRequest("send request", tgc); tmlsendrequest.setRequest(request); @@ -1126,6 +1148,7 @@ public class GTMLModeling { } activity.addElement(tmlsendrequest); listE.addCor(tmlsendrequest, tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); } } } else if (tgc instanceof TMLADStopState) { @@ -1143,12 +1166,14 @@ public class GTMLModeling { ce.setTGComponent(tgc); warnings.add(ce); activity.addElement(new TMLJunction("void junction", tgc)); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADNotifiedEvent)tgc).getEventName() + " is an unknown event"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); checkingErrors.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); } } else { event.setNotified(true); @@ -1156,6 +1181,7 @@ public class GTMLModeling { tmlnotifiedevent.setEvent(event); tmlnotifiedevent.setVariable(((TMLADNotifiedEvent)tgc).getVariable()); activity.addElement(tmlnotifiedevent); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlnotifiedevent, tgc); } @@ -1168,12 +1194,14 @@ public class GTMLModeling { ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); warnings.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); activity.addElement(new TMLJunction("void junction", tgc)); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADWaitEvent)tgc).getEventName() + " is an unknown event"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); checkingErrors.add(ce); } } else { @@ -1182,6 +1210,7 @@ public class GTMLModeling { ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); checkingErrors.add(ce); } else { tmlwaitevent = new TMLWaitEvent("wait event", tgc); @@ -1189,6 +1218,7 @@ public class GTMLModeling { for(int i=0; i<((TMLADWaitEvent)tgc).nbOfParams(); i++) { tmlwaitevent.addParam(((TMLADWaitEvent)tgc).getParamValue(i)); } + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); activity.addElement(tmlwaitevent); listE.addCor(tmlwaitevent, tgc); } @@ -1203,12 +1233,14 @@ public class GTMLModeling { ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); warnings.add(ce); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); activity.addElement(new TMLJunction("void junction", tgc)); } else { CheckingError ce = new CheckingError(CheckingError.BEHAVIOR_ERROR, ((TMLADWriteChannel)tgc).getChannelName() + " is an unknown channel"); ce.setTMLTask(tmltask); ce.setTDiagramPanel(tadp); ce.setTGComponent(tgc); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.UNKNOWN); checkingErrors.add(ce); } } else { @@ -1216,6 +1248,7 @@ public class GTMLModeling { tmlwritechannel.setNbOfSamples(((TMLADWriteChannel)tgc).getSamplesValue()); tmlwritechannel.setChannel(channel); activity.addElement(tmlwritechannel); + ((BasicErrorHighlight)tgc).setStateAction(ErrorHighlight.OK); listE.addCor(tmlwritechannel, tgc); } } diff --git a/src/ui/tmlad/TMLADChoice.java b/src/ui/tmlad/TMLADChoice.java index 4df5363479..3fe0ed0c3f 100755 --- a/src/ui/tmlad/TMLADChoice.java +++ b/src/ui/tmlad/TMLADChoice.java @@ -53,12 +53,13 @@ import java.awt.geom.*; import myutil.*; import ui.*; -public class TMLADChoice extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADChoice extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 10; private int lineOutLength = 25; private int textX1, textY1, textX2, textY2, textX3, textY3; - + protected int stateOfError = 0; // Not yet checked + public TMLADChoice(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); @@ -106,6 +107,22 @@ public class TMLADChoice extends TGCWithInternalComponent implements EmbeddedCom } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.CHOICE); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x+(width/2), x+width, x + (width/2), x}; + int [] py1 = {y, y + height/2, y+height, y+height/2}; + g.fillPolygon(px1, py1, 4); + g.setColor(c); + } + g.drawLine(x+(width/2), y, x+width, y + height/2); g.drawLine(x, y + height / 2, x+width/2, y + height); g.drawLine(x + width/2, y, x, y + height/2); @@ -161,5 +178,9 @@ public class TMLADChoice extends TGCWithInternalComponent implements EmbeddedCom public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADDelay.java b/src/ui/tmlad/TMLADDelay.java index 3e767f8963..8a448675a5 100755 --- a/src/ui/tmlad/TMLADDelay.java +++ b/src/ui/tmlad/TMLADDelay.java @@ -52,11 +52,12 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADDelay extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { - private int lineLength = 5; +public class TMLADDelay extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; + + protected int stateOfError = 0; // Not yet checked public TMLADDelay(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); @@ -93,6 +94,19 @@ public class TMLADDelay extends TGCWithInternalComponent implements EmbeddedComm } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.EXEC); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } + g.drawRect(x, 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); @@ -129,6 +143,10 @@ public class TMLADDelay extends TGCWithInternalComponent implements EmbeddedComm public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADDelayInterval.java b/src/ui/tmlad/TMLADDelayInterval.java index de7006dbf2..ddd8ba9d65 100755 --- a/src/ui/tmlad/TMLADDelayInterval.java +++ b/src/ui/tmlad/TMLADDelayInterval.java @@ -52,13 +52,15 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADDelayInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADDelayInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; private int incrementY = 3; private int segment = 4; + + protected int stateOfError = 0; // Not yet checked public TMLADDelayInterval(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); @@ -95,6 +97,20 @@ public class TMLADDelayInterval extends TGCWithInternalComponent implements Embe } public void internalDrawing(Graphics g) { + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.EXEC); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } + g.drawRect(x, 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); @@ -150,5 +166,9 @@ public class TMLADDelayInterval extends TGCWithInternalComponent implements Embe public String getUnit() { return ((TGCTimeDelay)tgcomponent[0]).getUnit(); } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADExecC.java b/src/ui/tmlad/TMLADExecC.java index 382a5b570b..e3116be653 100755 --- a/src/ui/tmlad/TMLADExecC.java +++ b/src/ui/tmlad/TMLADExecC.java @@ -52,11 +52,13 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADExecC extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADExecC extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; + + protected int stateOfError = 0; // Not yet checked public TMLADExecC(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); @@ -89,6 +91,18 @@ public class TMLADExecC extends TGCWithInternalComponent implements EmbeddedComm } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.ATTRIBUTE_BOX_ACTION); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } g.drawRect(x, 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); @@ -124,6 +138,10 @@ public class TMLADExecC extends TGCWithInternalComponent implements EmbeddedComm public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADExecCInterval.java b/src/ui/tmlad/TMLADExecCInterval.java index 0ba5fde67f..06a35375ef 100755 --- a/src/ui/tmlad/TMLADExecCInterval.java +++ b/src/ui/tmlad/TMLADExecCInterval.java @@ -52,11 +52,13 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADExecCInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADExecCInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; + + protected int stateOfError = 0; // Not yet checked public TMLADExecCInterval(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); @@ -89,6 +91,18 @@ public class TMLADExecCInterval extends TGCWithInternalComponent implements Embe } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.EXEC); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } g.drawRect(x, 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); @@ -133,4 +147,7 @@ public class TMLADExecCInterval extends TGCWithInternalComponent implements Embe return TGComponentManager.CONNECTOR_TMLAD; } + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADExecI.java b/src/ui/tmlad/TMLADExecI.java index 834456c24a..30c6731491 100755 --- a/src/ui/tmlad/TMLADExecI.java +++ b/src/ui/tmlad/TMLADExecI.java @@ -52,11 +52,13 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADExecI extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADExecI extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; + + protected int stateOfError = 0; // Not yet checked public TMLADExecI(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); @@ -89,6 +91,18 @@ public class TMLADExecI extends TGCWithInternalComponent implements EmbeddedComm } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.EXEC); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } g.drawRect(x, 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); @@ -125,5 +139,8 @@ public class TMLADExecI extends TGCWithInternalComponent implements EmbeddedComm return TGComponentManager.CONNECTOR_TMLAD; } + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADExecIInterval.java b/src/ui/tmlad/TMLADExecIInterval.java index 082aaa6a61..96253ca213 100755 --- a/src/ui/tmlad/TMLADExecIInterval.java +++ b/src/ui/tmlad/TMLADExecIInterval.java @@ -52,11 +52,13 @@ import java.awt.geom.*; import ui.*; import myutil.*; -public class TMLADExecIInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADExecIInterval extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 5; private int textX, textY; private int ilength = 10; private int lineLength1 = 2; + + protected int stateOfError = 0; // Not yet checked public TMLADExecIInterval(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); @@ -89,6 +91,18 @@ public class TMLADExecIInterval extends TGCWithInternalComponent implements Embe } public void internalDrawing(Graphics g) { + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.EXEC); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRect(x, y, width, height); + g.setColor(c); + } g.drawRect(x, 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); @@ -132,5 +146,9 @@ public class TMLADExecIInterval extends TGCWithInternalComponent implements Embe public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADForEverLoop.java b/src/ui/tmlad/TMLADForEverLoop.java index 7ad6d823cd..bf19be6ea9 100755 --- a/src/ui/tmlad/TMLADForEverLoop.java +++ b/src/ui/tmlad/TMLADForEverLoop.java @@ -56,11 +56,13 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADForEverLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADForEverLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; protected int arc = 5; + + protected int stateOfError = 0; // Not yet checked public TMLADForEverLoop(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); @@ -96,6 +98,20 @@ public class TMLADForEverLoop extends TGCWithoutInternalComponent implements Emb width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.FOR); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRoundRect(x, y, width, height, arc, arc); + g.setColor(c); + } + g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); //g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -152,5 +168,7 @@ public class TMLADForEverLoop extends TGCWithoutInternalComponent implements Emb return TGComponentManager.CONNECTOR_TMLAD; } - + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADForLoop.java b/src/ui/tmlad/TMLADForLoop.java index 53a38469b0..f74d9921cc 100755 --- a/src/ui/tmlad/TMLADForLoop.java +++ b/src/ui/tmlad/TMLADForLoop.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADForLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADForLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -65,6 +65,8 @@ public class TMLADForLoop extends TGCWithoutInternalComponent implements Embedde protected String init = "i=0"; protected String condition = "i<5"; protected String increment = "i = i+1"; + + protected int stateOfError = 0; // Not yet checked public TMLADForLoop(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); @@ -98,6 +100,20 @@ public class TMLADForLoop extends TGCWithoutInternalComponent implements Embedde width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.FOR); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRoundRect(x, y, width, height, arc, arc); + g.setColor(c); + } + g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -232,6 +248,10 @@ public class TMLADForLoop extends TGCWithoutInternalComponent implements Embedde public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADForStaticLoop.java b/src/ui/tmlad/TMLADForStaticLoop.java index 84becbf739..622e8a1d67 100755 --- a/src/ui/tmlad/TMLADForStaticLoop.java +++ b/src/ui/tmlad/TMLADForStaticLoop.java @@ -56,12 +56,14 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADForStaticLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADForStaticLoop extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; protected int arc = 5; protected String valueLoop = ""; + + protected int stateOfError = 0; // Not yet checked public TMLADForStaticLoop(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); @@ -102,6 +104,20 @@ public class TMLADForStaticLoop extends TGCWithoutInternalComponent implements E width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.FOR); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRoundRect(x, y, width, height, arc, arc); + g.setColor(c); + } + g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -158,5 +174,7 @@ public class TMLADForStaticLoop extends TGCWithoutInternalComponent implements E return TGComponentManager.CONNECTOR_TMLAD; } - + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADNotifiedEvent.java b/src/ui/tmlad/TMLADNotifiedEvent.java index 1328145c63..d2c162d416 100755 --- a/src/ui/tmlad/TMLADNotifiedEvent.java +++ b/src/ui/tmlad/TMLADNotifiedEvent.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -65,6 +65,8 @@ public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements E protected String eventName = "evt"; protected String result = "x"; + + protected int stateOfError = 0; // Not yet checked public TMLADNotifiedEvent(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); @@ -96,6 +98,24 @@ public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements E width = w1; //updateConnectingPoints(); } + + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_EVENT); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width, x+width, x, x+linebreak}; + int [] py1 = {y, y, y+height, y+height, y+(height/2)}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + //g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -234,6 +254,10 @@ public class TMLADNotifiedEvent extends TGCWithoutInternalComponent implements E public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADRandom.java b/src/ui/tmlad/TMLADRandom.java index 96b9d44fa8..50180d00b2 100755 --- a/src/ui/tmlad/TMLADRandom.java +++ b/src/ui/tmlad/TMLADRandom.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADRandom extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADRandom extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -66,6 +66,8 @@ public class TMLADRandom extends TGCWithoutInternalComponent implements Embedded protected String minValue; protected String maxValue; protected int functionId; + + protected int stateOfError = 0; // Not yet checked public TMLADRandom(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); @@ -108,6 +110,20 @@ public class TMLADRandom extends TGCWithoutInternalComponent implements Embedded width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.RANDOM); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + g.fillRoundRect(x, y, width, height, arc, arc); + g.setColor(c); + } + g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -274,5 +290,9 @@ public class TMLADRandom extends TGCWithoutInternalComponent implements Embedded return TGComponentManager.CONNECTOR_TMLAD; } + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } + } diff --git a/src/ui/tmlad/TMLADReadChannel.java b/src/ui/tmlad/TMLADReadChannel.java index 941e28bd6d..7dff19298a 100755 --- a/src/ui/tmlad/TMLADReadChannel.java +++ b/src/ui/tmlad/TMLADReadChannel.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADReadChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint { +public class TMLADReadChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textX0 = 2; @@ -64,9 +64,10 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che protected int textY1 = 15; protected int linebreak = 10; - protected String channelName = "ch"; protected String nbOfSamples= "1"; + + protected int stateOfError = 0; // Not yet checked public TMLADReadChannel(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); @@ -98,6 +99,23 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_CHANNEL); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width, x+width, x, x+linebreak}; + int [] py1 = {y, y, y+height, y+height, y+(height/2)}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + //g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -228,6 +246,9 @@ public class TMLADReadChannel extends TGCWithoutInternalComponent implements Che public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } - + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADSelectEvt.java b/src/ui/tmlad/TMLADSelectEvt.java index e4329f4d9f..cbac4a263f 100755 --- a/src/ui/tmlad/TMLADSelectEvt.java +++ b/src/ui/tmlad/TMLADSelectEvt.java @@ -53,11 +53,12 @@ import java.awt.geom.*; import myutil.*; import ui.*; -public class TMLADSelectEvt extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint { +public class TMLADSelectEvt extends TGCWithoutInternalComponent implements EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { private int lineLength = 10; private int lineOutLength = 25; //private int textX1, textY1, textX2, textY2, textX3, textY3; + protected int stateOfError = 0; // Not yet checked public TMLADSelectEvt(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); @@ -94,6 +95,23 @@ public class TMLADSelectEvt extends TGCWithoutInternalComponent implements Embed } public void internalDrawing(Graphics g) { + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.CHOICE); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x+(width/2), x+width, x + (width/2), x}; + int [] py1 = {y, y + height/2, y+height, y+height/2}; + g.fillPolygon(px1, py1, 4); + g.setColor(c); + } + g.drawLine(x+(width/2), y, x+width, y + height/2); g.drawLine(x, y + height / 2, x+width/2, y + height); g.drawLine(x + width/2, y, x, y + height/2); @@ -141,4 +159,7 @@ public class TMLADSelectEvt extends TGCWithoutInternalComponent implements Embed return TGComponentManager.CONNECTOR_TMLAD; } + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADSendEvent.java b/src/ui/tmlad/TMLADSendEvent.java index 9ca47447bb..d70da7d07e 100755 --- a/src/ui/tmlad/TMLADSendEvent.java +++ b/src/ui/tmlad/TMLADSendEvent.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADSendEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint { +public class TMLADSendEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -66,6 +66,8 @@ public class TMLADSendEvent extends TGCWithoutInternalComponent implements Check protected String eventName = "evt"; int nParam = 3; protected String [] params = new String[nParam]; + + protected int stateOfError = 0; // Not yet checked public TMLADSendEvent(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); @@ -102,6 +104,24 @@ public class TMLADSendEvent extends TGCWithoutInternalComponent implements Check setCd(x + width/2 - w1/2, y); width = w1; //updateConnectingPoints(); } + + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_EVENT); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width-linebreak, x+width, x+width-linebreak, x}; + int [] py1 = {y, y, y+(height/2), y+height, y+height}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + //g.drawRoundRect(x, y, width, height, arc, arc); Color c = g.getColor(); //System.out.println("Color=" + c); @@ -295,4 +315,8 @@ public class TMLADSendEvent extends TGCWithoutInternalComponent implements Check public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADSendRequest.java b/src/ui/tmlad/TMLADSendRequest.java index e55cd8df80..4c58ccaaad 100755 --- a/src/ui/tmlad/TMLADSendRequest.java +++ b/src/ui/tmlad/TMLADSendRequest.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADSendRequest extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint { +public class TMLADSendRequest extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -66,6 +66,8 @@ public class TMLADSendRequest extends TGCWithoutInternalComponent implements Che protected String requestName = "req"; int nParam = 3; protected String [] params = new String[nParam]; + + protected int stateOfError = 0; // Not yet checked public TMLADSendRequest(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); @@ -104,6 +106,22 @@ public class TMLADSendRequest extends TGCWithoutInternalComponent implements Che } //g.drawRoundRect(x, y, width, height, arc, arc); + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_REQUEST); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width-linebreak, x+width, x+width-linebreak, x}; + int [] py1 = {y, y, y+(height/2), y+height, y+height}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + int x1 = x + 1; int y1 = y + 1; int height1 = height; @@ -286,5 +304,9 @@ public class TMLADSendRequest extends TGCWithoutInternalComponent implements Che public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADWaitEvent.java b/src/ui/tmlad/TMLADWaitEvent.java index a2867c2a50..27585bbc0f 100755 --- a/src/ui/tmlad/TMLADWaitEvent.java +++ b/src/ui/tmlad/TMLADWaitEvent.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADWaitEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint { +public class TMLADWaitEvent extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -66,6 +66,8 @@ public class TMLADWaitEvent extends TGCWithoutInternalComponent implements Check protected String eventName = "evt"; int nParam = 3; protected String [] params = new String[nParam]; + + protected int stateOfError = 0; // Not yet checked public TMLADWaitEvent(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); @@ -102,6 +104,23 @@ public class TMLADWaitEvent extends TGCWithoutInternalComponent implements Check width = w1; //updateConnectingPoints(); } + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_EVENT); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width, x+width, x, x+linebreak}; + int [] py1 = {y, y, y+height, y+height, y+(height/2)}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + //g.drawRoundRect(x, y, width, height, arc, arc); g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -286,5 +305,9 @@ public class TMLADWaitEvent extends TGCWithoutInternalComponent implements Check public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } diff --git a/src/ui/tmlad/TMLADWriteChannel.java b/src/ui/tmlad/TMLADWriteChannel.java index d03b41077e..f871acc846 100755 --- a/src/ui/tmlad/TMLADWriteChannel.java +++ b/src/ui/tmlad/TMLADWriteChannel.java @@ -56,7 +56,7 @@ import myutil.*; import ui.*; import ui.window.*; -public class TMLADWriteChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint { +public class TMLADWriteChannel extends TGCWithoutInternalComponent implements CheckableAccessibility, EmbeddedComment, AllowedBreakpoint, BasicErrorHighlight { protected int lineLength = 5; protected int textX = 5; protected int textY = 15; @@ -65,6 +65,8 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch protected String channelName = "ch"; protected String nbOfSamples= "1"; + + protected int stateOfError = 0; // Not yet checked public TMLADWriteChannel(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); @@ -97,6 +99,23 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch //updateConnectingPoints(); } //g.drawRoundRect(x, y, width, height, arc, arc); + + if (stateOfError > 0) { + Color c = g.getColor(); + switch(stateOfError) { + case ErrorHighlight.OK: + g.setColor(ColorManager.TML_PORT_CHANNEL); + break; + default: + g.setColor(ColorManager.UNKNOWN_BOX_ACTION); + } + // Making the polygon + int [] px1 = {x, x+width-linebreak, x+width, x+width-linebreak, x}; + int [] py1 = {y, y, y+(height/2), y+height, y+height}; + g.fillPolygon(px1, py1, 5); + g.setColor(c); + } + g.drawLine(x+(width/2), y, x+(width/2), y - lineLength); g.drawLine(x+(width/2), y+height, x+(width/2), y + lineLength + height); @@ -226,5 +245,9 @@ public class TMLADWriteChannel extends TGCWithoutInternalComponent implements Ch public int getDefaultConnector() { return TGComponentManager.CONNECTOR_TMLAD; } + + public void setStateAction(int _stateAction) { + stateOfError = _stateAction; + } } -- GitLab