Commit b23d7030 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update on code for avatar translation

parent e4fac6b0
......@@ -161,14 +161,14 @@ stdrelease:
mkdir -p $(TTOOL_TARGET)/lib
cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_LIB) $(TTOOL_TARGET)/lib
cp $(TTOOL_DOC)/README_lib $(TTOOL_TARGET)/lib
# simulators
mkdir -p $(TTOOL_TARGET)/simulators/systemc1/src_simulator
mkdir -p $(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.defs $(TTOOL_TARGET)/simulators/systemc1
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
# DIPLODOCUS simulators
#mkdir -p $(TTOOL_TARGET)/simulators/systemc1/src_simulator
#mkdir -p $(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.defs $(TTOOL_TARGET)/simulators/systemc1
#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
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/arch
......@@ -256,9 +256,86 @@ preinstall: jar preinstall_linux
preinstall_linux:
#jars
cp $(TTOOL_BIN)/*.jar $(TTOOL_PREINSTALL_LINUX)/TTool/bin/
#models
cd $(TTOOL_MODELING); cp $(RELEASE_STD_FILES_XML) $(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:
cd $(JTTOOL);$(JAVAC) $(JTTOOL_DIR)/*.java;$(JAR) cmf $(TTOOL_SRC)/$(TTOOL_JAR_TXT) $(TTOOL_BIN)/$(JTTOOL_JAR) $(JTTOOL_DIR)/*.class
......
......@@ -65,7 +65,9 @@
<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>
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
\ No newline at end of file
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
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -301,10 +301,10 @@ public class Main implements ActionListener {
}
}
String sk = null;
String sk = null;
if (startLauncher) {
RTLLauncher launcher = new RTLLauncher();
sk = launcher.getKey();
RTLLauncher launcher = new RTLLauncher();
sk = launcher.getKey();
Thread t = new Thread(launcher);
t.start();
}
......@@ -317,7 +317,7 @@ public class Main implements ActionListener {
if (splashFrame != null) {
splashFrame.setMessage("Building graphical components");
}
mainGUI.setKey(sk);
mainGUI.setKey(sk);
mainGUI.build();
// loading configuration
......
......@@ -51,6 +51,7 @@ import translator.RTLOTOSKeyword;
import translator.tojava.JKeyword;
public abstract class AvatarTerm extends AvatarElement {
public abstract boolean isLeftHand ();
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
actionOnButton(TGComponentManager.CONNECTOR, TGComponentManager.AVATARMAD_IMPACT_CONNECTOR);
} else if (command.equals(actions[TGUIAction.AMAD_MEET_CONNECTOR].getActionCommand())) {
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
} else if (command.equals(actions[TGUIAction.ARD_EDIT].getActionCommand())) {
......
......@@ -372,6 +372,7 @@ public class TGComponentManager {
public static final int AVATARMAD_VERSIONING_CONNECTOR = 5254;
public static final int AVATARMAD_IMPACT_CONNECTOR = 5255;
public static final int AVATARMAD_MEET_CONNECTOR = 5256;
public static final int AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR = 5257;
// AVATAR PD -> starts at 5300
public static final int APD_BLOCK = 5300;
......@@ -1031,7 +1032,7 @@ public class TGComponentManager {
case TMLCP_JUNCTION:
tgc = new TMLCPJunction(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp);
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);
break;
case TMLSD_ACTION_STATE:
......@@ -1256,6 +1257,8 @@ public class TGComponentManager {
return AVATARMAD_IMPACT_CONNECTOR;
} else if (tgc instanceof AvatarMADMeetConnector) {
return AVATARMAD_MEET_CONNECTOR;
} else if (tgc instanceof AvatarMADBelongsToCompositionConnector) {
return AVATARMAD_BELONGSTOCOMPOSITION_CONNECTOR;
// AVATAR RD
} else if (tgc instanceof AvatarRDRequirement) {
......@@ -1788,6 +1791,9 @@ public class TGComponentManager {
case AVATARMAD_MEET_CONNECTOR:
tgc = new AvatarMADMeetConnector(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp, p1, p2, listPoint);
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
case AVATARRD_DERIVE_CONNECTOR:
......
......@@ -362,6 +362,7 @@ public class TGUIAction extends AbstractAction {
public static final int AMAD_DIAGRAM_REFERENCE = 372;
public static final int AMAD_ELEMENT_REFERENCE = 373;
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_MEET_CONNECTOR = 377;
public static final int AMAD_VERSIONING_CONNECTOR = 376;
......@@ -556,7 +557,7 @@ public class TGUIAction extends AbstractAction {
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];
......@@ -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_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_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_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
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);
......
/**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 AvatarMADAssumption
* Avatar assumption: to be used in Modeling Assumptions diagram of AVATAR
* Creation: 27/08/2013
* @version 1.0 27/08/2013
* @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 AvatarMADAssumption
* Avatar assumption: to be used in Modeling Assumptions diagram of AVATAR
* Creation: 27/08/2013
* @version 1.0 27/08/2013
* @author Ludovic APVRILLE
* @see
*/
package ui.avatarmad;
......@@ -61,60 +61,60 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem
public String oldValue;
protected int textX = 5;
protected int textY = 22;
protected int lineHeight = 30;
private double dlineHeight = 0.0;
protected int lineHeight = 30;
private double dlineHeight = 0.0;
//protected int reqType = 0;
// 0: normal, 1: formal, 2: security
// 0: normal, 1: formal, 2: security
//protected int startFontSize = 10;
protected Graphics graphics;
//protected int iconSize = 30;
private Font myFont, myFontB;
private int maxFontSize = 30;
private int minFontSize = 4;
private int currentFontSize = -1;
private boolean displayText = true;
private Font myFont, myFontB;
private int maxFontSize = 30;
private int minFontSize = 4;
private int currentFontSize = -1;
private boolean displayText = true;
public final static String[] ASSUMPTION_TYPE_STR = {"<<System Assumption>>", "<<Environment Assumption>>"};
public final static String[] DURABILITY_TYPE = {"Undefined", "Permanent", "Temporary"};
public final static String[] SOURCE_TYPE = {"Undefined", "End-user", "Stakeholder", "Model creator"};
public final static String[] STATUS_TYPE = {"Undefined", "Applied", "Alleviated"};
public final static String[] LIMITATION_TYPE = {"Undefined", "Language", "Tool", "Modeling activity", "Verification"};
protected String text;
public final static String[] SOURCE_TYPE = {"Undefined", "End-user", "Stakeholder", "Model creator"};
public final static String[] STATUS_TYPE = {"Undefined", "Applied", "Alleviated"};
public final static String[] LIMITATION_TYPE = {"Undefined", "Language", "Tool", "Modeling activity", "Verification"};
protected String text;
protected String []texts;
protected int type = 0;
protected int durability = 0;
protected int source = 0;
protected int status = 0;
protected int limitation = 0;
// Icon
private int iconSize = 18;
private boolean iconIsDrawn = false;
// Icon
private int iconSize = 18;
private boolean iconIsDrawn = false;
public AvatarMADAssumption(int _x, int _y, int _minX, int _maxX, int _minY, int _maxY, boolean _pos, TGComponent _father, TDiagramPanel _tdp) {
super(_x, _y, _minX, _maxX, _minY, _maxY, _pos, _father, _tdp);
initScaling(200, 120);
oldScaleFactor = tdp.getZoom();
dlineHeight = lineHeight * oldScaleFactor;
lineHeight = (int)dlineHeight;
dlineHeight = dlineHeight - lineHeight;
minWidth = 1;
initScaling(200, 120);
oldScaleFactor = tdp.getZoom();
dlineHeight = lineHeight * oldScaleFactor;
lineHeight = (int)dlineHeight;
dlineHeight = dlineHeight - lineHeight;
minWidth = 1;
minHeight = lineHeight;
nbConnectingPoint = 28;
connectingPoint = new TGConnectingPoint[nbConnectingPoint];
connectingPoint[0] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.0, 0.25, TGConnectingPoint.WEST);
......@@ -127,311 +127,311 @@ public class AvatarMADAssumption extends TGCScalableWithInternalComponent implem
connectingPoint[7] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 0.0, TGConnectingPoint.NORTH);
connectingPoint[8] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.75, 0.0, TGConnectingPoint.NORTH);
connectingPoint[9] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.25, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[10] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[11] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.75, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[12] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.0, 0.25, TGConnectingPoint.WEST);
connectingPoint[13] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[14] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.0, 0.75, TGConnectingPoint.WEST);
connectingPoint[15] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 1.0, 0.25, TGConnectingPoint.EAST);
connectingPoint[16] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 1.0, 0.5, TGConnectingPoint.EAST);
connectingPoint[17] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 1.0, 0.75, TGConnectingPoint.EAST);
connectingPoint[18] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.25, 0.0, TGConnectingPoint.NORTH);
connectingPoint[19] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.5, 0.0, TGConnectingPoint.NORTH);
connectingPoint[20] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.75, 0.0, TGConnectingPoint.NORTH);
connectingPoint[21] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.25, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[22] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[23] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, true, false, 0.75, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[24] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[25] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[26] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[27] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
addTGConnectingPointsCommentTop();
connectingPoint[10] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[11] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.75, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[12] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.0, 0.25, TGConnectingPoint.WEST);
connectingPoint[13] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.0, 0.5, TGConnectingPoint.WEST);
connectingPoint[14] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.0, 0.75, TGConnectingPoint.WEST);
connectingPoint[15] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 1.0, 0.25, TGConnectingPoint.EAST);
connectingPoint[16] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 1.0, 0.5, TGConnectingPoint.EAST);
connectingPoint[17] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 1.0, 0.75, TGConnectingPoint.EAST);
connectingPoint[18] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.25, 0.0, TGConnectingPoint.NORTH);
connectingPoint[19] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.5, 0.0, TGConnectingPoint.NORTH);
connectingPoint[20] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.75, 0.0, TGConnectingPoint.NORTH);
connectingPoint[21] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.25, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[22] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[23] = new AvatarMADToAssumptionsConnectingPoint(this, 0, 0, false, true, 0.75, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[24] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[25] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[26] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
connectingPoint[27] = new AvatarMADAssumptionConnectingPoint(this, 0, 0, true, true, 0.5, 1.0, TGConnectingPoint.SOUTH);
addTGConnectingPointsCommentTop();
nbInternalTGComponent = 0;
//tgcomponent = new TGComponent[nbInternalTGComponent];
int h = 1;
//TAttributeRequirement tgc0;
//tgc0 = new TAttributeRequirement(x, y+height+h, 0, 0, height + h, height+h, true, this, _tdp);
//tgcomponent[0] = tgc0;
moveable = true;
editable = true;
removable = true;
userResizable = true;
multieditable = true;
multieditable = true;
// Name of the requirement
name = "Assumption";
try {
value = tdp.findAvatarAssumptionName("Assumption_", 0);
} catch (Exception e) {
value = tdp.findAvatarAssumptionName("Assumption_", 0);
}
try {
value = tdp.findAvatarAssumptionName("Assumption_", 0);
} catch (Exception e) {
value = tdp.findAvatarAssumptionName("Assumption_", 0);
}
oldValue = value;
myImageIcon = IconManager.imgic5060;
text = "Assumption description:\nDouble-click to edit";
text = "Assumption description:\nDouble-click to edit";
actionOnAdd();
}
public void makeValue() {
public void makeValue() {
texts = Conversion.wrapText(text);
}
public void internalDrawing(Graphics g) {
Font f = g.getFont();
Font fold = f;
int w, c;
int size;
if (texts == null) {
makeValue();
}
Font f = g.getFont();
Font fold = f;
int w, c;
int size;
if (texts == null) {
makeValue();
}
if (!tdp.isScaled()) {
graphics = g;
}
if (((rescaled) && (!tdp.isScaled())) || myFont == null) {
currentFontSize = tdp.getFontSize();
//System.out.println("Rescaled, font size = " + currentFontSize + " height=" + height);
myFont = f.deriveFont((float)currentFontSize);
myFontB = myFont.deriveFont(Font.BOLD);
if (rescaled) {
rescaled = false;
}
}
if(currentFontSize <minFontSize) {
displayText = false;
} else {
displayText = true;
}
int h = g.getFontMetrics().getHeight();
g.drawRect(x, y, width, height);
g.drawLine(x, y+lineHeight, x+width, y+lineHeight);
g.setColor(ColorManager.AVATAR_ASSUMPTION_TOP);
if (((rescaled) && (!tdp.isScaled())) || myFont == null) {
currentFontSize = tdp.getFontSize();
//System.out.println("Rescaled, font size = " + currentFontSize + " height=" + height);
myFont = f.deriveFont((float)currentFontSize);
myFontB = myFont.deriveFont(Font.BOLD);
if (rescaled) {
rescaled = false;
}
}
if(currentFontSize <minFontSize) {
displayText = false;
} else {
displayText = true;
}
int h = g.getFontMetrics().getHeight();
g.drawRect(x, y, width, height);
g.drawLine(x, y+lineHeight, x+width, y+lineHeight);
g.setColor(ColorManager.AVATAR_ASSUMPTION_TOP);
g.fillRect(x+1, y+1, width-1, lineHeight-1);
g.setColor(ColorManager.AVATAR_ASSUMPTION_ATTRIBUTES);
g.fillRect(x+1, y+1+lineHeight, width-1, height-1-lineHeight);
ColorManager.setColor(g, getState(), 0);
if ((lineHeight > 23) && (width > 23)){
g.drawImage(IconManager.img5100, x + width - iconSize + 1, y + 3, Color.yellow, null);
}
if (displayText) {
size = currentFontSize - 2;
g.setFont(myFont.deriveFont((float)(myFont.getSize() - 2)));
drawLimitedString(g, ASSUMPTION_TYPE_STR[type], x, y + size, width, 1);
size += currentFontSize;
g.setFont(myFontB);
w = g.getFontMetrics().stringWidth(value);
drawLimitedString(g, value, x, y + size, width, 1);
}
/*if (verified) {
if (satisfied) {
Color tmp = g.getColor();
GraphicLib.setMediumStroke(g);
g.setColor(Color.green);
g.drawLine(x+width-2, y-6+lineHeight, x+width-6, y-2+lineHeight);
g.drawLine(x+width-6, y-3+lineHeight, x+width-8, y-6+lineHeight);
g.setColor(tmp);
GraphicLib.setNormalStroke(g);
} else {
//g.drawString("acc", x + width - 10, y+height-10);
Color tmp = g.getColor();
GraphicLib.setMediumStroke(g);
g.setColor(Color.red);
g.drawLine(x+width-2, y-2+lineHeight, x+width-8, y-8+lineHeight);
g.drawLine(x+width-8, y-2+lineHeight, x+width-2, y-8+lineHeight);
g.setColor(tmp);
GraphicLib.setNormalStroke(g);
}
}*/
g.setFont(myFont);
String texti = "Text";
String s ;
int i;
size = lineHeight + currentFontSize;
//ID
/*if (size < (height - 2)) {
drawLimitedString(g, "ID=" + id, x + textX, y + size, width, 0);
}
size += currentFontSize;*/
//text
g.setColor(ColorManager.AVATAR_ASSUMPTION_ATTRIBUTES);
g.fillRect(x+1, y+1+lineHeight, width-1, height-1-lineHeight);
ColorManager.setColor(g, getState(), 0);
if ((lineHeight > 23) && (width > 23)){
g.drawImage(IconManager.img5100, x + width - iconSize + 1, y + 3, Color.yellow, null);
}
if (displayText) {
size = currentFontSize - 2;
g.setFont(myFont.deriveFont((float)(myFont.getSize() - 2)));
drawLimitedString(g, ASSUMPTION_TYPE_STR[type], x, y + size, width, 1);
size += currentFontSize;
g.setFont(myFontB);
w = g.getFontMetrics().stringWidth(value);
drawLimitedString(g, value, x, y + size, width, 1);
}
/*if (verified) {
if (satisfied) {
Color tmp = g.getColor();
GraphicLib.setMediumStroke(g);