Revision 531

View differences:

branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/i18n/I18nMessageService.java
1
package org.modelio.module.sysml.i18n;
2

  
3
import java.text.MessageFormat;
4
import java.util.Locale;
5
import java.util.MissingResourceException;
6
import java.util.ResourceBundle;
7
import com.modeliosoft.modelio.javadesigner.annotations.objid;
8

  
9
/**
10
 * Message service
11
 * <br>Use of "i18n/messages"
12
 */
13
@objid ("463ead25-4cde-4d69-98da-8bb1d69ab2e5")
14
public class I18nMessageService {
15
    @objid ("97374cab-78ac-4562-a6c4-a49a3869a7b4")
16
    private static final String FILE_NAME_MESSAGES = "org.modelio.module.sysml.i18n.messages";
17

  
18
    @objid ("aab38df2-69e5-4a7d-bf73-30e44411dac6")
19
    private static I18nMessageService instance;
20

  
21
    @objid ("278e1bb6-71a0-41e8-bead-81e79a26bad7")
22
    private ResourceBundle messageResource;
23

  
24
    /**
25
     * Private constructor.
26
     */
27
    @objid ("cd46e10c-e9e0-48a4-b96b-80e1d4631204")
28
    private I18nMessageService() {
29
        Locale locale = Locale.getDefault();
30
        this.messageResource = ResourceBundle.getBundle(FILE_NAME_MESSAGES, locale);
31
    }
32

  
33
    /**
34
     * Singleton creation.
35
     */
36
    @objid ("b28ccc9f-0a98-4b21-8f44-d216db2efa96")
37
    private static I18nMessageService getInstance() {
38
        if (null == instance) { // Premier appel
39
            instance = new I18nMessageService();
40
        }
41
        return instance;
42
    }
43

  
44
    /**
45
     * @return the messageResource
46
     */
47
    @objid ("e721ad78-9cf0-45a8-be66-46b9255bc591")
48
    private ResourceBundle getMessageResource() {
49
        return this.messageResource;
50
    }
51

  
52
    /**
53
     * Get message value from key.
54
     * @param key the key for the desired string.
55
     * @return the string for the given key.
56
     */
57
    @objid ("1aaa6349-375a-4dd4-b2b5-da987ccb1e8f")
58
    public static String getString(String key) {
59
        String message = null;
60
        try {
61
            message = getInstance().getMessageResource().getString(key);
62
        } catch (@SuppressWarnings ("unused") MissingResourceException e) {
63
            message = '!' + key + '!';
64
        }
65
        return message;
66
    }
67

  
68
    /**
69
     * Get list of messages values from key with parameters.
70
     * @param key the key for the desired string.
71
     * @param params an array of objects to be formatted and substituted.
72
     * @return the string for the given key.
73
     */
74
    @objid ("0e3d1b43-4456-4b94-9e36-69400402ad17")
75
    public static String getString(String key, String... params) {
76
        String message = null;
77
        try {
78
            String value = getString(key);
79
            message = MessageFormat.format(value, (Object[]) params);
80
        } catch (@SuppressWarnings ("unused") MissingResourceException e) {
81
            message = '!' + key + '!';
82
        }
83
        return message;
84
    }
85

  
86
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/CommandExpert.java
1
package org.modelio.module.sysml.utils;
2

  
3
import com.modeliosoft.modelio.javadesigner.annotations.objid;
4
import org.modelio.api.modelio.model.IUmlModel;
5
import org.modelio.metamodel.uml.infrastructure.Profile;
6
import org.modelio.metamodel.uml.statik.Class;
7
import org.modelio.metamodel.uml.statik.Classifier;
8
import org.modelio.metamodel.uml.statik.Package;
9
import org.modelio.module.sysml.api.ISysMLPeerModule;
10
import org.modelio.module.sysml.api.SysMLStereotypes;
11
import org.modelio.module.sysml.filters.BlockFilter;
12
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
13
import org.modelio.module.sysml.impl.SysMLModule;
14
import org.modelio.vcore.smkernel.mapi.MObject;
15

  
16
@objid ("323f1420-85a3-47ad-b8f7-df67cb8880b1")
17
public class CommandExpert {
18
    @objid ("8e989e6b-3447-49a9-856b-b56bc68ff9b4")
19
    public static boolean acceptBlock(MObject selectedElement) {
20
        return (accept(selectedElement))
21
                                && ((selectedElement instanceof Package))
22
                                || ((selectedElement instanceof Class) 
23
                                        && (BlockFilter.isABlock(selectedElement)
24
                                                && (!ConstraintBlockFilter.isAConstraintBlock(selectedElement))));
25
    }
26

  
27
    @objid ("23dbff48-5df5-4006-8314-ad21d28ebc80")
28
    public static boolean acceptConnectorProperty(MObject selectedElement) {
29
        return (accept(selectedElement))
30
                                && (BlockFilter.isABlock (selectedElement))
31
                                && (!ConstraintBlockFilter.isAConstraintBlock(selectedElement));
32
    }
33

  
34
    @objid ("410794db-fb05-4a53-8969-606e1d849b9e")
35
    public static boolean acceptConstraintBlock(MObject selectedElement) {
36
        return (accept(selectedElement))
37
                                && (selectedElement instanceof Package)
38
                                && (!(selectedElement instanceof Profile));
39
    }
40

  
41
    @objid ("eaa3d2ce-de21-46ff-ab9e-35204e1aa38f")
42
    public static boolean acceptConstraintProperty(MObject selectedElement) {
43
        return (accept(selectedElement))
44
                                && (BlockFilter.isABlock (selectedElement))
45
                                || (ConstraintBlockFilter.isAConstraintBlock(selectedElement));
46
    }
47

  
48
    @objid ("ad7a4ecb-cea8-42fb-be62-910579d98932")
49
    public static boolean acceptDistributedProperty(MObject selectedElement) {
50
        return ((accept(selectedElement))
51
                                && ((selectedElement instanceof Classifier)
52
                                        &&(BlockFilter.isABlock(selectedElement))
53
                                        && (!ConstraintBlockFilter.isAConstraintBlock(selectedElement))
54
                                        || (((Classifier) selectedElement).isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE))));
55
    }
56

  
57
    @objid ("0223c4cf-cf29-4009-b3c7-9b5058af0e9c")
58
    public static boolean acceptContinuousParameter(MObject selectedElement) {
59
        return  ((selectedElement != null) 
60
                                && (selectedElement.getStatus().isModifiable())
61
                                && acceptInternal(selectedElement));
62
    }
63

  
64
    @objid ("dfb3e281-2869-4aa5-923b-d7d2c9608537")
65
    public static boolean accept(MObject selectedElement) {
66
        return  ((selectedElement != null) 
67
                                && (selectedElement.getStatus().isModifiable())
68
                                && acceptInternal(selectedElement));
69
    }
70

  
71
    @objid ("0d66bbdf-0e6e-4aa0-ae74-8490c62020e7")
72
    private static boolean acceptInternal(MObject selectedElement) {
73
        IUmlModel model = SysMLModule.getInstance().getModuleContext().getModelingSession().getModel();
74
        
75
        for (MObject libRoot : model.getLibraryRoots()){
76
            if (selectedElement.equals(libRoot)){
77
                return false;
78
            }
79
        }
80
        
81
        for (MObject modelRoot : model.getModelRoots()){
82
            if (selectedElement.equals(modelRoot)){
83
                return false;
84
            }
85
        }
86
        return !((selectedElement.equals(model)));
87
    }
88

  
89
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/ConstraintChecker.java
1
/**
2
 * Java Class : ConstraintChecker.java
3
 *
4
 * Description :
5
 *
6
 * Licensed to the Apache Software Foundation (ASF) under one
7
 * or more contributor license agreements.  See the NOTICE file
8
 * distributed with this work for additional information
9
 * regarding copyright ownership.  The ASF licenses this file
10
 * to you under the Apache License, Version 2.0 (the
11
 * "License"); you may not use this file except in compliance
12
 * with the License.  You may obtain a copy of the License at
13
 *
14
 *    http://www.apache.org/licenses/LICENSE-2.0
15
 *
16
 *    Unless required by applicable law or agreed to in writing,
17
 *    software distributed under the License is distributed on an
18
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
 *    KIND, either express or implied.  See the License for the
20
 *    specific language governing permissions and limitations
21
 *    under the License.
22
 *
23
 * @category   Util
24
 * @package    com.modeliosoft.modelio.sysml.utils
25
 * @author     Modelio
26
 * @license    http://www.apache.org/licenses/LICENSE-2.0
27
 * @version    2.0.08
28
 **/
29
package org.modelio.module.sysml.utils;
30

  
31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32
import org.eclipse.jface.dialogs.MessageDialog;
33
import org.eclipse.swt.widgets.Display;
34
import org.modelio.api.modelio.model.IModelingSession;
35
import org.modelio.api.modelio.model.ITransaction;
36
import org.modelio.metamodel.uml.behavior.commonBehaviors.Signal;
37
import org.modelio.metamodel.uml.infrastructure.Element;
38
import org.modelio.metamodel.uml.statik.Attribute;
39
import org.modelio.metamodel.uml.statik.BindableInstance;
40
import org.modelio.metamodel.uml.statik.Classifier;
41
import org.modelio.metamodel.uml.statik.GeneralClass;
42
import org.modelio.metamodel.uml.statik.Interface;
43
import org.modelio.metamodel.uml.statik.NameSpace;
44
import org.modelio.metamodel.uml.statik.Operation;
45
import org.modelio.metamodel.uml.statik.Port;
46
import org.modelio.module.sysml.api.ISysMLPeerModule;
47
import org.modelio.module.sysml.api.SysMLStereotypes;
48
import org.modelio.module.sysml.i18n.I18nMessageService;
49
import org.modelio.module.sysml.impl.SysMLModule;
50

  
51
/**
52
 * This class provides services for checking SysML profile constraintes
53
 * @author ebrosse
54
 */
55
@objid ("85cb0457-feea-49e5-841d-3a95970a2cad")
56
public class ConstraintChecker {
57
    /**
58
     * Method CheckUpdatedElement
59
     * @author ebrosse
60
     * @param toCheck : the checked element
61
     */
62
    @objid ("d8570c36-cd07-47b3-a15c-cd62e5962930")
63
    public static void CheckUpdatedElement(Element toCheck) {
64
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
65
        try( ITransaction transaction = session.createTransaction (I18nMessageService.getString ("Info.Session.Create", "Check Update"))){
66
        
67
            if (toCheck instanceof Classifier){
68
                CheckUpdatedClassifier((Classifier) toCheck);
69
            }
70
        
71
            if (toCheck instanceof Port){
72
                CheckUpdatedPort((Port) toCheck);
73
            }
74
        
75
            if (toCheck instanceof Attribute){
76
                CheckUpdatedAttribute((Attribute) toCheck);
77
            }
78
        
79
            if (toCheck instanceof BindableInstance){
80
                CheckUpdatedBindableInstance((BindableInstance) toCheck);
81
            }
82
        
83
            if (toCheck instanceof Interface){
84
                CheckUpdatedInterface((Interface) toCheck);
85
            }
86
        
87
            transaction.commit();
88
        }
89
    }
90

  
91
    /**
92
     * Method CheckUpdatedInterface
93
     * @author ebrosse
94
     * @param toCheck
95
     */
96
    @objid ("11d1fae4-19af-4650-8a58-7ff59112a996")
97
    private static void CheckUpdatedInterface(Interface toCheck) {
98
        /**Flow specifications cannot own operations or receptions (they can only own FlowProperties).**/
99
        /**Every ?ownedAttribute? of a FlowSpecification must be a FlowProperty**/
100
        if (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWSPECIFICATION)){
101
            boolean ownedOperation = toCheck.getOwnedOperation().size() > 0;
102
            boolean ownedSimpleAttribute = false;
103
        
104
            for(Attribute current :toCheck.getOwnedAttribute() ){
105
                if ( !(current.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWPROPERTY)))
106
                    ownedSimpleAttribute = true;
107
            }
108
        
109
            if (ownedOperation)
110
                MessageDialog.openInformation(Display.getDefault().getActiveShell()
111
                        ,"SysML"
112
                        ,I18nMessageService.getString("Ui.I18nMessageService.FlowSpecificationCannotOwnOperations"));
113
        
114
        
115
            if (ownedSimpleAttribute)
116
                MessageDialog.openInformation(Display.getDefault().getActiveShell()
117
                        ,"SysML"
118
                        ,I18nMessageService.getString("Ui.I18nMessageService.FlowSpecificationCannotOwnSimpleAttribute"));
119
        
120
        }
121
    }
122

  
123
    /**
124
     * Method CheckCreatedElement
125
     * @author ebrosse
126
     * @param toCheck : the MObject to check
127
     */
128
    @objid ("689d874f-d939-4515-85ff-ffd182894570")
129
    public static void CheckCreatedElement(Element toCheck) {
130
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
131
        try( ITransaction transaction = session.createTransaction (I18nMessageService.getString ("Info.Session.Create", "Activity"))){
132
        
133
            if (toCheck instanceof Operation){
134
                CheckCreatedOperation((Operation) toCheck);
135
            }
136
        
137
            if (toCheck instanceof Attribute){
138
                CheckCreatedAttribute((Attribute) toCheck);
139
            }
140
        
141
            transaction.commit();
142
        }
143
    }
144

  
145
    /**
146
     * Method CheckCreatedOperation
147
     * @author ebrosse
148
     * @param toCheck
149
     */
150
    @objid ("8c87abde-1950-4f6e-b4e3-71f296d693d7")
151
    private static void CheckCreatedOperation(Operation toCheck) {
152
        /**Flow specifications cannot own operations or receptions (they can only own FlowProperties).**/
153
        Classifier owner = toCheck.getOwner();
154
        if (owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWSPECIFICATION)){
155
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
156
                    ,"SysML"
157
                    ,I18nMessageService.getString("Ui.I18nMessageService.FlowSpecificationCannotOwnOperations"));
158
        
159
        }
160
    }
161

  
162
    /**
163
     * Method CheckCreatedAttribute
164
     * @author ebrosse
165
     * @param toCheck
166
     */
167
    @objid ("ff7cdfe7-eb79-4b9c-a035-f8267d870c9f")
168
    private static void CheckCreatedAttribute(Attribute toCheck) {
169
        /**Flow specifications cannot own operations or receptions (they can only own FlowProperties).**/
170
        Classifier owner = toCheck.getOwner();
171
        if (owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWSPECIFICATION)){
172
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
173
                    ,"SysML"
174
                    ,I18nMessageService.getString("Ui.I18nMessageService.FlowSpecificationCannotOwnSimpleAttribute"));
175
        
176
        }
177
    }
178

  
179
    /**
180
     * Method CheckUpdatedClassifier
181
     * @author ebrosse
182
     * @param toCheck
183
     */
184
    @objid ("eb17ad2c-7331-43a6-b9be-48a1fa95a9e4")
185
    private static void CheckUpdatedClassifier(Classifier toCheck) {
186
        /**The name of a classifier to which a PropertySpecificType is applied must be missing. (The ?name? attribute of the NamedElement metaclass must be empty.)**/
187
        if  (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.PROPERTYSPECIFICTYPE)){
188
            toCheck.setName("");
189
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
190
                    ,"SysML"
191
                    ,I18nMessageService.getString("Ui.I18nMessageService.NameOfPropertySpecificTypeMustBeMissing"));
192
        
193
        }
194
    }
195

  
196
    /**
197
     * Method CheckUpdatedAttribute
198
     * @author ebrosse
199
     * @param toCheck
200
     */
201
    @objid ("9cb465cd-899f-4adb-b639-c62db1cff6fa")
202
    private static void CheckUpdatedAttribute(Attribute toCheck) {
203
        /**If a property owned by a SysML Block or SysML ValueType is typed by a SysML ValueType,
204
        then the aggregation attribute of the property must be ?composite.?**/
205
        Classifier owner = toCheck.getOwner();
206
        GeneralClass type = toCheck.getType();
207
        if ((owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK) || owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE))
208
                && ((type != null) && (type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE)))){
209
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
210
                    ,"SysML"
211
                    ,I18nMessageService.getString("Ui.I18nMessageService.ValueTypePropertyMustBeComposite"));
212
        
213
        }
214
        
215
        /**The DistributedProperty stereotype may be applied only to properties of classifiers stereotyped by Block or ValueType**/
216
        if ( (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.DISTRIBUTEDPROPERTY)) && 
217
                ( !    (owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK) || owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE))))
218
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
219
                    ,"SysML"
220
                    ,I18nMessageService.getString("Ui.I18nMessageService.DistributedPropertyOwnerMustBeBlockOrValueType"));
221
        
222
        
223
        /**A FlowProperty is typed by a ValueType, Block, or Signal.**/
224
        if ((type != null) && (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWPROPERTY)) && 
225
                ( !    (type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK) || type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE) 
226
                        || (type instanceof Signal))))
227
            MessageDialog.openInformation(Display.getDefault().getActiveShell()
228
                    ,"SysML"
229
                    ,I18nMessageService.getString("Ui.I18nMessageService.FlowPropertyTypeControl"));
230
    }
231

  
232
    /**
233
     * Method CheckUpdatedPort
234
     * @author ebrosse
235
     * @param toCheck
236
     */
237
    @objid ("a58a0d7b-252b-4a86-a661-47c06be25bca")
238
    private static void CheckUpdatedPort(Port toCheck) {
239
        /**A FlowPort must be typed by a FlowSpecification, Block, Signal, or ValueType.**/
240
        NameSpace type = toCheck.getBase();
241
        if (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWPORT) && (type != null) 
242
                && (!(type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.FLOWSPECIFICATION) 
243
                        || type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK)
244
                        || type.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE)
245
                        || (type instanceof Signal)))){
246
            MessageDialog.openInformation(Display.getDefault().getActiveShell(),
247
                    "SysML",
248
                    I18nMessageService.getString("Ui.I18nMessageService.FlowPropertyTypeControl"));
249
        
250
        }
251
    }
252

  
253
    /**
254
     * Method CheckUpdatedBindableInstance
255
     * @author ebrosse
256
     * @param toCheck
257
     */
258
    @objid ("d35a5873-765f-4c86-a56c-0eb78dbff2d6")
259
    private static void CheckUpdatedBindableInstance(BindableInstance toCheck) {
260
        /**ConnectorProperty may only be applied to properties of classes stereotyped by Block.**/
261
        Classifier owner = toCheck.getInternalOwner();
262
        if ((owner != null) && (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.CONNECTORPROPERTY)) && ( !owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK)))
263
            MessageDialog.openInformation(Display.getDefault().getActiveShell(),
264
                    "SysML",
265
                    I18nMessageService.getString("Ui.I18nMessageService.ConnectorPropertyOwnerMustBeBlock"));
266
        
267
        /**The DistributedProperty stereotype may be applied only to properties of classifiers stereotyped by Block or ValueType**/
268
        if ((owner != null) && (toCheck.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.DISTRIBUTEDPROPERTY)) && 
269
                ( !    (owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK) || owner.isStereotyped(ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.VALUETYPE))))
270
            MessageDialog.openInformation(Display.getDefault().getActiveShell(),
271
                    "SysML",
272
                    I18nMessageService.getString("Ui.I18nMessageService.DistributedPropertyOwnerMustBeBlockOrValueType"));
273
    }
274

  
275
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/IDiagramCustomizerPredefinedField.java
1
package org.modelio.module.sysml.utils;
2

  
3
import com.modeliosoft.modelio.javadesigner.annotations.objid;
4

  
5
/**
6
 * This class lists all predefined value of UML command name.
7
 * @author ebrosse
8
 */
9
@objid ("8dc66ad8-81dd-497c-87aa-640be61ef051")
10
public interface IDiagramCustomizerPredefinedField {
11
    @objid ("45e0bd8d-edc1-4cf6-a800-d3801e30571b")
12
    public static final String Aggregation = "CREATE_AGGREGATION";
13

  
14
    @objid ("296238f0-9dfb-4a72-b332-9bc10f7014ac")
15
    public static final String Association = "CREATE_ASSOCIATION";
16

  
17
    @objid ("088d6808-4bb5-4faf-a9db-8779f97df81e")
18
    public static final String Attribute = "CREATE_ATTRIBUTE";
19

  
20
    @objid ("ab2127e6-f446-4162-b39c-2ebce4f3d169")
21
    public static final String AttributeLink = "CREATE_ATTRIBUTELINK";
22

  
23
    @objid ("cbc81f26-b8f5-4f82-9a59-6e28d950b3da")
24
    public static final String BindableInstance = "CREATE_BINDABLEINSTANCE";
25

  
26
    @objid ("39cc2d3a-c92d-41cc-a3c1-8cd79d2e44e4")
27
    public static final String Binding = "CREATE_BINDING";
28

  
29
    @objid ("632e0ccf-e8a0-4d1f-8429-d6f61b826d78")
30
    public static final String Class = "CREATE_CLASS";
31

  
32
    @objid ("2124a3d5-ebab-458c-892d-248069ebc75f")
33
    public static final String ClassAssociation = "CREATE_CLASSASSOCIATION";
34

  
35
    @objid ("a6c4e08b-5936-4c7d-a5c2-a9ab56bfe58c")
36
    public static final String Collaboration = "CREATE_COLLABORATION";
37

  
38
    @objid ("68e387d2-5bc5-45b0-88c3-a6042b074a96")
39
    public static final String CollaborationUse = "CREATE_COLLABORATIONUSE";
40

  
41
    @objid ("8ef1a221-5fd2-4045-93d0-41f9a990e058")
42
    public static final String Composition = "CREATE_COMPOSITION";
43

  
44
    @objid ("c1d57e21-b43a-4728-8531-909aa7689668")
45
    public static final String Component = "CREATE_COMPONENT";
46

  
47
    @objid ("4ab3353e-37bb-4016-80d9-9176ac1f1d5b")
48
    public static final String Constraint = "CREATE_CONSTRAINT";
49

  
50
    @objid ("5231065d-c7d2-4f66-a183-499dc527858a")
51
    public static final String Datatype = "CREATE_DATATYPE";
52

  
53
    @objid ("6af3f82c-86d8-4fed-8a81-9c7cbac4ee05")
54
    public static final String DelegateLink = "CREATE_DELEGATELINK";
55

  
56
    @objid ("ed96f8aa-5828-429e-a474-e31d79320fa0")
57
    public static final String Dependency = "CREATE_DEPENDENCY";
58

  
59
    @objid ("e2c7623c-9968-4d72-b633-845f853715bb")
60
    public static final String DrawingRectangle = "CREATE_DRAWING_RECTANGLE";
61

  
62
    @objid ("824c7ec5-d4f1-456d-b127-ad55b44525cc")
63
    public static final String DrawingEllipse = "CREATE_DRAWING_ELLIPSE";
64

  
65
    @objid ("6721a573-cff4-4784-af78-c9117bef22ac")
66
    public static final String DrawingText = "CREATE_DRAWING_TEXT";
67

  
68
    @objid ("1dd81b3a-4b21-4a44-89ba-80f08953986c")
69
    public static final String DrawingLine = "CREATE_DRAWING_LINE";
70

  
71
    @objid ("c7707408-796f-451d-93bd-e3830f4474d2")
72
    public static final String ElementImport = "CREATE_ELEMENTIMPORT";
73

  
74
    @objid ("85b5261c-a429-4a74-b529-64f3c3a74c7f")
75
    public static final String Enumeration = "CREATE_ENUMERATION";
76

  
77
    @objid ("d09acd90-4177-4d61-a3cd-d9208fbbc370")
78
    public static final String EnumerationLiteral = "CREATE_ENUMERATIONLITERAL";
79

  
80
    @objid ("fe8d161f-b663-4572-9228-61827cd66511")
81
    public static final String Generalization = "CREATE_GENERALIZATION";
82

  
83
    @objid ("c0810e8d-129c-4255-9c2c-bf8bf57bb218")
84
    public static final String Instance = "CREATE_INSTANCE";
85

  
86
    @objid ("8e006355-87e4-459c-b918-917e59df42e5")
87
    public static final String InstanceLink = "CREATE_INSTANCELINK";
88

  
89
    @objid ("8cc6ba31-2ebb-4b5d-a425-6503a3d5daaa")
90
    public static final String Interface = "CREATE_INTERFACE";
91

  
92
    @objid ("71161819-4e71-4efd-9625-c1a1b1a3ebd9")
93
    public static final String InterfaceRealization = "CREATE_INTERFACEREALIZATION";
94

  
95
    @objid ("1c580b76-b0e6-4c8f-b155-a7247982abee")
96
    public static final String Link = "CREATE_INSTANCELINK";
97

  
98
    @objid ("eca3409f-7c93-4018-a4c8-e0c008d7d2b5")
99
    public static final String NAryInstanceLink = "CREATE_NARY_INSTANCELINK";
100

  
101
    @objid ("c9cb3c57-6005-4dbc-b22e-f67b28deb7ce")
102
    public static final String Note = "CREATE_NOTE";
103

  
104
    @objid ("b707d2fe-75c8-444e-9048-518ff71f40b0")
105
    public static final String Operation = "CREATE_OPERATION";
106

  
107
    @objid ("5959070e-48bf-45c7-a190-8ceb5fb7e519")
108
    public static final String Package = "CREATE_PACKAGE";
109

  
110
    @objid ("22af8441-7d32-48fc-acb6-b4bec346f68a")
111
    public static final String PackageImport = "CREATE_PACKAGEIMPORT";
112

  
113
    @objid ("fd77aa63-1af3-4afb-813e-edb1e6a03862")
114
    public static final String PackageMerge = "CREATE_PACKAGEMERGE";
115

  
116
    @objid ("f6576a92-abe2-49b5-b787-366d85f869db")
117
    public static final String Port = "CREATE_PORT";
118

  
119
    @objid ("a767c14b-7e16-423f-8ca5-d7460bf9b119")
120
    public static final String ProvidedInterface = "CREATE_PROVIDED_INTERFACE";
121

  
122
    @objid ("945b1f51-0b4a-4aae-9fd6-554d0accee63")
123
    public static final String RelatedDiagramLink = "CREATE_RELATED_DIAGRAM_LINK";
124

  
125
    @objid ("f36d2089-86d6-4862-a3a6-01dd279ea2ff")
126
    public static final String RaisedException = "CREATE_RAISEDEXCEPTION";
127

  
128
    @objid ("e83c0c27-fac9-4e4e-a090-19dbb7204300")
129
    public static final String RequiredInterface = "CREATE_REQUIRED_INTERFACE";
130

  
131
    @objid ("543de07c-ea90-4107-aaff-8e86cb6ca769")
132
    public static final String Signal = "CREATE_SIGNAL";
133

  
134
    @objid ("3b9f019c-3ecf-4f0d-940d-099703bd1e7d")
135
    public static final String SmartGeneralization = "CREATE_SMARTGENERALIZATION";
136

  
137
    @objid ("e73312a8-3b23-4a34-b6fd-27bc1395943e")
138
    public static final String TemplateParameter = "CREATE_TEMPLATEPARAMETER";
139

  
140
    @objid ("271c431f-f9ee-486f-a0a4-e19ded1e20a3")
141
    public static final String TemplateBinding = "CREATE_TEMPLATEBINDING";
142

  
143
    @objid ("84e62c21-1350-4e71-9b47-39702fddb297")
144
    public static final String Traceability = "CREATE_TRACEABILITY";
145

  
146
    @objid ("413773ac-48a4-4538-a3ff-f36d525308b8")
147
    public static final String Use = "CREATE_USE";
148

  
149
    @objid ("44e40c5c-5dcc-4a55-a3ae-5e1b16c1dd35")
150
    public static final String ActivityPartitionVerticalContainer = "CREATE_ACTIVITYPARTITION_VERTICAL_CONTAINER";
151

  
152
    @objid ("1303d368-1e40-4d44-afa4-9e3f03c66690")
153
    public static final String ActivityPartitionHorizontalContainer = "CREATE_ACTIVITYPARTITION_HORIZONTAL_CONTAINER";
154

  
155
    @objid ("a23a4f57-c319-4c9b-8620-cb83bcc715db")
156
    public static final String ActivityPartitionSibling = "CREATE_ACTIVITYPARTITION_SIBLING";
157

  
158
    @objid ("af65e73a-1843-4f21-a69c-f6ea919ed488")
159
    public static final String ActivityPartitionInner = "CREATE_ACTIVITYPARTITION_INNER";
160

  
161
    @objid ("d7ecd2b2-668a-4892-9c87-a84b0a79a050")
162
    public static final String SmartFlow = "CREATE_SMARTFLOW";
163

  
164
    @objid ("bae5031d-1c9b-45c7-90b6-d58e679f2b3a")
165
    public static final String ControlFlow = "CREATE_CONTROLFLOW";
166

  
167
    @objid ("0a0ba852-035b-402e-bb45-05727c086d44")
168
    public static final String ObjectFlow = "CREATE_OBJECTFLOW";
169

  
170
    @objid ("38cacc22-8d56-42ce-926c-1b69b5772f56")
171
    public static final String ExceptionHandler = "CREATE_EXCEPTIONHANDLER";
172

  
173
    @objid ("594cf150-5617-47fb-bfa8-6fc49da0e7d2")
174
    public static final String InstanceNode = "CREATE_INSTANCENODE";
175

  
176
    @objid ("e02f90d2-3027-423c-b003-95f39d49c1b5")
177
    public static final String DataStoreNode = "CREATE_DATASTORENODE";
178

  
179
    @objid ("4aca90f1-44ac-4aa0-af8d-78056551b6da")
180
    public static final String CentralBufferNode = "CREATE_CENTRALBUFFERNODE";
181

  
182
    @objid ("6e16de27-1a12-4677-ac9a-1cdec9344fc9")
183
    public static final String ContinuousParameter = "CREATE_CONTINUOUS_PARAMETER";
184

  
185
    @objid ("6bd19959-cb12-40c0-a971-8d93031ee3ab")
186
    public static final String SendSignalAction = "CREATE_SENDSIGNALACTION";
187

  
188
    @objid ("767f8d58-3a4b-4f98-b983-4c608c67c874")
189
    public static final String AcceptCallEventAction = "CREATE_ACCEPTCALLEVENTACTION";
190

  
191
    @objid ("c46fc50c-36e8-47b6-a51c-8f95b77c2fcc")
192
    public static final String AcceptChangeEventAction = "CREATE_ACCEPTCHANGEEVENTACTION";
193

  
194
    @objid ("e88e3ff1-7c8a-4e27-a482-bbc7586289d2")
195
    public static final String AcceptSignalAction = "CREATE_ACCEPTSIGNALACTION";
196

  
197
    @objid ("325901c3-16ec-445a-91fc-1fc376fcab1f")
198
    public static final String AcceptTimeEventAction = "CREATE_ACCEPTTIMEEVENTACTION";
199

  
200
    @objid ("42fee4c3-53c2-4806-bd9b-018233fd3f28")
201
    public static final String ActivityParameterNode = "CREATE_ACTIVITYPARAMETERNODE";
202

  
203
    @objid ("c2c63108-6634-450b-b8a8-8cb2bbd07d7b")
204
    public static final String InputPin = "CREATE_INPUTPIN";
205

  
206
    @objid ("3e1a9136-7f96-40b3-af37-819eda65bfb1")
207
    public static final String OutputPin = "CREATE_OUTPUTPIN";
208

  
209
    @objid ("ed4906a6-13d3-486a-b87c-ba83b2e6d35e")
210
    public static final String ValuePin = "CREATE_VALUEPIN";
211

  
212
    @objid ("943353a4-0495-47ef-970d-46d9af248818")
213
    public static final String ExpansionNodeInput = "CREATE_EXPANSIONNODE_INPUT";
214

  
215
    @objid ("a41e8d26-68f2-4110-9d2e-716ae1b0cd24")
216
    public static final String ExpansionNodeOutput = "CREATE_EXPANSIONNODE_OUTPUT";
217

  
218
    @objid ("60941500-83d5-4865-baa9-06fb56a53bac")
219
    public static final String OpaqueAction = "CREATE_OPAQUEACTION";
220

  
221
    @objid ("1804abf4-dc18-43ef-89d5-dfc79fe61b69")
222
    public static final String CallBehaviorAction = "CREATE_CALLBEHAVIORACTION";
223

  
224
    @objid ("65e79e65-0a01-4333-b005-4be12bd21ce2")
225
    public static final String CallOperationAction = "CREATE_CALLOPERATIONACTION";
226

  
227
    @objid ("f2435df1-bb75-41d2-a2fe-9adcdb6eaf12")
228
    public static final String ConditionalNode = "CREATE_CONDITIONALNODE";
229

  
230
    @objid ("b1943337-e709-4511-bfc7-7d10c81d510a")
231
    public static final String Clause = "CREATE_CLAUSE";
232

  
233
    @objid ("e14c1f64-546c-42b8-8e7f-aee8e201f2e3")
234
    public static final String LoopNode = "CREATE_LOOPNODE";
235

  
236
    @objid ("c9e60bf9-a3da-4f8d-9db7-d80e78dafe85")
237
    public static final String StructuredNode = "CREATE_STRUCTUREDNODE";
238

  
239
    @objid ("7277c484-ec3c-4ed8-9ddf-332a9ddaa917")
240
    public static final String ExpansionRegion = "CREATE_EXPANSIONREGION";
241

  
242
    @objid ("5b5ff23f-65fa-4b44-bf57-39dc1818238f")
243
    public static final String InitialNode = "CREATE_INITIALNODE";
244

  
245
    @objid ("1a3586b6-0dc3-4a9e-aa37-02123cfbd0ea")
246
    public static final String ActivityFinalNode = "CREATE_ACTIVITYFINALNODE";
247

  
248
    @objid ("2f414efa-63c2-477d-9cef-475325b8599b")
249
    public static final String FlowFinalNode = "CREATE_FLOWFINALNODE";
250

  
251
    @objid ("55faa727-9c26-4ae9-886c-e0c067d82cc1")
252
    public static final String ForkJoinNode = "CREATE_FORKJOINNODE";
253

  
254
    @objid ("7937ebb1-2221-4de9-ae93-3c08f0c7b6d7")
255
    public static final String DecisionMergeNode = "CREATE_DECISIONMERGENODE";
256

  
257
    @objid ("19c775ff-843a-42cd-b973-10f97920474f")
258
    public static final String InterruptibleActivityRegion = "CREATE_INTERRUPTIBLEACTIVITYREGION";
259

  
260
    @objid ("6292944c-8f7e-43b0-a1c4-79cb0db9a4dc")
261
    public static final String Satisfy = "CREATE_DEPENDENCYSATISFY";
262

  
263
    @objid ("6beaf945-c1bd-48b7-b4d1-4c9ab008fae8")
264
    public static final String Derive = "CREATE_DEPENDENCYDERIVE";
265

  
266
    @objid ("f51bc32f-1ad5-490b-9ff2-9176742fe6a3")
267
    public static final String Verify = "CREATE_DEPENDENCYVERIFY";
268

  
269
    @objid ("fba3a711-e7f5-4c4f-bfa6-039418a0a40e")
270
    public static final String Refine = "CREATE_DEPENDENCYREFINE";
271

  
272
    @objid ("52a9b746-d83e-491c-baef-8f6ad4de105f")
273
    public static final String Part = "CREATE_DEPENDENCYPART";
274

  
275
    @objid ("01944a67-8d52-4c47-a049-d866e7d55b9d")
276
    public static final String InformationFlow = "CREATE_INFORMATIONFLOW";
277

  
278
    @objid ("f336722d-fa8a-4504-8609-44e8cc5e2182")
279
    public static final String InformationFlowRealized = "CREATE_INFORMATIONFLOWNODE";
280

  
281
    @objid ("8dcf33fe-7a63-4ad0-af0d-b496511b3210")
282
    public static final String InformationItem = "CREATE_INFORMATIONITEM";
283

  
284
    @objid ("f8f4bb8a-9e47-4258-bb38-3f3e52f39753")
285
    public static final String RequirementContainer = "CREATE_REQUIREMENTCONTAINER";
286

  
287
    @objid ("53454d71-efaa-407e-a2c9-51eb2223c554")
288
    public static final String Requirement = "CREATE_REQUIREMENT";
289

  
290
    @objid ("60378fbd-29ab-43c3-89a5-dc94d9aef82f")
291
    public static final String ExternDocument = "CREATE_EXTERNDOCUMENT";
292

  
293
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/SysMLResourcesManager.java
1
/**
2
 * Java Class : ResourcesManager.java
3
 *
4
 * Description :
5
 *
6
 * Licensed to the Apache Software Foundation (ASF) under one
7
 * or more contributor license agreements.  See the NOTICE file
8
 * distributed with this work for additional information
9
 * regarding copyright ownership.  The ASF licenses this file
10
 * to you under the Apache License, Version 2.0 (the
11
 * "License"); you may not use this file except in compliance
12
 * with the License.  You may obtain a copy of the License at
13
 *
14
 *    http://www.apache.org/licenses/LICENSE-2.0
15
 *
16
 *    Unless required by applicable law or agreed to in writing,
17
 *    software distributed under the License is distributed on an
18
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
 *    KIND, either express or implied.  See the License for the
20
 *    specific language governing permissions and limitations
21
 *    under the License.
22
 *
23
 * @category   Util
24
 * @package    com.modeliosoft.modelio.sysml.utils
25
 * @author     Modelio
26
 * @license    http://www.apache.org/licenses/LICENSE-2.0
27
 * @version    2.0.08
28
 **/
29
package org.modelio.module.sysml.utils;
30

  
31
import java.io.File;
32
import com.modeliosoft.modelio.javadesigner.annotations.objid;
33
import org.modelio.api.module.IModule;
34
import org.modelio.module.sysml.i18n.I18nMessageService;
35

  
36
/**
37
 * This class handles the SysML resources i.e. images, styles, property names, etc.
38
 * @author ebrosse
39
 */
40
@objid ("802c2f11-7010-4f30-9a5f-e39b6d47b650")
41
public class SysMLResourcesManager {
42
    @objid ("e019e994-6b59-4be2-bc67-24ee1cd6ed9a")
43
    private IModule _mdac;
44

  
45
    @objid ("ef89ac06-d1e7-4ad5-9279-fef0280b4ad7")
46
    private static SysMLResourcesManager instance = null;
47

  
48
    /**
49
     * Method ResourcesManager
50
     * @author ebrosse
51
     */
52
    @objid ("354fd345-00b0-4fff-b692-2a8467ba3a09")
53
    private SysMLResourcesManager() {
54
    }
55

  
56
    /**
57
     * Method getInstance
58
     * @author ebrosse
59
     * @return the SysMLResourcesManager instance
60
     */
61
    @objid ("3e956d33-c5e0-4ddf-acc5-59c39ffbdce7")
62
    public static SysMLResourcesManager getInstance() {
63
        if(instance == null){
64
            instance =  new SysMLResourcesManager();
65
        }
66
        return instance;
67
    }
68

  
69
    /**
70
     * This method sets the current module
71
     * @param module : the current module
72
     */
73
    @objid ("36fcf8b9-b09e-4ece-a72a-750d5a322334")
74
    public void setJMDAC(IModule module) {
75
        this._mdac = module;
76
    }
77

  
78
    /**
79
     * Method getImage
80
     * @author ebrosse
81
     * @param imageName : the name of the image file
82
     * @return the complete path of the image file
83
     */
84
    @objid ("e2d20548-26fa-40b9-b056-091dbbce3660")
85
    public String getImage(String imageName) {
86
        return this._mdac.getModuleContext().getConfiguration().getModuleResourcesPath() + File.separator + "res" + File.separator + "icons" + File.separator + imageName;
87
    }
88

  
89
    /**
90
     * Method getStyle
91
     * @author ebrosse
92
     * @param styleName : the name of the style file
93
     * @return the absolute path of the style file
94
     */
95
    @objid ("7a9dc7e4-77a1-43d5-a114-e34f31f5d093")
96
    public String getStyle(String styleName) {
97
        return this._mdac.getModuleContext().getConfiguration().getModuleResourcesPath() + File.separator  + "res" + File.separator + "style" + File.separator + styleName;
98
    }
99

  
100
    /**
101
     * Method getPropertyName
102
     * @author ebrosse
103
     * @param propertyName : the name of the property
104
     * @return the internationalized name of the property
105
     */
106
    @objid ("23a95b18-5d51-45fa-a0dc-bcfd38266728")
107
    public String getPropertyName(String propertyName) {
108
        return I18nMessageService.getString("Ui.Property." + propertyName + ".Name" );
109
    }
110

  
111
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/ISysMLCustomizerPredefinedField.java
1
package org.modelio.module.sysml.utils;
2

  
3
import com.modeliosoft.modelio.javadesigner.annotations.objid;
4
import org.modelio.module.sysml.api.SysMLNoteTypes;
5
import org.modelio.module.sysml.api.SysMLStereotypes;
6

  
7
/**
8
 * This class lists all predefined value of UML command name.
9
 * @author ebrosse
10
 */
11
@objid ("e86a09a6-cc32-4716-b7b8-aae69736dfd0")
12
public interface ISysMLCustomizerPredefinedField {
13
    @objid ("4f900fe0-0013-404f-bfb5-5d90b366314c")
14
    public static final String Prefix = "SysML";
15

  
16
    @objid ("45167396-d057-46b2-8984-91ee287fdcc9")
17
    public static final String Allocate = Prefix + SysMLStereotypes.ALLOCATE;
18

  
19
    @objid ("bdb23591-a655-4f54-8ddd-72604994575c")
20
    public static final String Block = Prefix + SysMLStereotypes.BLOCK;
21

  
22
    @objid ("5ea6eaeb-db85-44b8-94c7-b2eb1704490c")
23
    public static final String BindingConnector = Prefix + SysMLStereotypes.BINDINGCONNECTOR;
24

  
25
    @objid ("4a5865b7-efd0-43c9-aea6-1baa75db31d3")
26
    public static final String Conform = Prefix + SysMLStereotypes.CONFORM;
27

  
28
    @objid ("928b8c82-f2cb-4426-b6df-f574fd169563")
29
    public static final String ConnectorProperty = Prefix + SysMLStereotypes.CONNECTORPROPERTY;
30

  
31
    @objid ("6aa4d566-cc48-4872-8e78-8ba345b13cfa")
32
    public static final String ConstraintBlock = Prefix + SysMLStereotypes.CONSTRAINTBLOCK;
33

  
34
    @objid ("5685b408-31f5-4841-b476-29a204cb702c")
35
    public static final String ConstraintProperty = Prefix + SysMLStereotypes.CONSTRAINTPROPERTY;
36

  
37
    @objid ("707fd0e9-6ff3-4918-b6af-87f31505f5c7")
38
    public static final String ContinuousActivityEdge = Prefix + SysMLStereotypes.CONTINUOUS_ACTIVITYEDGE;
39

  
40
    @objid ("1d76be74-5a13-4747-b837-003361ba9e1a")
41
    public static final String ContinuousParameter = Prefix + SysMLStereotypes.CONTINUOUS_PARAMETER;
42

  
43
    @objid ("8c4727bd-a51b-4c42-873d-7ed8793c5a31")
44
    public static final String DiscreteActivityEdge = Prefix + SysMLStereotypes.DISCRETE_ACTIVITYEDGE;
45

  
46
    @objid ("6723a2aa-403b-431d-b5ac-195fe657b86f")
47
    public static final String DiscreteParameter = Prefix + SysMLStereotypes.DISCRETE_PARAMETER;
48

  
49
    @objid ("b9853596-473a-4f08-a307-d9d2d8ceb43b")
50
    public static final String DistributedProperty = Prefix + SysMLStereotypes.DISTRIBUTEDPROPERTY;
51

  
52
    @objid ("15ba9c70-88a3-4054-b061-79258bb36bc2")
53
    public static final String FlowPort = Prefix + SysMLStereotypes.FLOWPORT;
54

  
55
    @objid ("8729febf-bffe-4672-8251-c9328eea1b77")
56
    public static final String FlowProperty = Prefix + SysMLStereotypes.FLOWPROPERTY;
57

  
58
    @objid ("37fe4b57-ba13-470e-87a6-c0728d36aba3")
59
    public static final String FlowSpecification = Prefix + SysMLStereotypes.FLOWSPECIFICATION;
60

  
61
    @objid ("e13a9104-05f9-4b4f-9f57-739beee8a130")
62
    public static final String ItemFlow = Prefix + SysMLStereotypes.ITEMFLOW;
63

  
64
    @objid ("ae40826d-019b-420f-bc64-6d2696982507")
65
    public static final String Optional = Prefix + SysMLStereotypes.OPTIONAL;
66

  
67
    @objid ("00e192ce-e957-4ee0-bda0-c48eafed9ff9")
68
    public static final String Part = Prefix + "Part";
69

  
70
    @objid ("045b688d-c991-4283-9ba7-f5d019e7d414")
71
    public static final String ParticipantPropertyBindableInstance = Prefix + SysMLStereotypes.PARTICIPANTPROPERTY_BINDABLEINSTANCE;
72

  
73
    @objid ("9a398832-728e-4953-b414-b5b848a36817")
74
    public static final String Probability = Prefix + SysMLStereotypes.PROBABILITY;
75

  
76
    @objid ("30eb172e-2660-4cb7-ba8e-78383f502c47")
77
    public static final String Problem = Prefix + SysMLNoteTypes.MODELELEMENT_PROBLEM;
78

  
79
    @objid ("e810f3d2-f08c-4ffa-8c47-f46ac94d2381")
80
    public static final String QuantityKind = Prefix + SysMLStereotypes.QUANTITYKIND;
81

  
82
    @objid ("4d69f8e2-be3c-48e0-8590-b6b388935ce3")
83
    public static final String RateActivityEdge = Prefix + SysMLStereotypes.RATE_ACTIVITYEDGE;
84

  
85
    @objid ("d7bdc184-4102-4ded-a70f-05aad977972d")
86
    public static final String RateParameter = Prefix + SysMLStereotypes.RATE_PARAMETER;
87

  
88
    @objid ("0bf0779a-f800-42ae-9210-0f5ffe190277")
89
    public static final String Rationale = Prefix + SysMLNoteTypes.MODELELEMENT_RATIONALE;
90

  
91
    @objid ("fb90924f-4036-4281-b95a-47f675222774")
92
    public static final String Trace = Prefix + "Trace";
93

  
94
    @objid ("05d6d836-4e8c-4762-aa56-1bfebcd1bccd")
95
    public static final String Unit = Prefix + SysMLStereotypes.UNIT;
96

  
97
    @objid ("559c1afd-95c8-40d2-a82a-c5c90f96c5e1")
98
    public static final String ValueType = Prefix + SysMLStereotypes.VALUETYPE;
99

  
100
    @objid ("757e1827-55a2-4f9f-913d-21765be94374")
101
    public static final String View = Prefix + SysMLStereotypes.VIEW;
102

  
103
    @objid ("baccee45-5dff-45b2-8b34-596344c46579")
104
    public static final String ViewPoint = Prefix + SysMLStereotypes.VIEWPOINT;
105

  
106
    @objid ("57d6ba2e-9754-4167-a1a5-dfc0d94fdb06")
107
    public static final String UMLAggregation = Prefix + "UMLAggregation";
108

  
109
    @objid ("500443c6-1851-4b6c-9beb-994a658ca95a")
110
    public static final String UMLAssociation = Prefix + "UMLAssociation";
111

  
112
    @objid ("a382cf29-e43e-46f1-b02f-88d13d3372e7")
113
    public static final String UMLAttribute = Prefix + "UMLAttribute";
114

  
115
    @objid ("d31a0524-0f93-483e-9758-9419e2d2b41c")
116
    public static final String UMLComposition = Prefix + "UMLComposition";
117

  
118
    @objid ("794f9bb0-b5b6-45a1-bcb7-52810d783778")
119
    public static final String UMLGeneralization = Prefix + "UMLGeneralization";
120

  
121
    @objid ("a21345e7-7d06-4194-8cf9-be92a7b98be3")
122
    public static final String UMLOperation = Prefix + "UMLOperation";
123

  
124
    @objid ("1cbea33f-4bfb-4104-ac3e-04eaa2edf23c")
125
    public static final String UMLSmartGeneralization = Prefix + "UMLSmartGeneralization";
126

  
127
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/utils/SysMLFactory.java
1
/**
2
 * Java Class : SysMLFactory.java
3
 *
4
 * Description :
5
 *
6
 * Licensed to the Apache Software Foundation (ASF) under one
7
 * or more contributor license agreements.  See the NOTICE file
8
 * distributed with this work for additional information
9
 * regarding copyright ownership.  The ASF licenses this file
10
 * to you under the Apache License, Version 2.0 (the
11
 * "License"); you may not use this file except in compliance
12
 * with the License.  You may obtain a copy of the License at
13
 *
14
 *    http://www.apache.org/licenses/LICENSE-2.0
15
 *
16
 *    Unless required by applicable law or agreed to in writing,
17
 *    software distributed under the License is distributed on an
18
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
 *    KIND, either express or implied.  See the License for the
20
 *    specific language governing permissions and limitations
21
 *    under the License.
22
 *
23
 * @category   Util
24
 * @package    com.modeliosoft.modelio.sysml.utils
25
 * @author     Modelio
26
 * @license    http://www.apache.org/licenses/LICENSE-2.0
27
 * @version    2.0.08
28
 **/
29
package org.modelio.module.sysml.utils;
30

  
31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32
import org.modelio.api.modelio.model.IModelingSession;
33
import org.modelio.api.modelio.model.IUmlModel;
34
import org.modelio.metamodel.diagrams.ActivityDiagram;
35
import org.modelio.metamodel.diagrams.SequenceDiagram;
36
import org.modelio.metamodel.diagrams.StateMachineDiagram;
37
import org.modelio.metamodel.diagrams.StaticDiagram;
38
import org.modelio.metamodel.diagrams.UseCaseDiagram;
39
import org.modelio.metamodel.uml.behavior.activityModel.Activity;
40
import org.modelio.metamodel.uml.behavior.activityModel.ActivityEdge;
41
import org.modelio.metamodel.uml.behavior.activityModel.ActivityNode;
42
import org.modelio.metamodel.uml.behavior.commonBehaviors.BehaviorParameter;
43
import org.modelio.metamodel.uml.behavior.interactionModel.Interaction;
44
import org.modelio.metamodel.uml.behavior.stateMachineModel.StateMachine;
45
import org.modelio.metamodel.uml.behavior.usecaseModel.Actor;
46
import org.modelio.metamodel.uml.behavior.usecaseModel.UseCase;
47
import org.modelio.metamodel.uml.informationFlow.InformationFlow;
48
import org.modelio.metamodel.uml.infrastructure.Dependency;
49
import org.modelio.metamodel.uml.infrastructure.ModelElement;
50
import org.modelio.metamodel.uml.infrastructure.Stereotype;
51
import org.modelio.metamodel.uml.infrastructure.TaggedValue;
52
import org.modelio.metamodel.uml.infrastructure.UmlModelElement;
53
import org.modelio.metamodel.uml.statik.AssociationEnd;
54
import org.modelio.metamodel.uml.statik.Attribute;
55
import org.modelio.metamodel.uml.statik.BindableInstance;
56
import org.modelio.metamodel.uml.statik.Class;
57
import org.modelio.metamodel.uml.statik.Classifier;
58
import org.modelio.metamodel.uml.statik.Collaboration;
59
import org.modelio.metamodel.uml.statik.Connector;
60
import org.modelio.metamodel.uml.statik.ConnectorEnd;
61
import org.modelio.metamodel.uml.statik.DataType;
62
import org.modelio.metamodel.uml.statik.Enumeration;
63
import org.modelio.metamodel.uml.statik.EnumerationLiteral;
64
import org.modelio.metamodel.uml.statik.Instance;
65
import org.modelio.metamodel.uml.statik.Interface;
66
import org.modelio.metamodel.uml.statik.Link;
67
import org.modelio.metamodel.uml.statik.LinkEnd;
68
import org.modelio.metamodel.uml.statik.NameSpace;
69
import org.modelio.metamodel.uml.statik.Operation;
70
import org.modelio.metamodel.uml.statik.Package;
71
import org.modelio.metamodel.uml.statik.Parameter;
72
import org.modelio.metamodel.uml.statik.Port;
73
import org.modelio.metamodel.uml.statik.PortOrientation;
74
import org.modelio.module.sysml.api.ISysMLPeerModule;
75
import org.modelio.module.sysml.api.SysMLStereotypes;
76
import org.modelio.module.sysml.api.SysMLTagTypes;
77
import org.modelio.module.sysml.i18n.I18nMessageService;
78
import org.modelio.module.sysml.impl.SysMLModule;
79
import org.modelio.vcore.smkernel.mapi.MMetamodel;
80
import org.modelio.vcore.smkernel.mapi.MObject;
81

  
82
/**
83
 * This class handles the creation of all SysML elements
84
 * @author ebrosse
85
 */
86
@objid ("73af9047-e4a9-4c9c-b9d1-b8936d54f79c")
87
public class SysMLFactory {
88
    /**
89
     * Method createAllocateDependency
90
     * @author ebrosse
91
     * @param origin : the origin of the dependency
92
     * @param target : the target of the dependency
93
     * @return the allocate dependency
94
     */
95
    @objid ("94cf556b-d566-4bf7-9561-9119eb084d44")
96
    public static Dependency createAllocateAbstraction(ModelElement origin, ModelElement target) {
97
        try {
98
            IModelingSession session  =  SysMLModule.getInstance().getModuleContext().getModelingSession();
99
            MMetamodel metamodel = SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel();
100
        
101
            Dependency allocation = session.getModel().createDependency();
102
            allocation.setImpacted(origin);
103
            allocation.setDependsOn(target);
104
            allocation.setName("");
105
            Stereotype allocateStereotype = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.ALLOCATE, metamodel.getMClass(Dependency.class));
106
            allocation.getExtension().add(allocateStereotype);
107
        
108
            return  allocation;
109
        }catch(Exception e){
110
            SysMLModule.logService.error(e);
111
        }
112
        return null;
113
    }
114

  
115
    /**
116
     * Method createBlock
117
     * @author ebrosse
118
     * @param owner @return
119
     */
120
    @objid ("222fabd0-fe7e-47a5-9642-bc2f075726e4")
121
    public static Class createBlock(MObject owner) {
122
        if (owner instanceof Package){
123
            return createBlock((Package) owner);
124
        }else if (owner instanceof Class){
125
            return createBlock((Class) owner);
126
        }
127
        return null;
128
    }
129

  
130
    /**
131
     * Method createBlock
132
     * @author ebrosse
133
     * @param owner @return
134
     */
135
    @objid ("77d4b068-aa1b-4307-8aca-f256208b4a75")
136
    private static Class createBlock(Package owner) {
137
        try {
138
            Class result = SysMLModule.getInstance().getModuleContext().getModelingSession().getModel().createClass ("", owner, ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK);
139
            Utils.setUMLFreeName(result,  SysMLStereotypes.BLOCK);
140
            return result;
141
        } catch (Exception e){
142
            SysMLModule.logService.error(e);
143
        }
144
        return null;
145
    }
146

  
147
    /**
148
     * Method createBlock
149
     * @author ebrosse
150
     * @param owner @return
151
     */
152
    @objid ("e1247f5d-3bd9-4d10-ae03-f24089272111")
153
    private static Class createBlock(Class owner) {
154
        try {
155
            Class result = SysMLModule.getInstance().getModuleContext().getModelingSession ().getModel ().createClass ("", owner, ISysMLPeerModule.MODULE_NAME,SysMLStereotypes.BLOCK);
156
            Utils.setUMLFreeName(result,  SysMLStereotypes.BLOCK);
157
            return result;
158
        } catch (Exception e){
159
            SysMLModule.logService.error(e);
160
        }
161
        return null;
162
    }
163

  
164
    /**
165
     * Method createSequenceDiagram
166
     * @author ebrosse
167
     * @param owner @return
168
     */
169
    @objid ("a68fe0c3-48d8-4767-b5f7-071117e410f4")
170
    public static SequenceDiagram createSysMLSequenceDiagram(ModelElement owner, String diagramName, String description) {
171
        Interaction interaction = null;
172
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
173
        
174
        if (owner instanceof Interaction){
175
            interaction = (Interaction) owner;
176
        }else{
177
            interaction = session.getModel().createInteraction();
178
            if (owner instanceof  Operation)
179
                interaction.setOwnerOperation((Operation) owner);
180
            else   if (owner instanceof  NameSpace)
181
                interaction.setOwner((NameSpace) owner);
182
            
183
            Utils.setUMLFreeName(interaction,I18nMessageService.getString("Ui.Create.Interaction.Name"));
184
        }
185
        
186
        boolean notFound = true;
187
        for (Collaboration colla : interaction.getOwnedCollaboration()){
188
            if (colla.getName().equals("locals")){
189
                notFound = false;
190
                break;
191
            }
192
        
193
        }
194
        
195
        if (notFound){
196
            Collaboration locals = session.getModel().createCollaboration();
197
            locals.setName("locals");
198
            interaction.getOwnedCollaboration().add(locals);
199
        }
200
        
201
        SequenceDiagram diagram = session.getModel().createSequenceDiagram();
202
        diagram.setOrigin(interaction);
203
        Utils.setUMLFreeName(diagram, diagramName);
204
        
205
        try {
206
            Stereotype sysSeqSter = session.getMetamodelExtensions ().getStereotype (ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSEQUENCEDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(SequenceDiagram.class));
207
            diagram.getExtension().add(sysSeqSter);
208
            session.getModel().createNote("ModelerModule","description", diagram, description);
209
        } catch (Exception e) {
210
            SysMLModule.logService.error(e);
211
        }
212
        
213
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
214
        return diagram;
215
    }
216

  
217
    /**
218
     * Method createSequenceDiagram
219
     * @author ebrosse
220
     * @param owner @return
221
     */
222
    @objid ("b027315d-c329-40b5-b6b4-196f9cd45c74")
223
    public static SequenceDiagram createSysMLSequenceDiagram(ModelElement owner, String diagramName) {
224
        Interaction interaction = null;
225
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
226
        if (owner instanceof Interaction){
227
            interaction = (Interaction) owner;
228
        }else{
229
            interaction = session.getModel().createInteraction();
230
            if (owner instanceof  Operation)
231
                interaction.setOwnerOperation((Operation) owner);
232
            else   if (owner instanceof  NameSpace)
233
                interaction.setOwner((NameSpace) owner);
234
            Utils.setUMLFreeName(interaction,
235
                    I18nMessageService.getString("Ui.Create.Interaction.Name"));
236
        }
237
        
238
        boolean notFound = true;
239
        for (Collaboration colla : interaction.getOwnedCollaboration()){
240
            if (colla.getName().equals("locals")){
241
                notFound = false;
242
                break;
243
            }
244
        
245
        }
246
        
247
        if (notFound){
248
            Collaboration locals = session.getModel().createCollaboration();
249
            locals.setName("locals");
250
            interaction.getOwnedCollaboration().add(locals);
251
        }
252
        
253
        SequenceDiagram diagram = session.getModel().createSequenceDiagram();
254
        diagram.setOrigin(interaction);
255
        Utils.setUMLFreeName(diagram, diagramName);
256
        
257
        try {
258
            Stereotype sysSeqSter = session.getMetamodelExtensions ().getStereotype (ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSEQUENCEDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(SequenceDiagram.class));
259
            diagram.getExtension().add(sysSeqSter);
260
        } catch (Exception e) {
261
            SysMLModule.logService.error(e);
262
        }
263
        
264
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
265
        return diagram;
266
    }
267

  
268
    /**
269
     * Method createStateMachineDiagram
270
     * @author ebrosse
271
     * @param owner @return
272
     */
273
    @objid ("13db3c1e-e7a4-43b5-a626-769494c808b8")
274
    public static StateMachineDiagram createSysMLStateMachineDiagram(ModelElement owner, String diagramName, String description) {
275
        StateMachine statemachine = null;
276
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
277
        
278
        if (owner instanceof StateMachine){
279
            statemachine = (StateMachine) owner;
280
        }else{
281
            statemachine = session.getModel().createStateMachine();
282
            if (owner instanceof  Operation)
283
                statemachine.setOwnerOperation((Operation) owner);
284
            else   if (owner instanceof  NameSpace)
285
                statemachine.setOwner((NameSpace) owner);
286
            Utils.setUMLFreeName(statemachine,
287
                    I18nMessageService.getString("Ui.Create.StateMachine.Name"));
288
        }
289
        
290
        boolean notFound = true;
291
        for (Collaboration colla : statemachine.getOwnedCollaboration()){
292
            if (colla.getName().equals("locals")){
293
                notFound = false;
294
                break;
295
            }
296
        }
297
        
298
        if (notFound){
299
            Collaboration locals = session.getModel().createCollaboration();
300
            locals.setName("locals");
301
            statemachine.getOwnedCollaboration().add(locals);
302
        }
303
        
304
        StateMachineDiagram diagram = null;
305
        try{
306
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSTATEMACHINEDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(StateMachineDiagram.class));
307
            diagram = session.getModel().createStateMachineDiagram(statemachine.getName(), statemachine,ster);
308
            diagram.setOrigin(statemachine);
309
            Utils.setUMLFreeName(diagram, diagramName);
310
            session.getModel().createNote("ModelerModule","description", diagram, description);
311
        } catch (Exception e) {
312
            SysMLModule.logService.error(e);
313
        }
314
        
315
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
316
        return diagram;
317
    }
318

  
319
    /**
320
     * Method createStateMachineDiagram
321
     * @author ebrosse
322
     * @param owner @return
323
     */
324
    @objid ("06682b35-ac55-4c42-9bd5-8042ee31f799")
325
    public static StateMachineDiagram createSysMLStateMachineDiagram(ModelElement owner, String diagramName) {
326
        StateMachine statemachine = null;
327
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
328
        if (owner instanceof StateMachine){
329
            statemachine = (StateMachine) owner;
330
        
331
        }else{
332
            statemachine = session.getModel().createStateMachine();
333
            if (owner instanceof  Operation)
334
                statemachine.setOwnerOperation((Operation) owner);
335
            else   if (owner instanceof  NameSpace)
336
                statemachine.setOwner((NameSpace) owner);
337
            Utils.setUMLFreeName(statemachine,
338
                    I18nMessageService.getString("Ui.Create.StateMachine.Name"));
339
        }
340
        
341
        boolean notFound = true;
342
        for (Collaboration colla : statemachine.getOwnedCollaboration()){
343
            if (colla.getName().equals("locals")){
344
                notFound = false;
345
                break;
346
            }
347
        }
348
        
349
        if (notFound){
350
            Collaboration locals = session.getModel().createCollaboration();
351
            locals.setName("locals");
352
            statemachine.getOwnedCollaboration().add(locals);
353
        }
354
        
355
        StateMachineDiagram diagram = null;
356
        try{
357
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSTATEMACHINEDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(StateMachineDiagram.class));
358
            diagram = session.getModel().createStateMachineDiagram(statemachine.getName(), statemachine,ster);
359
            diagram.setOrigin(statemachine);
360
            Utils.setUMLFreeName(diagram, diagramName);
361
        
362
        } catch (Exception e) {
363
            SysMLModule.logService.error(e);
364
        }
365
        
366
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
367
        return diagram;
368
    }
369

  
370
    /**
371
     * Method createSysMLActivityDiagram
372
     * @author ebrosse
373
     * @param owner @return
374
     */
375
    @objid ("ca8163f8-8da5-405e-9484-3766ac818bb3")
376
    public static ActivityDiagram createSysMLActivityDiagram(ModelElement owner, String diagName, String description) {
377
        Activity activity = null;
378
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
379
        if (owner instanceof Activity){
380
            activity = (Activity) owner;
381
        }else{
382
            activity = session.getModel().createActivity();
383
            if (owner instanceof  Operation)
384
                activity.setOwnerOperation((Operation) owner);
385
            else   if (owner instanceof  NameSpace)
386
                activity.setOwner((NameSpace) owner);
387
            Utils.setUMLFreeName(activity,
388
                    I18nMessageService.getString("Ui.Create.Activity.Name"));
389
        }
390
        
391
        boolean notFound = true;
392
        for (Collaboration colla : activity.getOwnedCollaboration()){
393
            if (colla.getName().equals("locals")){
394
                notFound = false;
395
                break;
396
            }
397
        
398
        }
399
        
400
        if (notFound){
401
            Collaboration locals = session.getModel().createCollaboration();
402
            locals.setName("locals");
403
            activity.getOwnedCollaboration().add(locals);
404
        }
405
        
406
        ActivityDiagram diagram = session.getModel().createActivityDiagram(diagName, activity);
407
        Utils.setUMLFreeName(diagram, diagName);
408
        
409
        try {
410
            Stereotype sysActDiag = session.getMetamodelExtensions ().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLACTIVITYDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(ActivityDiagram.class));
411
            diagram.getExtension().add(sysActDiag);
412
            session.getModel().createNote("ModelerModule","description", diagram, description);
413
        } catch (Exception e) {
414
            SysMLModule.logService.error(e);
415
        }
416
        
417
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
418
        return diagram;
419
    }
420

  
421
    /**
422
     * Method createSysMLActivityDiagram
423
     * @author ebrosse
424
     * @param owner @return
425
     */
426
    @objid ("56308980-2fe4-4a86-b644-e4f8ff0ef34f")
427
    public static ActivityDiagram createSysMLActivityDiagram(ModelElement owner, String diagName) {
428
        Activity activity = null;
429
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
430
        if (owner instanceof Activity){
431
            activity = (Activity) owner;
432
        }else{
433
            activity = session.getModel().createActivity();
434
            if (owner instanceof  Operation)
435
                activity.setOwnerOperation((Operation) owner);
436
            else   if (owner instanceof  NameSpace)
437
                activity.setOwner((NameSpace) owner);
438
            Utils.setUMLFreeName(activity,
439
                    I18nMessageService.getString("Ui.Create.Activity.Name"));
440
        }
441
        
442
        boolean notFound = true;
443
        for (Collaboration colla : activity.getOwnedCollaboration()){
444
            if (colla.getName().equals("locals")){
445
                notFound = false;
446
                break;
447
            }
448
        
449
        }
450
        
451
        if (notFound){
452
            Collaboration locals = session.getModel().createCollaboration();
453
            locals.setName("locals");
454
            activity.getOwnedCollaboration().add(locals);
455
        }
456
        
457
        ActivityDiagram diagram = session.getModel().createActivityDiagram(diagName, activity);
458
        Utils.setUMLFreeName(diagram, diagName);
459
        
460
        try {
461
            Stereotype sysActDiag = session.getMetamodelExtensions ().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLACTIVITYDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(ActivityDiagram.class));
462
            diagram.getExtension().add(sysActDiag);
463
        } catch (Exception e) {
464
            SysMLModule.logService.error(e);
465
        }
466
        
467
        SysMLModule.getInstance().getModuleContext().getModelioServices().getEditionService().openEditor(diagram);
468
        return diagram;
469
    }
470

  
471
    /**
472
     * Method createUseCaseDiagram
473
     * @author ebrosse
474
     * @param owner @return
475
     */
476
    @objid ("c3dd17ad-7c3c-418d-9f18-7c6915a6ce2e")
477
    public static StaticDiagram createSysMLUseCaseDiagram(ModelElement owner, String name, String description) {
478
        IModelingSession session = SysMLModule.getInstance().getModuleContext().getModelingSession();
479
        StaticDiagram diagram = null;
480
        try {
481
            Stereotype ster = session.getMetamodelExtensions ().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLUSECASEDIAGRAM, SysMLModule.getInstance().getModuleContext().getModelioServices().getMetamodelService().getMetamodel().getMClass(UseCaseDiagram.class));
482
            diagram = session.getModel ().createUseCaseDiagram(name, owner, ster);
483
            Utils.setUMLFreeName(diagram, name);
484
            session.getModel().createNote("ModelerModule","description", diagram, description);
485
        } catch (Exception e) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff