diff --git a/src/ui/IconManager.java b/src/ui/IconManager.java index 6b43e2454a86676f62b9c160638ee3a5bc2b7c62..84e6dbbf6d1e340d6543a445bb36241320a8c1e6 100755 --- a/src/ui/IconManager.java +++ b/src/ui/IconManager.java @@ -105,7 +105,8 @@ public class IconManager { public static ImageIcon imgic700, imgic702; public static ImageIcon imgic800, imgic802, imgic804, imgic806, imgic808, imgic810, imgic812; - public static ImageIcon imgic900, imgic902, imgic904, imgic906, imgic908, imgic910, imgic912, imgic914, imgic916, imgic918, imgic920, imgic922, imgic924, imgic926; + public static ImageIcon imgic900, imgic902, imgic904, imgic906, imgic908, imgic910, imgic912, imgic914, imgic916, imgic918; + public static ImageIcon imgic920, imgic922, imgic924, imgic926, imgic928; // Requirement diagrams public static ImageIcon imgic1000, imgic1002, imgic1004,imgic1006,imgic1008, imgic1010, imgic1012, imgic1014; public static ImageIcon imgic1050, imgic1052, imgic1054,imgic1056, imgic1058, imgic1060; @@ -400,6 +401,7 @@ public class IconManager { private static String icon922 = "images/tmladexeccint.gif"; private static String icon924 = "images/tmladrandom.gif"; private static String icon926 = "images/tmladforeverloop.gif"; + private static String icon928 = "images/tmladunorderedsequence.gif"; // Requirement diagrams private static String icon1000 = "images/reqdiag.gif"; @@ -739,6 +741,7 @@ public class IconManager { imgic922 = getIcon(icon922); imgic924 = getIcon(icon924); imgic926 = getIcon(icon926); + imgic928 = getIcon(icon928); imgic1000 = getIcon(icon1000); imgic1002 = getIcon(icon1002); diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java index 656293f19257903d379e9c7d0420a9b5ba767358..7bca1ef97e28dc73c6bfbefb33f9771a4674a6b2 100755 --- a/src/ui/MainGUI.java +++ b/src/ui/MainGUI.java @@ -6164,6 +6164,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TMLAD_FOR_EVER_LOOP); } else if (command.equals(actions[TGUIAction.TMLAD_SEQUENCE].getActionCommand())) { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TMLAD_SEQUENCE); + } else if (command.equals(actions[TGUIAction.TMLAD_UNORDERED_SEQUENCE].getActionCommand())) { + actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TMLAD_UNORDERED_SEQUENCE); } else if (command.equals(actions[TGUIAction.TMLAD_SELECT_EVT].getActionCommand())) { actionOnButton(TGComponentManager.COMPONENT, TGComponentManager.TMLAD_SELECT_EVT); } else if (command.equals(actions[TGUIAction.TMLAD_RANDOM].getActionCommand())) { diff --git a/src/ui/TGComponentManager.java b/src/ui/TGComponentManager.java index e7df606650d461390aabc4c9d79d2186b4f2fe02..cf37f5c9851d15408907fab635b6b458497a7baf 100755 --- a/src/ui/TGComponentManager.java +++ b/src/ui/TGComponentManager.java @@ -201,6 +201,7 @@ public class TGComponentManager { public static final int TMLAD_FOR_LOOP = 1014; public static final int TMLAD_EXECI_INTERVAL = 1015; public static final int TMLAD_SEQUENCE = 1016; + public static final int TMLAD_UNORDERED_SEQUENCE = 1032; public static final int TMLAD_SELECT_EVT = 1018; public static final int TMLAD_FOR_STATIC_LOOP = 1020; public static final int TMLAD_EXECC = 1021; @@ -654,6 +655,9 @@ public class TGComponentManager { break; case TMLAD_SEQUENCE: tgc = new TMLADSequence(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); + break; + case TMLAD_UNORDERED_SEQUENCE: + tgc = new TMLADUnorderedSequence(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); break; case TMLAD_SELECT_EVT: tgc = new TMLADSelectEvt(x, y, tdp.getMinX(), tdp.getMaxX(), tdp.getMinY(), tdp.getMaxY(), false, null, tdp); @@ -1072,6 +1076,8 @@ public class TGComponentManager { return TMLAD_FOR_EVER_LOOP; } else if (tgc instanceof TMLADSequence) { return TMLAD_SEQUENCE; + } else if (tgc instanceof TMLADUnorderedSequence) { + return TMLAD_UNORDERED_SEQUENCE; } else if (tgc instanceof TMLADSelectEvt) { return TMLAD_SELECT_EVT; } else if (tgc instanceof TMLADRandom) { diff --git a/src/ui/TGUIAction.java b/src/ui/TGUIAction.java index 8af8e2ce63a494683999eebbefcde4b1c12346d2..65d71f2db80d1a1ee10fc21ead27a36b381200a7 100755 --- a/src/ui/TGUIAction.java +++ b/src/ui/TGUIAction.java @@ -194,6 +194,7 @@ public class TGUIAction extends AbstractAction { public static final int TMLAD_FOR_STATIC_LOOP = 226; public static final int TMLAD_FOR_EVER_LOOP = 255; public static final int TMLAD_SEQUENCE = 156; + public static final int TMLAD_UNORDERED_SEQUENCE = 322; public static final int TMLAD_SELECT_EVT = 206; public static final int TMLAD_RANDOM = 245; @@ -441,7 +442,7 @@ public class TGUIAction extends AbstractAction { //Action for the help button created by Solange public static final int PRUEBA_1 = 205; - public static final int NB_ACTION = 322; + public static final int NB_ACTION = 323; private static final TAction [] actions = new TAction[NB_ACTION]; @@ -726,6 +727,7 @@ public class TGUIAction extends AbstractAction { actions[TMLAD_FOR_STATIC_LOOP] = new TAction("add-tmlad-for-static-loop", "Static loop (for)", IconManager.imgic912, IconManager.imgic912, "Static loop (for)", "Add a static for loop to the currently opened TML activity diagram", 0); actions[TMLAD_FOR_EVER_LOOP] = new TAction("add-tmlad-for-ever-loop", "Loop for ever", IconManager.imgic926, IconManager.imgic926, "Loop for ever", "Add a loop-for-ever operator to the currently opened TML activity diagram", 0); actions[TMLAD_SEQUENCE] = new TAction("add-tmlad-sequence", "Sequence", IconManager.imgic226, IconManager.imgic226, "Sequence", "Add a sequence to the currently opened TML activity diagram", 0); + actions[TMLAD_UNORDERED_SEQUENCE] = new TAction("add-tmlad-unordered-sequence", "Unordered sequence", IconManager.imgic928, IconManager.imgic928, "Unordered sequence", "Add an unordered sequence to the currently opened TML activity diagram", 0); actions[TMLAD_SELECT_EVT] = new TAction("add-tmlad-select-evt", "Add select event", IconManager.imgic916, IconManager.imgic916, "Select event", "Add a selection between events to the currently opened TML Task activity diagram", 0); actions[TMLAD_RANDOM] = new TAction("add-tmlad-random", "Add random", IconManager.imgic924, IconManager.imgic924, "Select random", "Add a random operator to the currently opened TML Task activity diagram", 0); diff --git a/src/ui/tmlad/TMLADUnorderedSequence.java b/src/ui/tmlad/TMLADUnorderedSequence.java new file mode 100755 index 0000000000000000000000000000000000000000..7a1054c1c2851b8b0c5af2fb6f828ca95985caae --- /dev/null +++ b/src/ui/tmlad/TMLADUnorderedSequence.java @@ -0,0 +1,117 @@ +/** + 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 TMLADUnorderedSequence + * Sequence. To be used in activity diagrams of TMLDesigns + * Creation: 07/07/2010 + * @version 1.0 07/07/2010 + * @author Ludovic APVRILLE + * @see + */ + +package ui.tmlad; + +import java.awt.*; + +import myutil.*; +import ui.*; + +public class TMLADUnorderedSequence extends TGCWithInternalComponent implements EmbeddedComment, AllowedBreakpoint { + private int lineLength = 0; + private int textX, textY; + + public TMLADUnorderedSequence(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); + + + width = 150; + height = 5; + + textX = width - 6; + textY = height + 2; + + nbConnectingPoint = 6; + connectingPoint = new TGConnectingPoint[6]; + connectingPoint[0] = new TGConnectingPointTMLAD(this, 0, -lineLength, true, false, 0.5, 0.0); + connectingPoint[1] = new TGConnectingPointTMLAD(this, 0, lineLength, false, true, 0.167, 1.0); + connectingPoint[2] = new TGConnectingPointTMLAD(this, 0, lineLength, false, true, 0.333, 1.0); + connectingPoint[3] = new TGConnectingPointTMLAD(this, 0, lineLength, false, true, 0.5, 1.0); + connectingPoint[4] = new TGConnectingPointTMLAD(this, 0, lineLength, false, true, 0.667, 1.0); + connectingPoint[5] = new TGConnectingPointTMLAD(this, 0, lineLength, false, true, 0.833, 1.0); + + nbInternalTGComponent = 1; + tgcomponent = new TGComponent[nbInternalTGComponent]; + + TGCOneLineText tgc = new TGCOneLineText(x+textX + 10, y+textY, textX +10 , textX + 10 , textY, textY, true, this, _tdp); + tgc.setValue("<>"); + tgc.setName("Unordered sequence"); + tgc.setEditable(false); + + tgcomponent[0] = tgc; + + moveable = true; + editable = false; + removable = true; + + name = "unordered sequence"; + + myImageIcon = IconManager.imgic206; + } + + public void internalDrawing(Graphics g) { + g.drawRect(x, y, width, height); + g.fillRect(x, y, width, height); + } + + public TGComponent isOnOnlyMe(int x1, int y1) { + if (GraphicLib.isInRectangle(x1, y1, x, y, width, height)) { + return this; + } + return null; + } + + public int getType() { + return TGComponentManager.TMLAD_UNORDERED_SEQUENCE; + } + + public int getDefaultConnector() { + return TGComponentManager.CONNECTOR_TMLAD; + } + +} diff --git a/src/ui/tmlad/TMLActivityDiagramToolBar.java b/src/ui/tmlad/TMLActivityDiagramToolBar.java index 918648fa71f7be2e8f2ed99b8e6a0d75a5d60dbe..cff3dd814aab31cdf76a8d50276346bc2845329d 100755 --- a/src/ui/tmlad/TMLActivityDiagramToolBar.java +++ b/src/ui/tmlad/TMLActivityDiagramToolBar.java @@ -86,6 +86,7 @@ public class TMLActivityDiagramToolBar extends TToolBar { mgui.actions[TGUIAction.TMLAD_FOR_STATIC_LOOP].setEnabled(b); mgui.actions[TGUIAction.TMLAD_FOR_EVER_LOOP].setEnabled(b); mgui.actions[TGUIAction.TMLAD_SEQUENCE].setEnabled(b); + mgui.actions[TGUIAction.TMLAD_UNORDERED_SEQUENCE].setEnabled(b); mgui.actions[TGUIAction.ACT_ENHANCE].setEnabled(b); mgui.actions[TGUIAction.ACT_TOGGLE_INTERNAL_COMMENT].setEnabled(b); mgui.actions[TGUIAction.ACT_TOGGLE_DIPLO_ID].setEnabled(b); @@ -164,6 +165,9 @@ public class TMLActivityDiagramToolBar extends TToolBar { button = this.add(mgui.actions[TGUIAction.TMLAD_SEQUENCE]); button.addMouseListener(mgui.mouseHandler); + + button = this.add(mgui.actions[TGUIAction.TMLAD_UNORDERED_SEQUENCE]); + button.addMouseListener(mgui.mouseHandler); this.addSeparator();