diff --git a/doc/codegeneration/codegeneration_documentation.tex b/doc/codegeneration/codegeneration_documentation.tex index a8a34b629133fe618b68cfaa45981bf1a6241cdb..723b99467583ff2a79fdf45b08d32de3f9063d0d 100644 --- a/doc/codegeneration/codegeneration_documentation.tex +++ b/doc/codegeneration/codegeneration_documentation.tex @@ -153,10 +153,10 @@ The previous configuration assumes that a \textbf{c compiler}, referenced by the \section{A first example} This very first example explains how to generate the code from an AVATAR design model, and how to introduce your own basic C directive in the code generation process. -\section{Getting the example} +\subsection{Getting the example} Be sure to get the latest version of TTool including the remote loading of models (June 2017 and after). Do: File, Open from TTool repository, and select "HelloWorldCodeGeneration.xml". -\section{Understanding the model} +\subsection{Understanding the model} This models contains a design diagram composed of one MainBlock. This later regularly executes the "printHelloWorld" method (see Figure \ref{fig:printhelloworld}). @@ -164,13 +164,19 @@ This models contains a design diagram composed of one MainBlock. This later regu \centering \includegraphics[scale=0.65]{figures/bdhelloworld.pdf} \hspace{1cm} -\includegraphics[scale=0.65]{figures/smdhelloworld.pdf} +\includegraphics[Width]{figures/smdhelloworld.pdf} \caption{Hello world model} \label{fig:printhelloworld} \end{figure*} You may then check the syntax of the diagram, and select the "interactive simulation icon". From the window that opens, make a step by step simulation, and observe the behaviour of the system. This behaviour is simulated, that is, there is no executable code that is generated to execute the system. -\section{Generating executable code} +\begin{figure*}[htbp] +\centering +\includegraphics[width=1\textwidth]{figures/simulationhelloworld} +\caption{Functional simulation of the Hello world model} \label{fig:simuhelloworld} +\end{figure*} + +\subsection{Generating executable code} To generate executable code, diff --git a/doc/codegeneration/figures/simulationhelloworld.png b/doc/codegeneration/figures/simulationhelloworld.png new file mode 100644 index 0000000000000000000000000000000000000000..74c831956d5b62a6acd9221f2776f99117845638 Binary files /dev/null and b/doc/codegeneration/figures/simulationhelloworld.png differ diff --git a/src/main/java/myutil/GraphicLib.java b/src/main/java/myutil/GraphicLib.java index e901a6f77f7233633f9392cbe8d9243a1a79d6a0..94e492152838bd91c1f1468a67bf28bf8dfb90f5 100755 --- a/src/main/java/myutil/GraphicLib.java +++ b/src/main/java/myutil/GraphicLib.java @@ -631,7 +631,11 @@ public final class GraphicLib { public static JTabbedPane createTabbedPane() { final JTabbedPane pane = new JTabbedPane( JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT ); + return pane; + } + public static JTabbedPane createTabbedPaneRegular() { + final JTabbedPane pane = new JTabbedPane( JTabbedPane.TOP); return pane; } } diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java index 8f4fdadf1b7e97c63f43cd9f8c9c58fef1c0bf4c..40533b7ba3b69e72f9ec41e7ee2f855fc16a90b5 100755 --- a/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java +++ b/src/main/java/ui/avatarinteractivesimulation/AvatarInteractiveSimulationActions.java @@ -1,48 +1,48 @@ /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille -ludovic.apvrille AT enst.fr - -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. - -/** - * Class AvatarInteractiveSimulationActions - * - * Creation: 21/01/2011 - * @version 1.0 21/01/2011 - * @author Ludovic APVRILLE - * @see TGComponent - */ + 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 AvatarInteractiveSimulationActions + * + * Creation: 21/01/2011 + * @version 1.0 21/01/2011 + * @author Ludovic APVRILLE + * @see TGComponent + */ package ui.avatarinteractivesimulation; @@ -57,63 +57,63 @@ import java.awt.event.ActionListener; public class AvatarInteractiveSimulationActions extends AbstractAction { // Actions public static final int ACT_RUN_SIMU = 0; - public static final int ACT_STOP_SIMU = 1; - public static final int ACT_RESET_SIMU = 2; - public static final int ACT_RUN_X_TIME_UNITS = 6; - public static final int ACT_RUN_TO_TIME = 7; - public static final int ACT_RUN_X_TRANSACTIONS = 8; - public static final int ACT_RUN_X_COMMANDS = 9; - - public static final int ACT_RUN_EXPLORATION = 20; - public static final int ACT_RUN_TO_NEXT_BUS_TRANSFER = 21; - public static final int ACT_BACK_ONE = 22; - public static final int ACT_RUN_UNTIL_TASK_EXECUTES = 23; - public static final int ACT_RUN_UNTIL_MEMORY_ACCESS = 24; - public static final int ACT_RUN_UNTIL_CHANNEL_ACCESS = 25; - - public static final int ACT_SAVE_SD_PNG = 10; - public static final int ACT_SAVE_SVG = 11; - public static final int ACT_SAVE_TXT = 12; - - public static final int ACT_PRINT_BENCHMARK = 26; - public static final int ACT_SAVE_BENCHMARK = 27; - - public static final int ACT_SAVE_STATE = 13; - public static final int ACT_RESTORE_STATE = 14; - - public static final int ACT_START_ALL = 3; - public static final int ACT_STOP_ALL = 4; - public static final int ACT_STOP_AND_CLOSE_ALL = 5; - - public static final int ACT_UPDATE_VARIABLES = 15; - public static final int ACT_UPDATE_CPUS = 16; - public static final int ACT_UPDATE_MEMS = 17; - public static final int ACT_UPDATE_BUS = 18; - public static final int ACT_UPDATE_TASKS = 19; - - public static final int ACT_PRINT_CPUS = 28; - public static final int ACT_PRINT_BUS = 29; - - public static final int ACT_ZOOM_IN = 30; - public static final int ACT_ZOOM_OUT = 31; - - public static final int ACT_DELETE_ASYNC_MSG = 32; - public static final int ACT_UP_ASYNC_MSG = 33; - public static final int ACT_DOWN_ASYNC_MSG = 34; - + public static final int ACT_STOP_SIMU = 1; + public static final int ACT_RESET_SIMU = 2; + public static final int ACT_RUN_X_TIME_UNITS = 6; + public static final int ACT_RUN_TO_TIME = 7; + public static final int ACT_RUN_X_TRANSACTIONS = 8; + public static final int ACT_RUN_X_COMMANDS = 9; + + public static final int ACT_RUN_EXPLORATION = 20; + public static final int ACT_RUN_TO_NEXT_BUS_TRANSFER = 21; + public static final int ACT_BACK_ONE = 22; + public static final int ACT_RUN_UNTIL_TASK_EXECUTES = 23; + public static final int ACT_RUN_UNTIL_MEMORY_ACCESS = 24; + public static final int ACT_RUN_UNTIL_CHANNEL_ACCESS = 25; + + public static final int ACT_SAVE_SD_PNG = 10; + public static final int ACT_SAVE_SVG = 11; + public static final int ACT_SAVE_TXT = 12; + + public static final int ACT_PRINT_BENCHMARK = 26; + public static final int ACT_SAVE_BENCHMARK = 27; + + public static final int ACT_SAVE_STATE = 13; + public static final int ACT_RESTORE_STATE = 14; + + public static final int ACT_START_ALL = 3; + public static final int ACT_STOP_ALL = 4; + public static final int ACT_STOP_AND_CLOSE_ALL = 5; + + public static final int ACT_UPDATE_VARIABLES = 15; + public static final int ACT_UPDATE_CPUS = 16; + public static final int ACT_UPDATE_MEMS = 17; + public static final int ACT_UPDATE_BUS = 18; + public static final int ACT_UPDATE_TASKS = 19; + + public static final int ACT_PRINT_CPUS = 28; + public static final int ACT_PRINT_BUS = 29; + + public static final int ACT_ZOOM_IN = 30; + public static final int ACT_ZOOM_OUT = 31; + + public static final int ACT_DELETE_ASYNC_MSG = 32; + public static final int ACT_UP_ASYNC_MSG = 33; + public static final int ACT_DOWN_ASYNC_MSG = 34; + public static final int NB_ACTION = 35; private static final TAction [] actions = new TAction[NB_ACTION]; - + private EventListenerList listeners; - + public static final String JLF_IMAGE_DIR = ""; - + public static final String LARGE_ICON = "LargeIcon"; - - + + public AvatarInteractiveSimulationActions(int id) { if (actions[0] == null) { init(); @@ -121,7 +121,7 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { if (actions[id] == null) { return ; } - + putValue(Action.NAME, actions[id].NAME); putValue(Action.SMALL_ICON, actions[id].SMALL_ICON); putValue(LARGE_ICON, actions[id].LARGE_ICON); @@ -132,63 +132,63 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(actions[id].MNEMONIC_KEY, java.awt.event.InputEvent.CTRL_MASK)); } putValue(Action.ACTION_COMMAND_KEY, actions[id].ACTION_COMMAND_KEY); - + } - + public void setName(int index, String name) { actions[index].NAME = name; putValue(Action.NAME, actions[index].NAME); } - + public void init() { actions[ACT_RUN_SIMU] = new TAction("run-simu", "Run simulation", IconManager.imgic1302, IconManager.imgic1302, "Run simulation", "Run simulation until next breakpoint. Works only if the simulator is \"ready\"", 'R'); actions[ACT_STOP_SIMU] = new TAction("stop-simu", "Stop simulation", IconManager.imgic55, IconManager.imgic55, "Stop simulation", "Stop simulation. Works only if the simulator is \"busy\"", 'S'); - actions[ACT_RESET_SIMU] = new TAction("reset-simu", "Reset simulation", IconManager.imgic45, IconManager.imgic45, "Reset simulation", "Reset simulation", 'T'); - actions[ACT_RUN_X_TIME_UNITS] = new TAction("run-x-time-units", "Run x time units", IconManager.imgic1300, IconManager.imgic1300, "Run x time units", "Run simulation for x units of time. Works only if the simulator is \"ready\"", 'R'); + actions[ACT_RESET_SIMU] = new TAction("reset-simu", "Reset simulation", IconManager.imgic45, IconManager.imgic45, "Reset simulation", "Reset simulation", 'T'); + actions[ACT_RUN_X_TIME_UNITS] = new TAction("run-x-time-units", "Run x time units", IconManager.imgic1300, IconManager.imgic1300, "Run x time units", "Run simulation for x units of time. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_TO_TIME] = new TAction("run-to-time", "Run to time x", IconManager.imgic1304, IconManager.imgic1304, "Run to time x", "Run simulation until time x is reached. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_X_TRANSACTIONS] = new TAction("run-x-transactions", "Run x transactions", IconManager.imgic1306, IconManager.imgic1306, "Run x transactions", "Run simulation for x transactions. Works only if the simulator is \"ready\"", 'R'); - actions[ACT_RUN_X_COMMANDS] = new TAction("run-x-commands", "Run x commands", IconManager.imgic1308, IconManager.imgic1308, "Run x commands", "Run simulation for x commands. Works only if the simulator is \"ready\"", 'R'); - - actions[ACT_BACK_ONE] = new TAction("back-one", "Back one transaction", IconManager.imgic47, IconManager.imgic47, "Back one transaction", "Go one transaction backward", 'B'); - - - actions[ACT_RUN_EXPLORATION] = new TAction("run-exploration", "Run exploration", IconManager.imgic1326, IconManager.imgic1326, "Run exploration", "Explore branches of the simulation", 'R'); + actions[ACT_RUN_X_COMMANDS] = new TAction("run-x-commands", "x Step-by-Step", IconManager.imgic1330, IconManager.imgic1330, "x Step-by-Step", "Run simulation for x commands. Works only if the simulator is \"ready\"", 'R'); + + actions[ACT_BACK_ONE] = new TAction("back-one", "Back one transaction", IconManager.imgic47, IconManager.imgic47, "Back one transaction", "Go one transaction backward", 'B'); + + + actions[ACT_RUN_EXPLORATION] = new TAction("run-exploration", "Run exploration", IconManager.imgic1326, IconManager.imgic1326, "Run exploration", "Explore branches of the simulation", 'R'); actions[ACT_RUN_TO_NEXT_BUS_TRANSFER] = new TAction("run-until-bus-transfer", "Run until bus transfer", IconManager.imgic1316, IconManager.imgic1316, "Run until transfer on bus", "Run until a transfer on the indicated bus is performed. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_UNTIL_TASK_EXECUTES] = new TAction("run-to-task", "Run until a task executes", IconManager.imgic1318, IconManager.imgic1318, "Run until a task executes", "Run until a task executes. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_UNTIL_MEMORY_ACCESS] = new TAction("run-to-memory-accessd", "Run until a memory access is performed", IconManager.imgic1322, IconManager.imgic1322, "Run until a memory access is performed", "Run simulation until a memory access is performed on selected memory. Works only if the simulator is \"ready\"", 'R'); actions[ACT_RUN_UNTIL_CHANNEL_ACCESS] = new TAction("run--to-channel-access", "Run until a channel is accessed", IconManager.imgic1324, IconManager.imgic1324, "Run until a channel is accessed", "Run until a channel is accessed. Works only if the simulator is \"ready\"", 'R'); - - actions[ACT_SAVE_SD_PNG] = new TAction("save-sd-png", "Save SD trace in PNG format", IconManager.imgic5104, IconManager.imgic5104, "Save SD trace in PNG format", "Save SD trace in PNG format", '0'); + + actions[ACT_SAVE_SD_PNG] = new TAction("save-sd-png", "Save SD trace in PNG format", IconManager.imgic5104, IconManager.imgic5104, "Save SD trace in PNG format", "Save SD trace in PNG format", '0'); actions[ACT_SAVE_SVG] = new TAction("save-svg", "Save trace in SVG format", IconManager.imgic1328, IconManager.imgic1328, "Save trace in SVG format", "Save trace in SVG format", 'R'); actions[ACT_SAVE_TXT] = new TAction("save-txt", "Save trace in TXT format", IconManager.imgic1314, IconManager.imgic1314, "Save trace in TXT format", "Save trace in TXT format", 'R'); - - actions[ACT_SAVE_STATE] = new TAction("save-state", "Save simulation state in File", IconManager.imgic341, IconManager.imgic341, "Save simulation state in File", "Save simulation state in File", 'R'); + + actions[ACT_SAVE_STATE] = new TAction("save-state", "Save simulation state in File", IconManager.imgic341, IconManager.imgic341, "Save simulation state in File", "Save simulation state in File", 'R'); actions[ACT_RESTORE_STATE] = new TAction("restore-state", "Restore simulation state from File", IconManager.imgic339, IconManager.imgic339, "Restore simulation state from File", "Restore simulation state from File", 'R'); - - actions[ACT_START_ALL] = new TAction("start-all", "Connect to simulator", IconManager.imgic53, IconManager.imgic53, "Connect", "Start the server - if it is not yet running - and connect to it", 'C'); + + actions[ACT_START_ALL] = new TAction("start-all", "Connect to simulator", IconManager.imgic53, IconManager.imgic53, "Connect", "Start the server - if it is not yet running - and connect to it", 'C'); actions[ACT_STOP_ALL] = new TAction("stop-all", "Quit simulation window", IconManager.imgic27, IconManager.imgic27, "Quit simulation window", "Quit the simulation window without terminating the simulation", 'Q'); actions[ACT_STOP_AND_CLOSE_ALL] = new TAction("stop-and-close-all", "Terminate simulation and quit", IconManager.imgic27, IconManager.imgic27, "Terminate simulation and quit", "Terminate the simulation and quit the simulation window", 'T'); - - actions[ACT_UPDATE_VARIABLES] = new TAction("update-variables", "Update variables", IconManager.imgic75, IconManager.imgic75, "Update variables", "Update variables", 'R'); + + actions[ACT_UPDATE_VARIABLES] = new TAction("update-variables", "Update variables", IconManager.imgic75, IconManager.imgic75, "Update variables", "Update variables", 'R'); actions[ACT_UPDATE_CPUS] = new TAction("update-cpus", "Update CPU info", IconManager.imgic75, IconManager.imgic75, "Update CPU information", "Update information on CPUs", 'R'); actions[ACT_UPDATE_MEMS] = new TAction("update-mems", "Update Memories information", IconManager.imgic75, IconManager.imgic75, "Update Memories information", "Update information on Memories", 'R'); actions[ACT_UPDATE_BUS] = new TAction("update-bus", "Update bus info", IconManager.imgic75, IconManager.imgic75, "Update bus information", "Update information on busses", 'R'); actions[ACT_UPDATE_TASKS] = new TAction("update-tasks", "Update task information", IconManager.imgic75, IconManager.imgic75, "Update task information", "Update information on tasks", 'R'); - - actions[ACT_PRINT_CPUS] = new TAction("print-cpus", "Print CPU info", IconManager.imgic75, IconManager.imgic75, "Print CPU information", "Print information on CPUs", 'R'); - actions[ACT_PRINT_BUS] = new TAction("print-bus", "Print Bus info", IconManager.imgic75, IconManager.imgic75, "Print Bus information", "Print information on Busses", 'R'); - - actions[ACT_PRINT_BENCHMARK] = new TAction("print-benchmark", "Print benchmark", IconManager.imgic29, IconManager.imgic29, "Print benchmark", "Print benchmark at simulator side", 'R'); + + actions[ACT_PRINT_CPUS] = new TAction("print-cpus", "Print CPU info", IconManager.imgic75, IconManager.imgic75, "Print CPU information", "Print information on CPUs", 'R'); + actions[ACT_PRINT_BUS] = new TAction("print-bus", "Print Bus info", IconManager.imgic75, IconManager.imgic75, "Print Bus information", "Print information on Busses", 'R'); + + actions[ACT_PRINT_BENCHMARK] = new TAction("print-benchmark", "Print benchmark", IconManager.imgic29, IconManager.imgic29, "Print benchmark", "Print benchmark at simulator side", 'R'); actions[ACT_SAVE_BENCHMARK] = new TAction("save-benchmark", "Save benchmark", IconManager.imgic25, IconManager.imgic25, "Save benchmark", "Save benchmark at simulator side", 'R'); - + actions[ACT_ZOOM_IN] = new TAction("zoommore-command", "Zoom +", IconManager.imgic317, IconManager.imgic317, "Zoom +", "Zoom +", '0'); actions[ACT_ZOOM_OUT] = new TAction("zoomless-command", "Zoom -", IconManager.imgic315, IconManager.imgic315, "Zoom -", "Zoom -", '0'); - + actions[ACT_DELETE_ASYNC_MSG] = new TAction("delete-async-command", "Delete", IconManager.imgic336, IconManager.imgic336, "Delete msg +", "Delete the selected message", '0'); actions[ACT_UP_ASYNC_MSG] = new TAction("up-async-command", "Up", IconManager.imgic78, IconManager.imgic78, "Up msg", "Put a async msg closer to the FIFO exit", '0'); - actions[ACT_DOWN_ASYNC_MSG] = new TAction("up-async-command", "Down", IconManager.imgic79, IconManager.imgic79, "Down msg", "Put a async msg further from the FIFO exit", '0'); + actions[ACT_DOWN_ASYNC_MSG] = new TAction("up-async-command", "Down", IconManager.imgic79, IconManager.imgic79, "Down msg", "Put a async msg further from the FIFO exit", '0'); } - + public String getActionCommand() { return (String)getValue(Action.ACTION_COMMAND_KEY); } @@ -196,7 +196,7 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { public String getShortDescription() { return (String)getValue(Action.SHORT_DESCRIPTION); } - + public String getLongDescription() { return (String)getValue(Action.LONG_DESCRIPTION); } @@ -205,27 +205,27 @@ public class AvatarInteractiveSimulationActions extends AbstractAction { //System.out.println("Action performed"); if (listeners != null) { Object[] listenerList = listeners.getListenerList(); - + // Recreate the ActionEvent and stuff the value of the ACTION_COMMAND_KEY ActionEvent e = new ActionEvent(evt.getSource(), evt.getID(), - (String)getValue(Action.ACTION_COMMAND_KEY)); + (String)getValue(Action.ACTION_COMMAND_KEY)); for (int i = 0; i <= listenerList.length-2; i += 2) { ((ActionListener)listenerList[i+1]).actionPerformed(e); } } } - + public void addActionListener(ActionListener l) { if (listeners == null) { listeners = new EventListenerList(); } listeners.add(ActionListener.class, l); } - + public void removeActionListener(ActionListener l) { if (listeners == null) { return; } listeners.remove(ActionListener.class, l); - } + } } diff --git a/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java b/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java index 0ee7598c2a87c95d0b560f712ba754aa2932f855..796a86b718953849806a26dad9867c7c091820ca 100755 --- a/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java +++ b/src/main/java/ui/avatarinteractivesimulation/AvatarMainCommandsToolBar.java @@ -1,48 +1,48 @@ /**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille -ludovic.apvrille AT enst.fr - -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. - -/** - * Class AvatarMainCommandsToolBar - * Toolbar associated with interactive simulation (main commands) - * Creation: 21/01/2011 - * @version 1.0 21/01/2011 - * @author Ludovic APVRILLE - * @see - */ + ludovic.apvrille AT enst.fr + + This software is a computer program whose purpose is to allow the + edition of TURTLE analysis, design and deployment diagrams, to + allow the generation of RT-LOTOS or Java code from this diagram, + and at last to allow the analysis of formal validation traces + obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + from INRIA Rhone-Alpes. + + This software is governed by the CeCILL license under French law and + abiding by the rules of distribution of free software. You can use, + modify and/ or redistribute the software under the terms of the CeCILL + license as circulated by CEA, CNRS and INRIA at the following URL + "http://www.cecill.info". + + As a counterpart to the access to the source code and rights to copy, + modify and redistribute granted by the license, users are provided only + with a limited warranty and the software's author, the holder of the + economic rights, and the successive licensors have only limited + liability. + + In this respect, the user's attention is drawn to the risks associated + with loading, using, modifying and/or developing or reproducing the + software by the user in light of its specific status of free software, + that may mean that it is complicated to manipulate, and that also + therefore means that it is reserved for developers and experienced + professionals having in-depth computer knowledge. Users are therefore + encouraged to load and test the software's suitability as regards their + requirements in conditions enabling the security of their systems and/or + data to be ensured and, more generally, to use and operate it in the + same conditions as regards security. + + The fact that you are presently reading this means that you have had + knowledge of the CeCILL license and that you accept its terms. + + /** + * Class AvatarMainCommandsToolBar + * Toolbar associated with interactive simulation (main commands) + * Creation: 21/01/2011 + * @version 1.0 21/01/2011 + * @author Ludovic APVRILLE + * @see + */ package ui.avatarinteractivesimulation; @@ -52,113 +52,108 @@ import javax.swing.*; //import java.awt.event.*; public class AvatarMainCommandsToolBar extends AvatarInteractiveSimulationBar { - - + + public AvatarMainCommandsToolBar(JFrameAvatarInteractiveSimulation _jfais) { super(_jfais); } - + protected void setActive(boolean b) { - jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_SIMU].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_TIME_UNITS].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_TO_TIME].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_TRANSACTIONS].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS].setEnabled(b); - //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS].setEnabled(b); + jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_SIMU].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_TIME_UNITS].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_TO_TIME].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_TRANSACTIONS].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS].setEnabled(b); + //jfais.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS].setEnabled(b); jfais.actions[AvatarInteractiveSimulationActions.ACT_STOP_SIMU].setEnabled(b); - jfais.actions[AvatarInteractiveSimulationActions.ACT_RESET_SIMU].setEnabled(b); - jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_X_COMMANDS].setEnabled(b); - - - + jfais.actions[AvatarInteractiveSimulationActions.ACT_RESET_SIMU].setEnabled(b); + jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_X_COMMANDS].setEnabled(b); + + + } - + protected void setButtons() { JButton button; - + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_RESET_SIMU]); button.addMouseListener(jfais.mouseHandler); - - this.addSeparator(); - - button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_BACK_ONE]); + + this.addSeparator(); + + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_BACK_ONE]); button.addMouseListener(jfais.mouseHandler); - - this.addSeparator(); - - button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_STOP_SIMU]); + + this.addSeparator(); + + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_STOP_SIMU]); button.addMouseListener(jfais.mouseHandler); - + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_SIMU]); button.addMouseListener(jfais.mouseHandler); - - - - this.addSeparator(); - - button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_X_COMMANDS]); + + + + this.addSeparator(); + + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_RUN_X_COMMANDS]); button.addMouseListener(jfais.mouseHandler); - + this.addSeparator(); this.addSeparator(); - + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_ZOOM_OUT]); button.addMouseListener(jfais.mouseHandler); - + button = this.add(jfais.actions[AvatarInteractiveSimulationActions.ACT_ZOOM_IN]); button.addMouseListener(jfais.mouseHandler); - - - /*this.addSeparator(); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_TIME]); - button.addMouseListener(jfis.mouseHandler); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_TIME_UNITS]); - button.addMouseListener(jfis.mouseHandler); - - this.addSeparator(); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_TRANSACTIONS]); - button.addMouseListener(jfis.mouseHandler); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS]); - button.addMouseListener(jfis.mouseHandler); - - this.addSeparator(); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION]); - button.addMouseListener(jfis.mouseHandler); - - this.addSeparator(); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES]); - button.addMouseListener(jfis.mouseHandler); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER]); - button.addMouseListener(jfis.mouseHandler); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS]); - button.addMouseListener(jfis.mouseHandler); - - this.addSeparator(); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES]); - button.addMouseListener(jfis.mouseHandler); - - button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS]); - button.addMouseListener(jfis.mouseHandler);*/ - - - } -} // Class + /*this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_TIME]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_TIME_UNITS]); + button.addMouseListener(jfis.mouseHandler); + + this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_TRANSACTIONS]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_X_COMMANDS]); + button.addMouseListener(jfis.mouseHandler); + this.addSeparator(); + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_EXPLORATION]); + button.addMouseListener(jfis.mouseHandler); + this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CPU_EXECUTES]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_TO_NEXT_BUS_TRANSFER]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_MEMORY_ACCESS]); + button.addMouseListener(jfis.mouseHandler); + + this.addSeparator(); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_TASK_EXECUTES]); + button.addMouseListener(jfis.mouseHandler); + + button = this.add(jfis.actions[InteractiveSimulationActions.ACT_RUN_UNTIL_CHANNEL_ACCESS]); + button.addMouseListener(jfis.mouseHandler);*/ + + + } +} // Class diff --git a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java index 9d7b954f1e3a50336b46620745a001e281a76d2d..3150baaa34a3eff1b716709f110675c5758e5601 100755 --- a/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java +++ b/src/main/java/ui/avatarinteractivesimulation/JFrameAvatarInteractiveSimulation.java @@ -398,7 +398,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar commands.setBorder(new javax.swing.border.TitledBorder("Commands")); // Issue #41 Ordering of tabbed panes - commandTab = GraphicLib.createTabbedPane();//new JTabbedPane(); + commandTab = GraphicLib.createTabbedPaneRegular();//new JTabbedPane(); commands.add(commandTab, BorderLayout.CENTER); @@ -422,7 +422,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar c01.fill = GridBagConstraints.BOTH; c01.gridheight = 1; - jp02.add(new JLabel("Command parameter: "), c01); + jp02.add(new JLabel("Nb of steps: "), c01); c01.gridwidth = GridBagConstraints.REMAINDER; //end row paramMainCommand = new JTextField("1", 30); jp02.add(paramMainCommand, c01); @@ -514,7 +514,7 @@ public class JFrameAvatarInteractiveSimulation extends JFrame implements Avatar //c02.gridwidth = GridBagConstraints.REMAINDER; //end row // Issue #41 Ordering of tabbed panes - infoTab = GraphicLib.createTabbedPane();// new JTabbedPane(); + infoTab = GraphicLib.createTabbedPaneRegular();// new JTabbedPane(); infoTab.setPreferredSize(new Dimension(300, 200)); infos.add(infoTab, BorderLayout.CENTER); diff --git a/src/main/java/ui/util/IconManager.java b/src/main/java/ui/util/IconManager.java index 2b44d2502bfcbffa577ce2f9167ffff3e8fc3be9..58b307858b87b2b317c0739e239005034831e167 100755 --- a/src/main/java/ui/util/IconManager.java +++ b/src/main/java/ui/util/IconManager.java @@ -122,6 +122,7 @@ public class IconManager { public static ImageIcon imgic1300, imgic1302, imgic1304, imgic1306, imgic1308; public static ImageIcon imgic1310, imgic1312, imgic1314, imgic1316, imgic1318; public static ImageIcon imgic1320, imgic1322, imgic1324, imgic1326, imgic1328; + public static ImageIcon imgic1330; // SMD diagram @@ -505,6 +506,7 @@ public class IconManager { private static String icon1324 = "steptochan.gif"; private static String icon1326 = "runexplo.gif"; private static String icon1328 = "savesvg24.gif"; + private static String icon1330 = "stepforwardx24.gif"; // SMD diagrams private static String icon2000 = "prosmdsendmsg.gif"; @@ -922,6 +924,7 @@ public class IconManager { imgic1324 = getIcon(icon1324); imgic1326 = getIcon(icon1326); imgic1328 = getIcon(icon1328); + imgic1330 = getIcon(icon1330); imgic2000 = getIcon(icon2000); imgic2002 = getIcon(icon2002); diff --git a/src/main/resources/ui/util/stepforwardx24.gif b/src/main/resources/ui/util/stepforwardx24.gif new file mode 100755 index 0000000000000000000000000000000000000000..58524ada5f557bc2b2506ccebd20e6ec74d46ad0 Binary files /dev/null and b/src/main/resources/ui/util/stepforwardx24.gif differ