Commit b23d7030 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update on code for avatar translation

parent e4fac6b0
...@@ -161,14 +161,14 @@ stdrelease: ...@@ -161,14 +161,14 @@ stdrelease:
mkdir -p $(TTOOL_TARGET)/lib mkdir -p $(TTOOL_TARGET)/lib
cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib
cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib
# simulators # DIPLODOCUS simulators
mkdir -p $(TTOOL_TARGET)/simulators/systemc1/src_simulator #mkdir -p $(TTOOL_TARGET)/simulators/systemc1/src_simulator
mkdir -p $(TTOOL_TARGET)/simulators/systemc1/lib #mkdir -p $(TTOOL_TARGET)/simulators/systemc1/lib
cp $(TTOOL_SIMULATORS)/systemc1/lib/README $(TTOOL_TARGET)/simulators/systemc1/lib/ #cp $(TTOOL_SIMULATORS)/systemc1/lib/README $(TTOOL_TARGET)/simulators/systemc1/lib/
cp $(TTOOL_SIMULATORS)/systemc1/Makefile $(TTOOL_TARGET)/simulators/systemc1 #cp $(TTOOL_SIMULATORS)/systemc1/Makefile $(TTOOL_TARGET)/simulators/systemc1
cp $(TTOOL_SIMULATORS)/systemc1/Makefile.defs $(TTOOL_TARGET)/simulators/systemc1 #cp $(TTOOL_SIMULATORS)/systemc1/Makefile.defs $(TTOOL_TARGET)/simulators/systemc1
cp $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.cpp $(TTOOL_TARGET)/simulators/systemc1/src_simulator #cp $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.cpp $(TTOOL_TARGET)/simulators/systemc1/src_simulator
cp $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.h $(TTOOL_TARGET)/simulators/systemc1/src_simulator #cp $(TTOOL_SIMULATORS)/systemc1/src_simulator/*.h $(TTOOL_TARGET)/simulators/systemc1/src_simulator
mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator
mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/app mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/app
mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/arch mkdir -p $(TTOOL_TARGET)/simulators/c++2/src_simulator/arch
...@@ -256,9 +256,86 @@ preinstall: jar preinstall_linux ...@@ -256,9 +256,86 @@ preinstall: jar preinstall_linux
preinstall_linux: preinstall_linux:
#jars #jars
cp $(TTOOL_BIN)/*.jar $(TTOOL_PREINSTALL_LINUX)/TTool/bin/ cp $(TTOOL_BIN)/*.jar $(TTOOL_PREINSTALL_LINUX)/TTool/bin/
#models
cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_XML) $(TTOOL_PREINSTALL_LINUX)/TTool/modeling/ cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_XML) $(TTOOL_PREINSTALL_LINUX)/TTool/modeling/
cp $(TTOOL_DOC)/README_modeling $(TTOOL_PREINSTALL_LINUX)/TTool/modeling/ cp $(TTOOL_DOC)/README_modeling $(TTOOL_PREINSTALL_LINUX)/TTool/modeling/
# lib
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/lib
cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_LIB) $(TTOOL_PREINSTALL_LINUX)/TTool/lib
cp $(TTOOL_DOC)/README_lib cp $(RELEASE_STD_FILES_LIB) $(TTOOL_PREINSTALL_LINUX)/TTool/lib
# DIPLODOCUS simulators
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/app
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/arch
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/ebrdd
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/evt
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/sim
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/TEPE
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/lib
cp $(TTOOL_SIMULATORS)/c++2/lib/README $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/lib/
cp $(TTOOL_SIMULATORS)/c++2/Makefile $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2
cp $(TTOOL_SIMULATORS)/c++2/Makefile.defs $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2
cp $(TTOOL_SIMULATORS)/c++2/schedstyle.css $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/app/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/app
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/app/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/app
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/arch/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/arch
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/arch/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/arch
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/ebrdd/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/ebrdd
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/ebrdd/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/ebrdd
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/evt/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/evt
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/evt/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/evt
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/sim/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/sim
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/sim/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/sim
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.cpp $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/TEPE
cp $(TTOOL_SIMULATORS)/c++2/src_simulator/TEPE/*.h $(TTOOL_PREINSTALL_LINUX)/TTool/simulators/c++2/src_simulator/TEPE
# Licenses
cd $(TTOOL_DOC); cp $(RELEASE_STD_FILES_LICENSES) $(TTOOL_PREINSTALL_LINUX)/TTool
# Main readme
cp $(TTOOL_DOC)/README $(TTOOL_PREINSTALL_LINUX)/TTool
# LOTOS
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool)/lotos
cp $(TTOOL_DOC)/README_lotos $(TTOOL_PREINSTALL_LINUX)/TTool/lotos
#NC
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/nc
cp $(TTOOL_DOC)/README_nc $(TTOOL_TARGET)/nc
#TML
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/tmlcode
cp $(TTOOL_DOC)/README_tml $(TTOOL_PREINSTALL_LINUX)/TTool/tmlcode
#UPPAAL
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/uppaal
cp $(TTOOL_DOC)/README_uppaal $(TTOOL_PREINSTALL_LINUX)/TTool/uppaal
# Proverif
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/proverif
cp $(TTOOL_DOC)/README_proverif $(TTOOL_PREINSTALL_LINUX)/TTool/proverif
# Figure
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/figure
cp $(TTOOL_DOC)/README_figure $(TTOOL_PREINSTALL_LINUX)/TTool/figure
# VCD
mkdir -p $(TTOOL_PREINSTALL_LINUX)/TTool/vcd
cp $(TTOOL_DOC)/README_vcd $(TTOOL_PREINSTALL_LINUX)/TTool/vcd
# Basic doc
mkdir -p $(TTOOL_TARGET)/doc
cp $(TTOOL_DOC)/README_doc $(TTOOL_TARGET)/doc
# AVATAR executable code
mkdir -p $(TTOOL_TARGET)/executablecode
mkdir -p $(TTOOL_TARGET)/executablecode/src
mkdir -p $(TTOOL_TARGET)/executablecode/generated_src
cp $(TTOOL_EXECUTABLECODE)/Makefile $(TTOOL_TARGET)/executablecode/
cp $(TTOOL_EXECUTABLECODE)/Makefile.defs $(TTOOL_TARGET)/executablecode/
cp $(TTOOL_EXECUTABLECODE)/Makefile.forsoclib $(TTOOL_TARGET)/executablecode/
cp $(TTOOL_EXECUTABLECODE)/src/*.c $(TTOOL_TARGET)/executablecode/src/
cp $(TTOOL_EXECUTABLECODE)/src/*.h $(TTOOL_TARGET)/executablecode/src/
cp $(TTOOL_EXECUTABLECODE)/generated_src/README $(TTOOL_TARGET)/executablecode/generated_src/
# Basic bin
mkdir -p $(TTOOL_TARGET)/bin
cp $(TTOOL_DOC)/README_bin $(TTOOL_TARGET)/bin
cp $(TTOOL_BIN)/configuration.gcf $(TTOOL_TARGET)/bin
cp -R $(TTOOL_BIN)/$(TTOOL_LOTOS_H).h $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.h $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.t $(TTOOL_BIN)/$(TTOOL_LOTOS_H)_?.f $(TTOOL_TARGET)/bin
cp $(TTOOL_BIN)/$(TTOOL_BINARY) $(TTOOL_BIN)/$(LAUNCHER_BINARY) $(TTOOL_BIN)/$(TIFTRANSLATOR_BINARY) $(TTOOL_BIN)/$(TMLTRANSLATOR_BINARY) $(TTOOL_BIN)/$(RUNDSE_BINARY) $(TTOOL_BIN)/$(TTOOL_CONFIG_SRC) $(TTOOL_BIN)/$(JSOUP_BINARY) $(TTOOL_BIN)/$(COMMON_CODEC_BINARY) $(TTOOL_TARGET)/bin
jttooljar: jttooljar:
cd $(JTTOOL);$(JAVAC) $(JTTOOL_DIR)/*.java;$(JAR) cmf $(TTOOL_SRC)/$(TTOOL_JAR_TXT) $(TTOOL_BIN)/$(JTTOOL_JAR) $(JTTOOL_DIR)/*.class cd $(JTTOOL);$(JAVAC) $(JTTOOL_DIR)/*.java;$(JAR) cmf $(TTOOL_SRC)/$(TTOOL_JAR_TXT) $(TTOOL_BIN)/$(JTTOOL_JAR) $(JTTOOL_DIR)/*.class
......
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
<ExternalServer data="10.188.65.215:12345"/> <ExternalServer data="10.188.65.215:12345"/>
<LastWindowAttributes x="90" y="25" width="1219" height="597" max="false" /> <LastWindowAttributes x="494" y="224" width="1219" height="597" max="false" />
<ProVerifHash data=""/>
</TURTLECONFIGURATION> </TURTLECONFIGURATION>
SRCS = generated_src/main.c generated_src/ObserverProp1.c generated_src/RemotelyControlledMicrowave.c generated_src/RemoteControl.c generated_src/MicroWaveOven.c generated_src/Bell.c generated_src/ControlPanel.c generated_src/Controller.c generated_src/Magnetron.c generated_src/Door.c generated_src/WirelessInterface.c SRCS = generated_src/main.c generated_src/ObserverProp1.c generated_src/RemotelyControlledMicrowave.c generated_src/MicroWaveOven.c generated_src/Bell.c generated_src/ControlPanel.c generated_src/Controller.c generated_src/Magnetron.c generated_src/Door.c
\ No newline at end of file \ No newline at end of file
...@@ -301,10 +301,10 @@ public class Main implements ActionListener { ...@@ -301,10 +301,10 @@ public class Main implements ActionListener {
} }
} }
String sk = null; String sk = null;
if (startLauncher) { if (startLauncher) {
RTLLauncher launcher = new RTLLauncher(); RTLLauncher launcher = new RTLLauncher();
sk = launcher.getKey(); sk = launcher.getKey();
Thread t = new Thread(launcher); Thread t = new Thread(launcher);
t.start(); t.start();
} }
...@@ -317,7 +317,7 @@ public class Main implements ActionListener { ...@@ -317,7 +317,7 @@ public class Main implements ActionListener {
if (splashFrame != null) { if (splashFrame != null) {
splashFrame.setMessage("Building graphical components"); splashFrame.setMessage("Building graphical components");
} }
mainGUI.setKey(sk); mainGUI.setKey(sk);
mainGUI.build(); mainGUI.build();
// loading configuration // loading configuration
......
...@@ -51,6 +51,7 @@ import translator.RTLOTOSKeyword; ...@@ -51,6 +51,7 @@ import translator.RTLOTOSKeyword;
import translator.tojava.JKeyword; import translator.tojava.JKeyword;
public abstract class AvatarTerm extends AvatarElement { public abstract class AvatarTerm extends AvatarElement {
public abstract boolean isLeftHand (); public abstract boolean isLeftHand ();
public AvatarTerm (String _name, Object _referenceObject) { public AvatarTerm (String _name, Object _referenceObject) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7892,6 +7892,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe ...@@ -7892,6 +7892,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Pe
actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_IMPACT_CONNECTOR); actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_IMPACT_CONNECTOR);
} else if (command.equals(actions[TGUIAction.AMAD_MEET_CONNECTOR].getActionCommand())) { } else if (command.equals(actions[TGUIAction.AMAD_MEET_CONNECTOR].getActionCommand())) {
actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_MEET_CONNECTOR); actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_MEET_CONNECTOR);
} else if (command.equals(actions[TGUIAction.AMAD_BELONGSTOCOMPOSITION_CONNECTOR].getActionCommand())) {
actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR);
// AVATAR RD // AVATAR RD
} else if (command.equals(actions[TGUIAction.ARD_EDIT].getActionCommand())) { } else if (command.equals(actions[TGUIAction.ARD_EDIT].getActionCommand())) {
......
...@@ -372,6 +372,7 @@ public class TGComponentManager { ...@@ -372,6 +372,7 @@ public class TGComponentManager {
public static final int AVATARMAD_VERSIONING_CONNECTOR = 5254; public static final int AVATARMAD_VERSIONING_CONNECTOR = 5254;
public static final int AVATARMAD_IMPACT_CONNECTOR = 5255; public static final int AVATARMAD_IMPACT_CONNECTOR = 5255;
public static final int AVATARMAD_MEET_CONNECTOR = 5256; public static final int AVATARMAD_MEET_CONNECTOR = 5256;
public static final int AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR = 5257;
// AVATAR PD -> starts at 5300 // AVATAR PD -> starts at 5300
public static final int APD_BLOCK = 5300; public static final int APD_BLOCK = 5300;
...@@ -1031,7 +1032,7 @@ public class TGComponentManager { ...@@ -1031,7 +1032,7 @@ public class TGComponentManager {
case TMLCP_JUNCTION: case TMLCP_JUNCTION:
tgc = new TMLCPJunction(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); tgc = new TMLCPJunction(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
break; break;
case TMLCP_FOR_LOOP: case TMLCP_FOR_LOOP:
tgc = new TMLCPForLoop(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); tgc = new TMLCPForLoop(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
break; break;
case TMLSD_ACTION_STATE: case TMLSD_ACTION_STATE:
...@@ -1256,6 +1257,8 @@ public class TGComponentManager { ...@@ -1256,6 +1257,8 @@ public class TGComponentManager {
return AVATARMAD_IMPACT_CONNECTOR; return AVATARMAD_IMPACT_CONNECTOR;
} else if (tgc instanceof AvatarMADMeetConnector) { } else if (tgc instanceof AvatarMADMeetConnector) {
return AVATARMAD_MEET_CONNECTOR; return AVATARMAD_MEET_CONNECTOR;
} else if (tgc instanceof AvatarMADBelongsToCompositionConnector) {
return AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR;
// AVATAR RD // AVATAR RD
} else if (tgc instanceof AvatarRDRequirement) { } else if (tgc instanceof AvatarRDRequirement) {
...@@ -1788,6 +1791,9 @@ public class TGComponentManager { ...@@ -1788,6 +1791,9 @@ public class TGComponentManager {
case AVATARMAD_MEET_CONNECTOR: case AVATARMAD_MEET_CONNECTOR:
tgc = new AvatarMADMeetConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint); tgc = new AvatarMADMeetConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint);
break; break;
case AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR:
tgc = new AvatarMADBelongsToCompositionConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint);
break;
// AVATAR RD // AVATAR RD
case AVATARRD_DERIVE_CONNECTOR: case AVATARRD_DERIVE_CONNECTOR:
......
...@@ -362,6 +362,7 @@ public class TGUIAction extends AbstractAction { ...@@ -362,6 +362,7 @@ public class TGUIAction extends AbstractAction {
public static final int AMAD_DIAGRAM_REFERENCE = 372; public static final int AMAD_DIAGRAM_REFERENCE = 372;
public static final int AMAD_ELEMENT_REFERENCE = 373; public static final int AMAD_ELEMENT_REFERENCE = 373;
public static final int AMAD_COMPOSITION_CONNECTOR = 374; public static final int AMAD_COMPOSITION_CONNECTOR = 374;
public static final int AMAD_BELONGSTOCOMPOSITION_CONNECTOR = 417;
public static final int AMAD_IMPACT_CONNECTOR = 375; public static final int AMAD_IMPACT_CONNECTOR = 375;
public static final int AMAD_MEET_CONNECTOR = 377; public static final int AMAD_MEET_CONNECTOR = 377;
public static final int AMAD_VERSIONING_CONNECTOR = 376; public static final int AMAD_VERSIONING_CONNECTOR = 376;
...@@ -556,7 +557,7 @@ public class TGUIAction extends AbstractAction { ...@@ -556,7 +557,7 @@ public class TGUIAction extends AbstractAction {
public static final int ACT_INTERNAL_SEARCH = 415; public static final int ACT_INTERNAL_SEARCH = 415;
//-- //--
public static final int NB_ACTION = 417; public static final int NB_ACTION = 418;
private static final TAction [] actions = new TAction[NB_ACTION]; private static final TAction [] actions = new TAction[NB_ACTION];
...@@ -1036,11 +1037,11 @@ public class TGUIAction extends AbstractAction { ...@@ -1036,11 +1037,11 @@ public class TGUIAction extends AbstractAction {
actions[AMAD_ASSUMPTION] = new TAction("add-amad-assumption", "Add an assumption", IconManager.imgic5060, IconManager.imgic5060, "Assumption", "Add an assumption to the currently opened avatar Modeling Assumptions Diagram", 0); actions[AMAD_ASSUMPTION] = new TAction("add-amad-assumption", "Add an assumption", IconManager.imgic5060, IconManager.imgic5060, "Assumption", "Add an assumption to the currently opened avatar Modeling Assumptions Diagram", 0);
actions[AMAD_DIAGRAM_REFERENCE] = new TAction("add-amad-diagram-reference", "Add a diagram reference", IconManager.imgic5058, IconManager.imgic5058, "Diagram reference", "Add a diagram reference to the currently opened avatar Modeling Assumptions Diagram", 0); actions[AMAD_DIAGRAM_REFERENCE] = new TAction("add-amad-diagram-reference", "Add a diagram reference", IconManager.imgic5058, IconManager.imgic5058, "Diagram reference", "Add a diagram reference to the currently opened avatar Modeling Assumptions Diagram", 0);
actions[AMAD_ELEMENT_REFERENCE] = new TAction("add-amad-element-reference", "Add a reference to an modeling element", IconManager.imgic5062, IconManager.imgic5062, "Element reference", "Add a reference to an model element in the currently opened avatar Modeling Assumptions Diagram", 0); actions[AMAD_ELEMENT_REFERENCE] = new TAction("add-amad-element-reference", "Add a reference to an modeling element", IconManager.imgic5062, IconManager.imgic5062, "Element reference", "Add a reference to an model element in the currently opened avatar Modeling Assumptions Diagram", 0);
actions[AMAD_COMPOSITION_CONNECTOR] = new TAction("add-amad-composition", "Add a composition link", IconManager.imgic1012, IconManager.imgic1012, "Composition", "Add a composition link between two assumptions of the currently opened avatar Modeling Assumptions diagram", 0); actions[AMAD_COMPOSITION_CONNECTOR] = new TAction("add-amad-composition", "Add a composite link", IconManager.imgic1012, IconManager.imgic1012, "Composite", "Add a composite link between two assumptions of the currently opened avatar Modeling Assumptions diagram", 0);
actions[AMAD_VERSIONING_CONNECTOR] = new TAction("add-amad-versioning", "Add a versioning link", IconManager.imgic5064, IconManager.imgic5064, "Versioning", "Add a versioning link between two assumptions of the currently opened avatar Modeling Assumptions diagram", 0); actions[AMAD_VERSIONING_CONNECTOR] = new TAction("add-amad-versioning", "Add a versioning link", IconManager.imgic5064, IconManager.imgic5064, "Versioning", "Add a versioning link between two assumptions of the currently opened avatar Modeling Assumptions diagram", 0);
actions[AMAD_IMPACT_CONNECTOR] = new TAction("add-amad-impact", "Add an impact link", IconManager.imgic5066, IconManager.imgic5066, "Impact", "Add an impact link between two references to model elements, in the currently opened avatar Modeling Assumptions diagram", 0); actions[AMAD_IMPACT_CONNECTOR] = new TAction("add-amad-impact", "Add an impact link", IconManager.imgic5066, IconManager.imgic5066, "Impact", "Add an impact link between two references to model elements, in the currently opened avatar Modeling Assumptions diagram", 0);
actions[AMAD_MEET_CONNECTOR] = new TAction("add-amad-meet", "Add an meet link", IconManager.imgic5066, IconManager.imgic5066, "Meet", "Add an meet link between a model element and an assumption in the currently opened avatar Modeling Assumptions diagram", 0); actions[AMAD_MEET_CONNECTOR] = new TAction("add-amad-meet", "Add an meet link", IconManager.imgic5066, IconManager.imgic5066, "Meet", "Add an meet link between a model element and an assumption in the currently opened Avatar Modeling Assumptions diagram", 0);
actions[AMAD_BELONGSTOCOMPOSITION_CONNECTOR] = new TAction("amad-belongstocomposition-connector", "Add a composition connector between references", IconManager.imgic5002, IconManager.imgic5002, "Composition connector", "Add a composition between blocks of the currently opened Avatar Modeling Assumptions diagram", 0);
// AVATAR Requirement Diagrams // AVATAR Requirement Diagrams
actions[ARD_EDIT] = new TAction("edit-ard-diagram", "Edit AVATAR Requirement Diagram", IconManager.imgic100, IconManager.imgic101, "Edit AVATAR Requirement Diagram", "Make it possible to edit the currently opened AVATAR Requirement Diagram", 0); actions[ARD_EDIT] = new TAction("edit-ard-diagram", "Edit AVATAR Requirement Diagram", IconManager.imgic100, IconManager.imgic101, "Edit AVATAR Requirement Diagram", "Make it possible to edit the currently opened AVATAR Requirement Diagram", 0);
......
This diff is collapsed.
/**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 AvatarMADBelongsToCompositionConnector
* Connector used in AVATAR Assumption Diagrams
* Creation: 16/10/2015
* @version 1.0 16/10/2015
* @author Ludovic APVRILLE
* @see
*/
package ui.avatarmad;
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
import java.util.*;
import org.w3c.dom.*;
import myutil.*;
import ui.*;
import ui.cd.*;
import ui.window.*;
public class AvatarMADBelongsToCompositionConnector extends TGConnectorWithCommentConnectionPoints implements ScalableTGComponent{
protected int d = 20;
protected int D = 26;
//protected int widthValue, heightValue, maxWidthValue, h;
protected Polygon p;
protected int xp1, xp2, yp1, yp2;
protected double oldScaleFactor;
protected boolean rescaled;
public AvatarMADBelongsToCompositionConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) {
super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint);
myImageIcon = IconManager.imgic202;
value = "{info}";
editable = true;
oldScaleFactor = tdp.getZoom();
rescaled = true;
}
protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2) {
if ((p == null) || (rescaled) || (xp1 != x1) || (xp2 != x2) || (yp1 != y1) || (yp2 != y2)){
p = new Polygon();
xp1 = x1;
xp2 = x2;
yp1 = y1;
yp2 = y2;
Double alpha;
int dd = (int)(d*tdp.getZoom());
int DD = (int)(D*tdp.getZoom());
if (x1 == x2) {
if (y1 > y2) {
p.addPoint(x2, y2+DD);
p.addPoint(x2+(dd/2), y2+(DD/2));
p.addPoint(x2, y2);
p.addPoint(x2-(dd/2), y2+(DD/2));
} else {
p.addPoint(x2, y2-DD);
p.addPoint(x2+(dd/2), y2-(DD/2));
p.addPoint(x2, y2);
p.addPoint(x2-(dd/2), y2-(DD/2));
}
} else {
double xd[] = new double[4];
double yd[] = new double[4];
/* Previous way of computing the diamond
double a = ((double)y1-y2)/(x1-x2);
alpha = Math.atan(a);
if (x2 < x1) {
x2 = (int)(x2 + (Math.cos(alpha)*D));
y2 = (int)(y2 + (Math.sin(alpha)*D));
} else {
x2 = (int)(x2 - (Math.cos(alpha)*D));
y2 = (int)(y2 - (Math.sin(alpha)*D));
}
int distance;
for(int i=0; i<4; i++){
if ((i%2) == 0) {
distance = D;
} else {
distance = d;
}
xd[i] = x2 + (Math.cos(alpha)*distance);
yd[i] = y2 + (Math.sin(alpha)*distance);
p.addPoint((int)xd[i], (int)yd[i]);
alpha = alpha + (Math.PI/2);
}*/
//P
xd[0] = x2;
yd[0] = y2;
int x0 = x1 - x2;
int y0 = y1 - y2;
double k = 1/(Math.sqrt((x0*x0)+(y0*y0)));
double u = x0*k;
double v = y0*k;
double Ex = DD*u;
double Ey = DD*v;
double Fx = dd*v;
double Fy = -dd*u;
//Q
xd[1] = x2+((Ex+Fx)/2);
yd[1] = y2+((Ey+Fy)/2);
//R
xd[2] = x2+Ex;
yd[2] = y2+Ey;
//S
xd[3] = xd[1] - Fx;
yd[3] = yd[1] - Fy;
for(int i=0; i<4; i++) {
p.addPoint((int)xd[i], (int)yd[i]);
}
}
}
g.fillPolygon(p);
g.drawLine(x1, y1, x2, y2);
rescaled = false;
}
public TGComponent extraIsOnOnlyMe(int x1, int y1) {
if (p != null) {
if (p.contains(x1, y1)) {
return this;
}
}
return null;
}
public void rescale(double scaleFactor){
//System.out.println("Rescale connector");
int xx, yy;
for(int i=0; i<nbInternalTGComponent; i++) {
xx = tgcomponent[i].getX();
yy = tgcomponent[i].getY();
//System.out.println("Internal comp xx= " + xx + " y==" + yy);
tgcomponent[i].dx = (tgcomponent[i].dx + xx) / oldScaleFactor * scaleFactor;
tgcomponent[i].dy = (tgcomponent[i].dy + yy) / oldScaleFactor * scaleFactor;
xx = (int)(tgcomponent[i].dx);
tgcomponent[i].dx = tgcomponent[i].dx - xx;
yy = (int)(tgcomponent[i].dy);
tgcomponent[i].dy = tgcomponent[i].dy - yy;
tgcomponent[i].setCd(xx, yy);
//System.out.println("Internal comp xx= " + xx + " y==" + yy);
}
oldScaleFactor = scaleFactor;
rescaled = true;
}
public int getType() {
return TGComponentManager.AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR;
}
}
...@@ -56,51 +56,44 @@ import ui.*; ...@@ -56,51 +56,44 @@ import ui.*;
public class AvatarMADImpactConnector extends TGConnectorWithCommentConnectionPoints { public class AvatarMADImpactConnector extends TGConnectorWithCommentConnectionPoints {
int w, h; int w, h;
public AvatarMADImpactConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { public AvatarMADImpactConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) {
super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint);
value = "<<impact>>"; value = "<<impact>>";
myImageIcon = IconManager.imgic1008; myImageIcon = IconManager.imgic1008;
} }
protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){
//g.drawLine(x1, y1, x2, y2); //g.drawLine(x1, y1, x2, y2);
GraphicLib.dashedArrowWithLine(g, 1, 1, 0, x1, y1, x2, y2, false); GraphicLib.dashedArrowWithLine(g, 1, 1, 0, x1, y1, x2, y2, false);
// Indicate semantics // Indicate semantics
Font f = g.getFont(); Font f = g.getFont();
Font old = f; Font old = f;
if (f.getSize() != tdp.getFontSize()) { if (f.getSize() != tdp.getFontSize()) {
f = f.deriveFont((float)tdp.getFontSize()); f = f.deriveFont((float)tdp.getFontSize());
g.setFont(f); g.setFont(f);
} }
w = g.getFontMetrics().stringWidth(value); w = g.getFontMetrics().stringWidth(value);
h = g.getFontMetrics().getHeight(); h = g.getFontMetrics().getHeight();
g.drawString(value, (x1 + x2 - w) / 2, (y1 + y2)/2); g.drawString(value, (x1 + x2 - w) / 2, (y1 + y2)/2);
g.setFont(old); g.setFont(old);
} }
public TGComponent extraIsOnOnlyMe(int x1, int y1) { public TGComponent extraIsOnOnlyMe(int x1, int y1) {
if (GraphicLib.isInRectangle(x1, y1, (p1.getX() + p2.getX() - w) / 2, (p1.getY() + p2.getY())/2 - h, w, h)) { if (GraphicLib.isInRectangle(x1, y1, (p1.getX() + p2.getX() - w) / 2, (p1.getY() + p2.getY())/2 - h, w, h)) {
return this; return this;
} }
return null; return null;
} }
public int getType() { public int getType() {
return TGComponentManager.AVATARMAD_IMPACT_CONNECTOR; return TGComponentManager.AVATARMAD_IMPACT_CONNECTOR;
} }
}
}
...@@ -56,51 +56,44 @@ import ui.*; ...@@ -56,51 +56,44 @@ import ui.*;
public class AvatarMADMeetConnector extends TGConnectorWithCommentConnectionPoints { public class AvatarMADMeetConnector extends TGConnectorWithCommentConnectionPoints {
int w, h; int w, h;
public AvatarMADMeetConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) { public AvatarMADMeetConnector(int _x, int _y, int _minX, int _minY, int _maxX, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp, TGConnectingPoint _p1, TGConnectingPoint _p2, Vector _listPoint) {
super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint); super(_x, _y, _minX, _minY, _maxX, _maxY, _pos, _father, _tdp, _p1, _p2, _listPoint);
value = "<<meet>>"; value = "<<meet>>";
myImageIcon = IconManager.imgic1008; myImageIcon = IconManager.imgic1008;
} }
protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){ protected void drawLastSegment(Graphics g, int x1, int y1, int x2, int y2){
//g.drawLine(x1, y1, x2, y2); //g.drawLine(x1, y1, x2, y2);
GraphicLib.dashedArrowWithLine(g, 1, 1, 0, x1, y1, x2, y2, false); GraphicLib.dashedArrowWithLine(g, 1, 1, 0, x1, y1, x2, y2, false);
// Indicate semantics // Indicate semantics
Font f = g.getFont(); Font f = g.getFont();
Font old = f; Font old = f;
if (f.getSize() != tdp.getFontSize()) { if (f.getSize() != tdp.getFontSize()) {
f = f.deriveFont((float)tdp.getFontSize()); f = f.deriveFont((float)tdp.getFontSize());
g.setFont(f); g.setFont(f);
} }
w = g.getFontMetrics().stringWidth(value); w = g.getFontMetrics().stringWidth(value);
h = g.getFontMetrics().getHeight(); h = g.getFontMetrics().getHeight();
g.drawString(value, (x1 + x2 - w) / 2, (y1 + y2)/2); g.drawString(value, (x1 + x2 - w) / 2, (y1 + y2)/2);
g.setFont(old); g.setFont(old);
} }
public TGComponent extraIsOnOnlyMe(int x1, int y1) { public TGComponent extraIsOnOnlyMe(int x1, int y1) {
if (GraphicLib.isInRectangle(x1, y1, (p1.getX() + p2.getX() - w) / 2, (p1.getY() + p2.getY())/2 - h, w, h)) { if (GraphicLib.isInRectangle(x1, y1, (p1.getX() + p2.getX() - w) / 2, (p1.getY() + p2.getY())/2 - h, w, h)) {
return this; return this;
} }
return null; return null;
} }
public int getType() { public int getType() {
return TGComponentManager.AVATARMAD_MEET_CONNECTOR; return TGComponentManager.AVATARMAD_MEET_CONNECTOR;