From af52a26f9a176d91759d062302887989e81c3efe Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Thu, 16 Apr 2009 14:42:22 +0000 Subject: [PATCH] New classes for controlling remote simulators --- src/remotesimulation/CommandParser.java | 59 ++ src/remotesimulation/RemoteConnection.class | Bin 0 -> 2727 bytes src/remotesimulation/RemoteConnection.java | 549 ++++++++++++++++++ .../RemoteConnectionException.class | Bin 0 -> 267 bytes .../RemoteConnectionException.java | 55 ++ src/translator/touppaal/TURTLE2UPPAAL.java | 2 +- src/ui/ColorManager.java | 5 +- src/ui/tmlcd/TMLTaskOperator.java | 7 +- src/ui/tmldd/TMLArchiArtifact.java | 10 +- src/ui/tmldd/TMLArchiBUSNode.java | 7 +- src/ui/tmldd/TMLArchiBridgeNode.java | 4 +- src/ui/tmldd/TMLArchiCPUNode.java | 2 +- .../tmldd/TMLArchiCommunicationArtifact.java | 10 +- src/ui/tmldd/TMLArchiHWANode.java | 3 +- src/ui/tmldd/TMLArchiMemoryNode.java | 7 +- 15 files changed, 703 insertions(+), 17 deletions(-) create mode 100755 src/remotesimulation/CommandParser.java create mode 100644 src/remotesimulation/RemoteConnection.class create mode 100755 src/remotesimulation/RemoteConnection.java create mode 100644 src/remotesimulation/RemoteConnectionException.class create mode 100755 src/remotesimulation/RemoteConnectionException.java diff --git a/src/remotesimulation/CommandParser.java b/src/remotesimulation/CommandParser.java new file mode 100755 index 0000000000..7db4aa51c6 --- /dev/null +++ b/src/remotesimulation/CommandParser.java @@ -0,0 +1,59 @@ +/**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 CommandParser +* For managing commands the C++ simulator +* Creation: 16/04/2009 +* @version 1.1 16/04/2009 +* @author Ludovic APVRILLE +* @see +*/ + +package remotesimulation; + +import java.io.*; +import java.net.*; +import javax.swing.*; + + +public class CommandParser { + + public CommandParser() { + } + +} \ No newline at end of file diff --git a/src/remotesimulation/RemoteConnection.class b/src/remotesimulation/RemoteConnection.class new file mode 100644 index 0000000000000000000000000000000000000000..65ca36e07474ffe93a9e430980f99e2c1e27c0df GIT binary patch literal 2727 zcma)8{Z~_E9RFN~+%Ybo0}&KuW*Q6?&0bVY5}G-K4L3Bg6ffHa2HU-Jy8}s0EAzdw z>`n7jr(gUvAx0<8$$smc{-#d#d7eAQi*(9!e4ahum(TNgzHgU5{`%!t0MFy02RqSM zjvY8ImJ?!mQ^iTK_j|Akr#yHIZ>u=1;*19#$96#cIx7}k#h?e(h^dGRA4A2EieVud z@t_t74{9(fG-E1~LY(rT0j7{xD$*XDLq;swa@erk$O-khSSG}BUKmaakayg;APg_M zamkH$-MH+=6&3HPcwd1U3J)9!NBb0byGQkLy)CJm!);MJlQ4(d6_f@;0qQEFfyjx0 zP`Ga(5{ULHa0kN!fk-4Ap~Z-mwYjCO3^ygHK#L_4hG|Ew*qA}l8VA=j>^4V4*ph^) zpx#j=thUbF(2$Wa;t@lS8yV_dR*s%)iw3=<W0RDjr-b*g#hXqkC_9ia6ZSy`b<Izc z54M~jtu8BWD5&mEm_{g<8Z<I}`e2fhwJUfC2Q_AyrV-=qu4ZwrjM{o^tVd5vKNTOy zgvOZw1)jk9n31*<mYL;ES;LGgs36C9*fhk23Tm5Mo+c(kf0aQzz(6_tJy9!{i5Z6z zl3K(_S+>#T5Fz?bkr)jf2xxd2do{d(T^e4*OA7oMX`4-?a!Fk<X<P1G<fx%dxOJe5 zuh8%zt|{0kQ!Y|-+#EBl3G)b(S@ck_Zh1*`<`PM!NW*S{bsaY}+(d{0E&@3@7Wdpz zP$R|6a4=j%)!00{n6i1*(&Q^>m{$bNbgqzer!X|!#vOtDkyt*~un+qe-La@hG<<@) z!st^C?Km)RBx}1!M8#DNpCP2-9zIv`g@W=ZbI8Kq@6+%lx-@(xmaj$J_lWo27f&rU zbIGKJ2lz(8=0oXpG7*!J_l@XTpK1Aw^F}NuQsHwtV^gOd_pyA94CCz6<ME7<&H9F{ zjMV%1;HZ%qH!}3Kebl8b$-zeeCaB9wrE=!{73o3WM8Y2NWgQO^_|N<+SS<r8-yR+u zm9<?fMI!G(E{7aWODvrUz>o|ZcIRYBPqCW)EA@<1-^-xbq-A<KEjwbzzk4m3HHE^W zquaLTFJE79U5+kWyNb*fl?aP<zS%^*Ez}Mn>kBx`6r#Ut7F31lBc#>D4(IG*{RxOd zClh0_hUg6o5KA-ysFZ^=#b6{2bJ!k{LxmG^QAVPZS=*q6nieB2$+5Uf{^CBA%w_4~ z78Au8CuPRDoSx*cSu(wxq_(%5!e);Ao%}k9?+cq<{$iubolPfq7Bcq|F+=2;V?>@g zSme&0k~`Z*?yuk=_cAE#rdPQh;;EhfF77q{Stx#G1||O18Mqp!QTmu-1)W^$_zeV( zqLim{yn!lo!;2mX)Kvi5L!c5`RWAiv0P)ft2p2$l3380CuOUD;GEsWSOfdOP>GuBw z*YBvB!>ax%l+8kYA|yY<-Teq#dW3imp8i=>OhL<|QYg9QQ6)|1P~G1;h0<B9=5wC% z@UG-hL&VyC0+r;kb{2KBST}=u{~Q_$!u7M*FoVYbf%cfMs6`{17^)70_{uf>Vn4)p z*vOZPa2}=v=;P@mZTe|_n)YYuaRxpN&?`p2A$rCUfkE#CZeffV7Ex089wwe3LmXfo z)IU+H;`O5{jx-%p5o}7SINHQ4fuUyY@qahEoFH=wx@3?8t$A$f=F;?liJpS55K!-C zMu%b%%sif9KpJ`4BKAC<eS~Tm{V8k}k$z0*ZTxucExydpY6Wt<bQ~HcP>D%eTwo<% zq}^p&UgD&Gms!6e*}LJY93|a~C3JiEdRY_rmSjcM98`Kpp+1joJ>(E_3PW<(UaS-6 z=zT7a=KJ%t<H&v_&k{1LWZaz$I6SZNbdB<x)Ldsh-r(O_xA~SkXy!*}H}0};?n$0? zDE*s8E|vAGq8AF|Tv1iCh_##93h*A$Q=%orzYX4&X_R^W)6l%F)9`w?Ph;zv${$wf Zt-TD{K2q7wKMvbj5FLbw5TXRpe*hr#dp7_8 literal 0 HcmV?d00001 diff --git a/src/remotesimulation/RemoteConnection.java b/src/remotesimulation/RemoteConnection.java new file mode 100755 index 0000000000..07c0817625 --- /dev/null +++ b/src/remotesimulation/RemoteConnection.java @@ -0,0 +1,549 @@ +/**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 RemoteConnection +* For remote control of the simulator +* Creation: 16/04/2009 +* @version 1.1 16/04/2009 +* @author Ludovic APVRILLE +* @see +*/ + +package remotesimulation; + +import java.io.*; +import java.net.*; +import javax.swing.*; + + +public class RemoteConnection { + + private static String NO_HOST = "Application has no execution host"; + private static String INET = "Bad internet address for host "; + private static String SERV_NOT_RESP = "Server not responding on "; + private static String IO_ERROR = "Communication pb with server "; + + private String host; + //private String cmd; + private static int port = 3490; + //private int portString = -1; + //private int portString2 = -1; + private Socket clientSocket = null; + private BufferedReader in; + //private DataInputStream in2; + private PrintStream out; + //private int offset = 0; + + private boolean go; + + public RemoteConnection(String _host, int _port) { + host = _host; + port = _port; + } + + public RemoteConnection(String _host) { + host = _host; + } + + public void connect() throws RemoteConnectionException { + InetAddress ina = null; + + //System.out.println("Connecting on port " + portNet); + + if (host == null) { + throw new RemoteConnectionException(NO_HOST); + } + + try { + ina = InetAddress.getByName(host); + } catch (UnknownHostException e) { + throw new RemoteConnectionException(INET + host); + } + + try { + clientSocket = new Socket(ina, port); + } catch (IOException io) { + throw new RemoteConnectionException(SERV_NOT_RESP+host); + } + + try { + in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + //in2 = new DataInputStream(clientSocket.getInputStream()); + out = new PrintStream(clientSocket.getOutputStream()); + //System.out.println("Connected on port " + portNet); + } catch (Exception e) { + throw new RemoteConnectionException(SERV_NOT_RESP+host); + } + + + } + + public void send(String s) throws RemoteConnectionException { + s = s .trim(); + if (s.length() == 0) { + return; + } + System.out.println("Sending: " + s); + try { + out.print(s); + out.flush(); + } catch (Exception e) { + throw new RemoteConnectionException(IO_ERROR); + } + } + + public String readOneLine() throws RemoteConnectionException { + int nb; + String s = null; + try { + s = in.readLine(); + } catch(IOException io) { + throw new RemoteConnectionException(IO_ERROR); + } + + if (s == null) { + throw new RemoteConnectionException(IO_ERROR); + } + + if (s.equals("null")) { + throw new RemoteConnectionException(IO_ERROR); + } + + return s; + } + + + + + + + /*public void stopFillJTA() throws RemoteConnectionException { + sendKillProcessRequest(); + go = false; + closeConnect(); + } + + public int getId() throws LauncherException { + connect(port); + send("00"); + int id = readId(); + closeConnect(); + return id; + } + + public int freeId(int id) throws LauncherException { + connect(port); + send("0" + id); + int idret = readId(); + if (idret != id) { + throw new LauncherException(ID_FAILED); + } + return idret; + + } + + public void sendProcessRequest() throws LauncherException { + connect(port); + send("1" + cmd); + readPortString(); + closeConnect(); + } + + public void sendProcessRequest(String cmd1, String cmd2) throws LauncherException { + connect(port); + send("3" + cmd1); + int id1 = readPortString(); + closeConnect(); + + connect(port); + send("3" + cmd2); + int id2 = readPortString(); + closeConnect(); + + connect(port); + send("2" + id1 + " " + id2); + readReturnPipedProcesses(); + closeConnect(); + + connect(port); + send("4" + id1); + readReturnPipedProcesses(); + closeConnect(); + + connect(port); + send("4" + id2); + readReturnPipedProcesses(); + closeConnect(); + + portString = id2; + portString2 = id1; + } + + public void sendFileData(String fileName, String data) throws LauncherException { + connect(port); + send("7" + fileName); + sendFileData(data); + send("7" + fileName); + readReturn(); + closeConnect(); + } + + public String getFileData(String fileName) throws LauncherException { + connect(port); + send("8" + fileName); + String s = readDataUntilCompletion(); + closeConnect(); + return s; + } + + public void deleteFile(String fileName) throws LauncherException { + connect(port); + send("9" + fileName); + readReturn(); + closeConnect(); + } + + public void sendKillProcessRequest() throws LauncherException { + connect(port); + send("6" + portString); + closeConnect(); + if(portString2 != -1) { + connect(port); + send("6" + portString2); + closeConnect(); + } + } + + public void sendKillAllProcessRequest() throws LauncherException { + connect(port); + send("5"); + closeConnect(); + } + + public String getDataFromProcess() throws LauncherException { + go = true; + StringBuffer bf = new StringBuffer(); + + //System.out.println("Connect"); + connect(portString); + + String s; + + //System.out.println("Waiting for data"); + while (((s = readProcessData()) != null) && (go == true)) { + bf.append(s + "\n"); + } + + //System.out.println("no more data : stopped"); + closeConnect(); + //System.out.println("Closed"); + + return new String(bf); + } + + public void fillJTA(JTextArea jta) throws LauncherException { + go = true; + + //System.out.println("Connect"); + connect(portString); + + String s; + + //System.out.println("Waiting for data"); + while (((s = readProcessData()) != null) && (go == true)) { + jta.append(s + "\n"); + } + + //System.out.println("no more data : stopped"); + closeConnect(); + //System.out.println("Closed"); + + } + + public void closeConnect() throws LauncherException { + try { + clientSocket.close(); + } catch (IOException io) { + throw new LauncherException(SERV_NOT_RESP+host); + } + } + + + + + + private void send(String s) throws LauncherException { + //System.out.println("Sending: " + s); + try { + out.println(s); + out.flush(); + } catch (Exception e) { + throw new LauncherException(IO_ERROR); + } + } + + private void sendFileData(String data) throws LauncherException { + //System.out.println("Sending data"); + StringReader sr = new StringReader(data); + BufferedReader br = new BufferedReader(sr); + String s; + try { + while((s = br.readLine()) != null) { + send("8" + s); + } + } catch (Exception e) { + throw new LauncherException(FILE_FAILED); + } + } + + + + private String readProcessData() throws LauncherException { + int nb; + String s = null; + try { + s = in.readLine(); + nb = Integer.decode(s.substring(0,1)).intValue(); + } catch(IOException io) { + throw new LauncherException(IO_ERROR); + } + + if (nb == 5) { + return null; + } + + s = s.substring(1, s.length()); + if (s == null) { + s = ""; + } + + return s; + } + + private String readDataUntilCompletion() throws LauncherException { + int nb=0, nbTotal, cpt = 0; + String s = null; + StringBuffer ret = new StringBuffer(); + char []c = new char[BUFSIZE+1]; + int read; + + try { + //System.out.println("Reading first data "); + s = in.readLine(); + nb = Integer.decode(s.substring(0,1)).intValue(); + if (nb == 8) { + nbTotal = Integer.decode(s.substring(1,s.length())).intValue(); + //System.out.println("Total= " + nbTotal); + while (((cpt < nbTotal) && (read = in.read(c, 0, Math.min(BUFSIZE, nbTotal - cpt))) > -1)) { + //s = new String(c, 0, read); + //System.out.println("Nb read: " + read + " size of s =" + s.length()); + //nb = Integer.decode(s.substring(0,1)).intValue(); + //ret.append(s.substring(0, s.length())); + ret.append(c, 0, read); + cpt += read; + } + // Read last info + //System.out.println("Reading last info"); + nb = readReturn(); + //System.out.println("Return = " + nb); + //read = in.read(c, 0, 1); + //s = new String(c, 0, read); + //System.out.println("Last s=" + s + " read=" + read); + //nb = Integer.decode(s.substring(0,1)).intValue(); + //System.out.println("Last info=" + nb); + //nb= 3; + } + } catch(IOException io) { + throw new LauncherException(IO_ERROR); + } + + if (nb != 3) { + throw new LauncherException(FILE_FAILED); + } + + return new String(ret); + } + + + + private int readReturn() throws LauncherException { + int nb; + String s = null; + + try { + //System.out.println("Reading line"); + s = in.readLine(); + //System.out.println("Line read"); + //System.out.println("Converting nb s=>" + s + "<"); + nb = Integer.decode(s.substring(0,1)).intValue(); + //System.out.println("Nb = " + nb); + } catch(IOException io) { + System.out.println("Exception 0"); + throw new LauncherException(IO_ERROR); + } + + if (nb != 3) { + System.out.println("Exception 1"); + throw new LauncherException(FILE_FAILED); + } + return nb; + } + + private int readId() throws LauncherException { + int nb; + String s = null; + + try { + s = in.readLine(); + nb = Integer.decode(s.substring(0,1)).intValue(); + } catch(IOException io) { + throw new LauncherException(IO_ERROR); + } + + if (nb == 0) { + throw new LauncherException(ID_FAILED); + } + + return nb; + } + + private void readReturnPipedProcesses() throws LauncherException { + int nb; + String s = null; + + try { + s = in.readLine(); + nb = Integer.decode(s.substring(0,1)).intValue(); + } catch(IOException io) { + throw new LauncherException(IO_ERROR); + } + + if (nb != 3) { + throw new LauncherException(PROC_FAILED); + } + } + + private int readPortString() throws LauncherException { + int nb; + String s = null; + try { + s = in.readLine(); + nb = Integer.decode(s.substring(0,1)).intValue(); + } catch(IOException io) { + throw new LauncherException(IO_ERROR); + } + + if (nb == 2) { + throw new LauncherException(PROC_FAILED); + } + + portString = -1; + portString2 = -1; + try { + portString = Integer.decode(s.substring(1, s.length())).intValue(); + } catch (Exception e) { + throw new LauncherException(IO_ERROR); + } + + if (portString <1) { + throw new LauncherException(PROC_FAILED); + } + + return portString; + } + + private void connect(int portNet) throws LauncherException { + InetAddress ina = null; + + //System.out.println("Connecting on port " + portNet); + + if (host == null) { + throw new LauncherException(NO_HOST); + } + + try { + ina = InetAddress.getByName(host); + } catch (UnknownHostException e) { + throw new LauncherException(INET + host); + } + + try { + clientSocket = new Socket(ina, portNet); + } catch (IOException io) { + throw new LauncherException(SERV_NOT_RESP+host); + } + + try { + in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + //in2 = new DataInputStream(clientSocket.getInputStream()); + out = new PrintStream(clientSocket.getOutputStream()); + //System.out.println("Connected on port " + portNet); + } catch (Exception e) { + throw new LauncherException(SERV_NOT_RESP+host); + } + } + + /*private void basicConnect() throws LauncherException { + InetAddress ina = null; + + if (host == null) { + throw new LauncherException(NO_HOST); + } + + try { + ina = InetAddress.getByName(host); + } catch (UnknownHostException e) { + throw new LauncherException(INET + host); + } + + try { + clientSocket = new Socket(ina, port); + } catch (IOException io) { + throw new LauncherException(SERV_NOT_RESP+host); + } + + try { + in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + //in2 = new DataInputStream(clientSocket.getInputStream()); + out = new PrintStream(clientSocket.getOutputStream()); + } catch (Exception e) { + throw new LauncherException(SERV_NOT_RESP+host); + } + }*/ + +} \ No newline at end of file diff --git a/src/remotesimulation/RemoteConnectionException.class b/src/remotesimulation/RemoteConnectionException.class new file mode 100644 index 0000000000000000000000000000000000000000..b3420c6e6e8070c6cbfe4088895275e4641e00dc GIT binary patch literal 267 zcmZ`zJr4mv5Pf^N;}C^tB~(5Vmk1Tn2$d)h{W=?2x!aX<C;pa7qVNO!C^35lm6>Ed z-h1;hulM5#ppUYP3|t3A2PFo3ER~EW47Jwc$S>RrxH@?2IFjlxYHt~`Q@s}qm4#Gd znS?tLZTK!A#9iwo^2J=5rM?oOj>S|fCHz=wHM{!aWQLw`Eg_2>LnlgAXBj2|H>CIX ujG_8_=WB)rEc)IAqa;(RHf>G9E$Visdk4FvyhGJZ(E;g(q|6gyq3{996hKt~ literal 0 HcmV?d00001 diff --git a/src/remotesimulation/RemoteConnectionException.java b/src/remotesimulation/RemoteConnectionException.java new file mode 100755 index 0000000000..e351288023 --- /dev/null +++ b/src/remotesimulation/RemoteConnectionException.java @@ -0,0 +1,55 @@ +/**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 RemoteConnectionException + * For remote control of the simulator + * Creation: 16/04/2009 + * @version 1.1 16/04/2009 + * @author Ludovic APVRILLE + * @see + */ + +package remotesimulation; + +public class RemoteConnectionException extends Exception { + + public RemoteConnectionException(String s) { + super(s); + } + +} \ No newline at end of file diff --git a/src/translator/touppaal/TURTLE2UPPAAL.java b/src/translator/touppaal/TURTLE2UPPAAL.java index d8437a408d..c63dc5601a 100755 --- a/src/translator/touppaal/TURTLE2UPPAAL.java +++ b/src/translator/touppaal/TURTLE2UPPAAL.java @@ -966,7 +966,7 @@ public class TURTLE2UPPAAL { previous.setUrgent(); loc = addLocation(template); - loc.setUrgent(); + //loc.setUrgent(); tr = addTransition(template, previous, loc); action = convertGuard(adch.getGuard(0)); setGuard(tr, action); diff --git a/src/ui/ColorManager.java b/src/ui/ColorManager.java index 286825bb65..d9a489c005 100755 --- a/src/ui/ColorManager.java +++ b/src/ui/ColorManager.java @@ -63,7 +63,9 @@ public class ColorManager { public static Color SELECTED_0 = Color.blue; public static final Color MOVING_0 = Color.magenta; public static final Color ADDING_0 = Color.lightGray; + public static final Color POINTED_0 = Color.orange; + //public static final Color POINTED_0 = new Color(231, 132, 19); public static final Color COMPOSITION_OPERATOR = Color.yellow; public static final Color ATTRIBUTE_BOX = new Color(199, 243, 105); @@ -78,7 +80,8 @@ public class ColorManager { public static final Color CPU_BOX_1 = new Color(198, 235, 249); public static final Color CPU_BOX_2 = new Color(198, 227, 249); - public static final Color BUS_BOX = new Color(255, 207, 114); + //public static final Color BUS_BOX = new Color(255, 207, 114); + public static final Color BUS_BOX = new Color(215, 188, 128); public static final Color BRIDGE_BOX = new Color(215, 166, 72); public static final Color MEMORY_BOX = new Color(172, 234, 211); public static final Color HWA_BOX = new Color(144, 201, 211); diff --git a/src/ui/tmlcd/TMLTaskOperator.java b/src/ui/tmlcd/TMLTaskOperator.java index e246655262..503cca3a55 100755 --- a/src/ui/tmlcd/TMLTaskOperator.java +++ b/src/ui/tmlcd/TMLTaskOperator.java @@ -63,7 +63,7 @@ public class TMLTaskOperator extends TGCWithInternalComponent implements TMLTask protected int textX = 5; protected int textY = 18; protected Graphics graphics; - protected int iconSize = 30; + protected int iconSize = 16; protected boolean exit = false; protected int exitFontSize = 10; @@ -154,7 +154,10 @@ public class TMLTaskOperator extends TGCWithInternalComponent implements TMLTask if (graphics == null) { return minWidth; } - int size = graphics.getFontMetrics().stringWidth(value) + iconSize + 5; + Font f = graphics.getFont(); + graphics.setFont(f.deriveFont(Font.BOLD)); + int size = graphics.getFontMetrics().stringWidth(value) + iconSize + 13; + graphics.setFont(f); minDesiredWidth = Math.max(size, minWidth); return minDesiredWidth; } diff --git a/src/ui/tmldd/TMLArchiArtifact.java b/src/ui/tmldd/TMLArchiArtifact.java index 4d759f2450..c105ab2c25 100755 --- a/src/ui/tmldd/TMLArchiArtifact.java +++ b/src/ui/tmldd/TMLArchiArtifact.java @@ -60,10 +60,10 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa protected int lineLength = 5; protected int textX = 5; protected int textY = 15; - protected int textY2 = 40; + protected int textY2 = 35; protected int space = 5; - protected int fileX = 15; - protected int fileY = 20; + protected int fileX = 20; + protected int fileY = 25; protected int cran = 5; protected String oldValue = ""; @@ -75,7 +75,7 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); width = 75; - height = 50; + height = 40; minWidth = 75; nbConnectingPoint = 0; @@ -118,6 +118,8 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa g.drawLine(x+width-space, y+space+fileY, x+width-space-fileX, y+space+fileY); g.drawLine(x+width-space-cran, y+space, x+width-space-cran, y+space+cran); g.drawLine(x+width-space-cran, y+space+cran, x + width-space, y+space+cran); + + g.drawImage(IconManager.img9, x+width-space-fileX + 3, y + space + 7, null); g.drawString(value, x + textX , y + textY); diff --git a/src/ui/tmldd/TMLArchiBUSNode.java b/src/ui/tmldd/TMLArchiBUSNode.java index 4aa8836be9..fc99c7fc17 100755 --- a/src/ui/tmldd/TMLArchiBUSNode.java +++ b/src/ui/tmldd/TMLArchiBUSNode.java @@ -135,12 +135,17 @@ public class TMLArchiBUSNode extends TMLArchiCommunicationNode implements Swallo // Strings String ster = "<<" + stereotype + ">>"; int w = g.getFontMetrics().stringWidth(ster); + Font f = g.getFont(); + g.setFont(f.deriveFont(Font.BOLD)); g.drawString(ster, x + (width - w)/2, y + textY1); + g.setFont(f); w = g.getFontMetrics().stringWidth(name); g.drawString(name, x + (width - w)/2, y + textY2); // Icon - g.drawImage(IconManager.imgic1102.getImage(), x + width - 20, y + 4, null); + //g.drawImage(IconManager.imgic1102.getImage(), x + width - 20, y + 4, null); + g.drawImage(IconManager.imgic1102.getImage(), x + 4, y + 4, null); + g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/ui/tmldd/TMLArchiBridgeNode.java b/src/ui/tmldd/TMLArchiBridgeNode.java index ab436c4322..fcb17183ef 100755 --- a/src/ui/tmldd/TMLArchiBridgeNode.java +++ b/src/ui/tmldd/TMLArchiBridgeNode.java @@ -137,7 +137,9 @@ public class TMLArchiBridgeNode extends TMLArchiCommunicationNode implements Swa g.drawString(name, x + (width - w)/2, y + textY2); // Icon - g.drawImage(IconManager.imgic1104.getImage(), x + width - 20, y + 4, null); + //g.drawImage(IconManager.imgic1104.getImage(), x + width - 20, y + 4, null); + g.drawImage(IconManager.imgic1104.getImage(), x + 4, y + 4, null); + g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/ui/tmldd/TMLArchiCPUNode.java b/src/ui/tmldd/TMLArchiCPUNode.java index 5a54875c9f..eb1b0185f6 100755 --- a/src/ui/tmldd/TMLArchiCPUNode.java +++ b/src/ui/tmldd/TMLArchiCPUNode.java @@ -1,4 +1,4 @@ -/**Copyright or � or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille ludovic.apvrille AT enst.fr diff --git a/src/ui/tmldd/TMLArchiCommunicationArtifact.java b/src/ui/tmldd/TMLArchiCommunicationArtifact.java index ef6ef998c4..73ecda3abc 100755 --- a/src/ui/tmldd/TMLArchiCommunicationArtifact.java +++ b/src/ui/tmldd/TMLArchiCommunicationArtifact.java @@ -60,10 +60,10 @@ public class TMLArchiCommunicationArtifact extends TGCWithoutInternalComponent i protected int lineLength = 5; protected int textX = 5; protected int textY = 15; - protected int textY2 = 40; + protected int textY2 = 35; protected int space = 5; - protected int fileX = 15; - protected int fileY = 20; + protected int fileX = 20; + protected int fileY = 25; protected int cran = 5; protected String oldValue = ""; @@ -75,7 +75,7 @@ public class TMLArchiCommunicationArtifact extends TGCWithoutInternalComponent i super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp); width = 75; - height = 50; + height = 40; minWidth = 75; nbConnectingPoint = 0; @@ -112,6 +112,8 @@ public class TMLArchiCommunicationArtifact extends TGCWithoutInternalComponent i g.drawLine(x+width-space-cran, y+space, x+width-space-cran, y+space+cran); g.drawLine(x+width-space-cran, y+space+cran, x + width-space, y+space+cran); + g.drawImage(IconManager.img9, x+width-space-fileX + 3, y + space + 7, null); + g.drawString(value, x + textX , y + textY); Font f = g.getFont(); diff --git a/src/ui/tmldd/TMLArchiHWANode.java b/src/ui/tmldd/TMLArchiHWANode.java index f7e820b28f..c150ebdd8c 100755 --- a/src/ui/tmldd/TMLArchiHWANode.java +++ b/src/ui/tmldd/TMLArchiHWANode.java @@ -142,7 +142,8 @@ public class TMLArchiHWANode extends TMLArchiNode implements SwallowTGComponent, g.drawString(name, x + (width - w)/2, y + textY2); // Icon - g.drawImage(IconManager.imgic1106.getImage(), x + width - 20, y + 4, null); + g.drawImage(IconManager.imgic1106.getImage(), x + 4, y + 4, null); + g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { diff --git a/src/ui/tmldd/TMLArchiMemoryNode.java b/src/ui/tmldd/TMLArchiMemoryNode.java index a8ea84b9e6..548e53dc01 100755 --- a/src/ui/tmldd/TMLArchiMemoryNode.java +++ b/src/ui/tmldd/TMLArchiMemoryNode.java @@ -132,12 +132,17 @@ public class TMLArchiMemoryNode extends TMLArchiCommunicationNode implements Swa // Strings String ster = "<<" + stereotype + ">>"; int w = g.getFontMetrics().stringWidth(ster); + Font f = g.getFont(); + g.setFont(f.deriveFont(Font.BOLD)); g.drawString(ster, x + (width - w)/2, y + textY1); w = g.getFontMetrics().stringWidth(name); + g.setFont(f); g.drawString(name, x + (width - w)/2, y + textY2); // Icon - g.drawImage(IconManager.imgic1108.getImage(), x + width - 20, y + 4, null); + //g.drawImage(IconManager.imgic1108.getImage(), x + width - 20, y + 4, null); + g.drawImage(IconManager.imgic1108.getImage(), x + 4, y + 4, null); + g.drawImage(IconManager.img9, x + width - 20, y + 4, null); } public TGComponent isOnOnlyMe(int x1, int y1) { -- GitLab