Revision 538

View differences:

branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/BlockDiagramWizard.java
35 35
import org.modelio.api.modelio.diagram.IDiagramService;
36 36
import org.modelio.api.modelio.diagram.dg.IDiagramDG;
37 37
import org.modelio.api.modelio.diagram.style.IStyleHandle;
38
import org.modelio.api.modelio.model.IMetamodelExtensions;
38 39
import org.modelio.api.modelio.model.IModelingSession;
39 40
import org.modelio.api.modelio.model.ITransaction;
40 41
import org.modelio.api.modelio.model.IUmlModel;
......
48 49
import org.modelio.metamodel.uml.infrastructure.ModelElement;
49 50
import org.modelio.metamodel.uml.infrastructure.Profile;
50 51
import org.modelio.metamodel.uml.infrastructure.Stereotype;
51
import org.modelio.metamodel.uml.statik.Class;
52 52
import org.modelio.metamodel.uml.statik.Package;
53 53
import org.modelio.module.sysml.api.ISysMLPeerModule;
54 54
import org.modelio.module.sysml.api.SysMLStereotypes;
55
import org.modelio.module.sysml.filters.BlockFilter;
56 55
import org.modelio.module.sysml.i18n.I18nMessageService;
57 56
import org.modelio.module.sysml.impl.SysMLModule;
58 57
import org.modelio.module.sysml.utils.SysMLResourcesManager;
59 58
import org.modelio.module.sysml.utils.Utils;
60 59
import org.modelio.vcore.smkernel.mapi.MClass;
60
import org.modelio.vcore.smkernel.mapi.MMetamodel;
61 61
import org.modelio.vcore.smkernel.mapi.MObject;
62 62

  
63 63
/**
......
72 72
        IModuleContext moduleContext = SysMLModule.getInstance().getModuleContext();
73 73
        IModelingSession session = moduleContext.getModelingSession();
74 74
        StaticDiagram diagram = null;
75
        String name = I18nMessageService.getString ("Ui.Command.BlockDiagramExplorerCommand.Label");
75 76
        
76 77
        try( ITransaction transaction = session.createTransaction(I18nMessageService.getString ("Info.Session.Create", "Block Diagram"))){
77 78
            
......
79 80
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.BLOCKDIAGRAM, mclass);
80 81
            
81 82
            IUmlModel model = session.getModel();
82
            diagram = model.createStaticDiagram(diagramName, element, ster);
83
            Utils.setUMLFreeName(diagram, diagramName);
83
            diagram = model.createStaticDiagram(name, element, ster);
84
            Utils.setUMLFreeName(diagram, name);
84 85
            model.createNote("ModelerModule","description", diagram, description);
85 86
        
86 87
            if (diagram != null) {
......
142 143
    @objid ("40b19a4a-db61-4181-a27c-69bd40993845")
143 144
    @Override
144 145
    public boolean accept(MObject selectedElt) {
145
        return ((selectedElt != null) &&
146
                                                                                        (((selectedElt instanceof Package) 
147
                                                                                                && !(selectedElt instanceof Profile)
148
                                                                                                && ((selectedElt instanceof Class)
149
                                                                                                        && (BlockFilter.isABlock(selectedElt))))
150
                                                                                                && selectedElt.getStatus().isModifiable()));
146
        return  ((selectedElt != null) 
147
                && (selectedElt.getStatus().isModifiable())
148
                &&  (((selectedElt instanceof Package) 
149
                        && !(selectedElt instanceof Profile))));
151 150
    }
152 151

  
153 152
    @objid ("cdb3424a-2871-4d9b-98e6-5e9b8a6b90aa")
154 153
    @Override
155 154
    public ElementDescriptor getCreatedElementType() {
156
        return null;
155
        IModuleContext moduleContext = getModule().getModuleContext();
156
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
157
        MClass mClass = metamodel.getMClass(StaticDiagram.class);
158
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
159
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.BLOCKDIAGRAM, mClass);
160
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
157 161
    }
158 162

  
159 163
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/PackageDiagramWizard.java
35 35
import org.modelio.api.modelio.diagram.IDiagramService;
36 36
import org.modelio.api.modelio.diagram.dg.IDiagramDG;
37 37
import org.modelio.api.modelio.diagram.style.IStyleHandle;
38
import org.modelio.api.modelio.model.IMetamodelExtensions;
38 39
import org.modelio.api.modelio.model.IModelingSession;
39 40
import org.modelio.api.modelio.model.ITransaction;
40 41
import org.modelio.api.module.context.IModuleContext;
......
54 55
import org.modelio.module.sysml.utils.SysMLResourcesManager;
55 56
import org.modelio.module.sysml.utils.Utils;
56 57
import org.modelio.vcore.smkernel.mapi.MClass;
58
import org.modelio.vcore.smkernel.mapi.MMetamodel;
57 59
import org.modelio.vcore.smkernel.mapi.MObject;
58 60

  
59 61
/**
......
68 70
    public AbstractDiagram actionPerformed(ModelElement element, String diagramName, String description) {
69 71
        IModuleContext moduleContext = SysMLModule.getInstance().getModuleContext();
70 72
        IModelingSession session = moduleContext.getModelingSession();       
73
        String name = I18nMessageService.getString("Ui.Command.PackageDiagramExplorerCommand.Label");
71 74
        StaticDiagram diagram = null;
72 75
        
73 76
        try (ITransaction transaction = session.createTransaction(I18nMessageService.getString("Info.Session.Create", "Package Diagram"))) {
74 77
        
75
            MClass mclass = moduleContext.getModelioServices().getMetamodelService().getMetamodel().getMClass(StaticDiagram.class);
78
            MClass mclass = moduleContext.getModelioServices().getMetamodelService().getMetamodel().getMClass(AbstractDiagram.class);
76 79
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.PACKAGEDIAGRAM, mclass);
77
            diagram = session.getModel ().createStaticDiagram(diagramName, element, ster);
78
            Utils.setUMLFreeName(diagram, diagramName);
80
            diagram = session.getModel ().createStaticDiagram(name, element, ster);
81
            Utils.setUMLFreeName(diagram, name);
79 82
            session.getModel().createNote("ModelerModule","description", diagram, description);
80 83
        
81 84
            if (diagram != null) {
......
137 140
    @objid ("a4d2fcc2-edfa-4a5b-855e-d8c822bff9b4")
138 141
    @Override
139 142
    public boolean accept(MObject element) {
140
        return ((element != null) && (element instanceof Package));
143
        return ((element != null) 
144
                && (element instanceof Package)
145
                && element.getStatus().isModifiable());
141 146
    }
142 147

  
143 148
    @objid ("e6502326-ba19-4bef-9b7d-52e183353190")
144 149
    @Override
145 150
    public ElementDescriptor getCreatedElementType() {
146
        return null;
151
        IModuleContext moduleContext = getModule().getModuleContext();
152
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
153
        MClass mClass = metamodel.getMClass(StaticDiagram.class);
154
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
155
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.PACKAGEDIAGRAM, mClass);
156
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
147 157
    }
148 158

  
149 159
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/SysMLStateMachineDiagramWizard.java
31 31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32 32
import org.eclipse.swt.graphics.Image;
33 33
import org.eclipse.swt.widgets.Display;
34
import org.modelio.api.modelio.model.IMetamodelExtensions;
34 35
import org.modelio.api.modelio.model.IModelingSession;
35 36
import org.modelio.api.modelio.model.ITransaction;
37
import org.modelio.api.module.context.IModuleContext;
36 38
import org.modelio.api.module.contributor.AbstractWizardContributor;
37 39
import org.modelio.api.module.contributor.ElementDescriptor;
38 40
import org.modelio.api.module.contributor.diagramcreation.IDiagramWizardContributor;
39 41
import org.modelio.metamodel.diagrams.AbstractDiagram;
42
import org.modelio.metamodel.diagrams.StateMachineDiagram;
40 43
import org.modelio.metamodel.uml.behavior.stateMachineModel.StateMachine;
41 44
import org.modelio.metamodel.uml.behavior.usecaseModel.Actor;
42 45
import org.modelio.metamodel.uml.behavior.usecaseModel.UseCase;
43 46
import org.modelio.metamodel.uml.infrastructure.ModelElement;
44 47
import org.modelio.metamodel.uml.infrastructure.Profile;
48
import org.modelio.metamodel.uml.infrastructure.Stereotype;
45 49
import org.modelio.metamodel.uml.statik.Class;
46 50
import org.modelio.metamodel.uml.statik.Collaboration;
47 51
import org.modelio.metamodel.uml.statik.Component;
......
49 53
import org.modelio.metamodel.uml.statik.Node;
50 54
import org.modelio.metamodel.uml.statik.Operation;
51 55
import org.modelio.metamodel.uml.statik.Package;
56
import org.modelio.module.sysml.api.ISysMLPeerModule;
57
import org.modelio.module.sysml.api.SysMLStereotypes;
52 58
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
53 59
import org.modelio.module.sysml.i18n.I18nMessageService;
54 60
import org.modelio.module.sysml.impl.SysMLModule;
55 61
import org.modelio.module.sysml.utils.SysMLFactory;
56 62
import org.modelio.module.sysml.utils.SysMLResourcesManager;
63
import org.modelio.vcore.smkernel.mapi.MClass;
64
import org.modelio.vcore.smkernel.mapi.MMetamodel;
57 65
import org.modelio.vcore.smkernel.mapi.MObject;
58 66

  
59 67
/**
......
118 126
                                                                                && selectedElt.getStatus().isModifiable() 
119 127
                                                                                && ((selectedElt instanceof Package)
120 128
                                                                                        && !(selectedElt instanceof Profile) 
121
                                                                                        || (selectedElt instanceof Class) 
129
                        || ((selectedElt instanceof Class) 
130
                                && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt)))
122 131
                                                                                        || (selectedElt instanceof Interface)
123 132
                                                                                        || (selectedElt instanceof Actor) 
124 133
                                                                                        || (selectedElt instanceof Component) 
......
127 136
                                                                                        || (selectedElt instanceof Collaboration) 
128 137
                                                                                        || (selectedElt instanceof Package)
129 138
                                                                                        || (selectedElt instanceof Operation) 
130
                                                                                        || (selectedElt instanceof StateMachine)
131
                                                                                        && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt))));
139
                        || (selectedElt instanceof StateMachine)));
132 140
    }
133 141

  
134 142
    @objid ("84b1a44f-9f28-4728-a0df-00085a317080")
135 143
    @Override
136 144
    public ElementDescriptor getCreatedElementType() {
137
        return null;
145
        IModuleContext moduleContext = getModule().getModuleContext();
146
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
147
        MClass mClass = metamodel.getMClass(StateMachineDiagram.class);
148
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
149
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSTATEMACHINEDIAGRAM, mClass);
150
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
138 151
    }
139 152

  
140 153
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/SysMLSequenceDiagramWizard.java
31 31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32 32
import org.eclipse.swt.graphics.Image;
33 33
import org.eclipse.swt.widgets.Display;
34
import org.modelio.api.modelio.model.IMetamodelExtensions;
34 35
import org.modelio.api.modelio.model.IModelingSession;
35 36
import org.modelio.api.modelio.model.ITransaction;
37
import org.modelio.api.module.context.IModuleContext;
36 38
import org.modelio.api.module.contributor.AbstractWizardContributor;
37 39
import org.modelio.api.module.contributor.ElementDescriptor;
38 40
import org.modelio.api.module.contributor.diagramcreation.IDiagramWizardContributor;
39 41
import org.modelio.metamodel.diagrams.AbstractDiagram;
42
import org.modelio.metamodel.diagrams.SequenceDiagram;
40 43
import org.modelio.metamodel.uml.behavior.interactionModel.Interaction;
41 44
import org.modelio.metamodel.uml.behavior.usecaseModel.Actor;
42 45
import org.modelio.metamodel.uml.behavior.usecaseModel.UseCase;
43 46
import org.modelio.metamodel.uml.infrastructure.ModelElement;
44 47
import org.modelio.metamodel.uml.infrastructure.Profile;
48
import org.modelio.metamodel.uml.infrastructure.Stereotype;
45 49
import org.modelio.metamodel.uml.statik.Class;
46 50
import org.modelio.metamodel.uml.statik.Collaboration;
47 51
import org.modelio.metamodel.uml.statik.Component;
......
49 53
import org.modelio.metamodel.uml.statik.Node;
50 54
import org.modelio.metamodel.uml.statik.Operation;
51 55
import org.modelio.metamodel.uml.statik.Package;
56
import org.modelio.module.sysml.api.ISysMLPeerModule;
57
import org.modelio.module.sysml.api.SysMLStereotypes;
52 58
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
53 59
import org.modelio.module.sysml.i18n.I18nMessageService;
54 60
import org.modelio.module.sysml.impl.SysMLModule;
55 61
import org.modelio.module.sysml.utils.SysMLFactory;
56 62
import org.modelio.module.sysml.utils.SysMLResourcesManager;
63
import org.modelio.vcore.smkernel.mapi.MClass;
64
import org.modelio.vcore.smkernel.mapi.MMetamodel;
57 65
import org.modelio.vcore.smkernel.mapi.MObject;
58 66

  
59 67
/**
......
118 126
                                                                                && selectedElt.getStatus().isModifiable() 
119 127
                                                                                && ((selectedElt instanceof Package)
120 128
                                                                                        && !(selectedElt instanceof Profile) 
121
                                                                                        && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt))
122
                                                                                        || (selectedElt instanceof Class) 
129
                        || ((selectedElt instanceof Class) 
130
                                && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt)))
123 131
                                                                                        || (selectedElt instanceof Interface)
124 132
                                                                                        || (selectedElt instanceof Actor) 
125 133
                                                                                        || (selectedElt instanceof Component) 
......
134 142
    @objid ("3eb838f7-c2a4-46b7-821e-8861a3c51807")
135 143
    @Override
136 144
    public ElementDescriptor getCreatedElementType() {
137
        return null;
145
        IModuleContext moduleContext = getModule().getModuleContext();
146
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
147
        MClass mClass = metamodel.getMClass(SequenceDiagram.class);
148
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
149
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLSEQUENCEDIAGRAM, mClass);
150
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
138 151
    }
139 152

  
140 153
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/SysMLUseCaseDiagramWizard.java
31 31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32 32
import org.eclipse.swt.graphics.Image;
33 33
import org.eclipse.swt.widgets.Display;
34
import org.modelio.api.modelio.model.IMetamodelExtensions;
34 35
import org.modelio.api.modelio.model.IModelingSession;
35 36
import org.modelio.api.modelio.model.ITransaction;
37
import org.modelio.api.module.context.IModuleContext;
36 38
import org.modelio.api.module.contributor.AbstractWizardContributor;
37 39
import org.modelio.api.module.contributor.ElementDescriptor;
38 40
import org.modelio.api.module.contributor.diagramcreation.IDiagramWizardContributor;
39 41
import org.modelio.metamodel.diagrams.AbstractDiagram;
42
import org.modelio.metamodel.diagrams.UseCaseDiagram;
40 43
import org.modelio.metamodel.uml.behavior.usecaseModel.UseCase;
41 44
import org.modelio.metamodel.uml.infrastructure.ModelElement;
42 45
import org.modelio.metamodel.uml.infrastructure.Profile;
43
import org.modelio.metamodel.uml.statik.Class;
44
import org.modelio.metamodel.uml.statik.Component;
45
import org.modelio.metamodel.uml.statik.Interface;
46
import org.modelio.metamodel.uml.infrastructure.Stereotype;
46 47
import org.modelio.metamodel.uml.statik.Package;
47
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
48
import org.modelio.module.sysml.api.ISysMLPeerModule;
49
import org.modelio.module.sysml.api.SysMLStereotypes;
48 50
import org.modelio.module.sysml.i18n.I18nMessageService;
49 51
import org.modelio.module.sysml.impl.SysMLModule;
50 52
import org.modelio.module.sysml.utils.SysMLFactory;
51 53
import org.modelio.module.sysml.utils.SysMLResourcesManager;
54
import org.modelio.vcore.smkernel.mapi.MClass;
55
import org.modelio.vcore.smkernel.mapi.MMetamodel;
52 56
import org.modelio.vcore.smkernel.mapi.MObject;
53 57

  
54 58
/**
......
113 117
                                                                                && (selectedElt.getStatus().isModifiable()) 
114 118
                                                                                && ((selectedElt instanceof Package)
115 119
                                                                                        && !(selectedElt instanceof Profile) 
116
                                                                                        || (selectedElt instanceof Class) 
117
                                                                                        || (selectedElt instanceof Interface)
118
                                                                                        || (selectedElt instanceof Component) 
119
                                                                                        || (selectedElt instanceof UseCase)
120
                                                                                        && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt))));
120
                        || (selectedElt instanceof UseCase)));
121 121
    }
122 122

  
123 123
    @objid ("d640aeff-a9cb-467a-ae71-d7885d1ab019")
124 124
    @Override
125 125
    public ElementDescriptor getCreatedElementType() {
126
        return null;
126
        IModuleContext moduleContext = getModule().getModuleContext();
127
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
128
        MClass mClass = metamodel.getMClass(UseCaseDiagram.class);
129
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
130
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLUSECASEDIAGRAM, mClass);
131
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
127 132
    }
128 133

  
129 134
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/SysMLDiagramWizardContributor.java
34 34
    @objid ("3ec69b25-5baa-4acb-b990-76bbb2dccb1b")
35 35
    private IModule module;
36 36

  
37
    @objid ("acb4a1bc-8e05-44c6-ab2c-9d28bf3c8ff6")
37
    @objid ("46060389-8f8b-4f83-b66e-70773876f531")
38 38
    private Image icon;
39 39

  
40
    @objid ("32a16106-2e45-42b0-9a40-6d8ba67ce491")
40
    @objid ("356a648f-2c72-4006-beb7-84bee1b9e74c")
41 41
    private List<ElementScope> scopes = new ArrayList<>();
42 42

  
43 43
    @objid ("55f251e3-0f74-4593-9d8b-82b4aea3d75b")
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/SysMLActivityDiagramWizard.java
31 31
import com.modeliosoft.modelio.javadesigner.annotations.objid;
32 32
import org.eclipse.swt.graphics.Image;
33 33
import org.eclipse.swt.widgets.Display;
34
import org.modelio.api.modelio.model.IMetamodelExtensions;
34 35
import org.modelio.api.modelio.model.IModelingSession;
35 36
import org.modelio.api.modelio.model.ITransaction;
37
import org.modelio.api.module.context.IModuleContext;
36 38
import org.modelio.api.module.contributor.AbstractWizardContributor;
37 39
import org.modelio.api.module.contributor.ElementDescriptor;
38 40
import org.modelio.api.module.contributor.diagramcreation.IDiagramWizardContributor;
39 41
import org.modelio.metamodel.diagrams.AbstractDiagram;
42
import org.modelio.metamodel.diagrams.ActivityDiagram;
40 43
import org.modelio.metamodel.uml.behavior.activityModel.Activity;
41 44
import org.modelio.metamodel.uml.behavior.commonBehaviors.Signal;
42 45
import org.modelio.metamodel.uml.behavior.usecaseModel.Actor;
43 46
import org.modelio.metamodel.uml.behavior.usecaseModel.UseCase;
44 47
import org.modelio.metamodel.uml.infrastructure.ModelElement;
45 48
import org.modelio.metamodel.uml.infrastructure.Profile;
49
import org.modelio.metamodel.uml.infrastructure.Stereotype;
46 50
import org.modelio.metamodel.uml.statik.Class;
47 51
import org.modelio.metamodel.uml.statik.Collaboration;
48 52
import org.modelio.metamodel.uml.statik.Component;
......
50 54
import org.modelio.metamodel.uml.statik.Node;
51 55
import org.modelio.metamodel.uml.statik.Operation;
52 56
import org.modelio.metamodel.uml.statik.Package;
57
import org.modelio.module.sysml.api.ISysMLPeerModule;
58
import org.modelio.module.sysml.api.SysMLStereotypes;
53 59
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
54 60
import org.modelio.module.sysml.i18n.I18nMessageService;
55 61
import org.modelio.module.sysml.impl.SysMLModule;
56 62
import org.modelio.module.sysml.utils.SysMLFactory;
57 63
import org.modelio.module.sysml.utils.SysMLResourcesManager;
64
import org.modelio.vcore.smkernel.mapi.MClass;
65
import org.modelio.vcore.smkernel.mapi.MMetamodel;
58 66
import org.modelio.vcore.smkernel.mapi.MObject;
59 67

  
60 68
/**
......
116 124
    public boolean accept(MObject selectedElt) {
117 125
        return  ((selectedElt != null) 
118 126
                                                                                && (selectedElt.getStatus().isModifiable())
119
                                                                                &&  ((selectedElt instanceof Package) 
120
                                                                                        && !(selectedElt instanceof Profile)
121
                                                                                        && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt))
122
                                                                                        || (selectedElt instanceof Class)
127
                &&  (((selectedElt instanceof Package) 
128
                        && !(selectedElt instanceof Profile))
129
                        || ((selectedElt instanceof Class) 
130
                                && (!ConstraintBlockFilter.isAConstraintBlock(selectedElt))) 
123 131
                                                                                        || (selectedElt instanceof Interface)
124 132
                                                                                        || (selectedElt instanceof Signal)
125 133
                                                                                        || (selectedElt instanceof Actor)
......
134 142
    @objid ("dbd591fb-3ec9-4f4c-83d6-e96f61f2518e")
135 143
    @Override
136 144
    public ElementDescriptor getCreatedElementType() {
137
        return null;
145
        IModuleContext moduleContext = getModule().getModuleContext();
146
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
147
        MClass mClass = metamodel.getMClass(ActivityDiagram.class);
148
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
149
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.SYSMLACTIVITYDIAGRAM, mClass);
150
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
138 151
    }
139 152

  
140 153
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/InternalBlockDiagramWizard.java
39 39
import org.modelio.api.modelio.diagram.IDiagramService;
40 40
import org.modelio.api.modelio.diagram.dg.IDiagramDG;
41 41
import org.modelio.api.modelio.diagram.style.IStyleHandle;
42
import org.modelio.api.modelio.model.IMetamodelExtensions;
42 43
import org.modelio.api.modelio.model.IModelingSession;
43 44
import org.modelio.api.modelio.model.ITransaction;
44 45
import org.modelio.api.module.context.IModuleContext;
......
59 60
import org.modelio.module.sysml.utils.SysMLResourcesManager;
60 61
import org.modelio.module.sysml.utils.Utils;
61 62
import org.modelio.vcore.smkernel.mapi.MClass;
63
import org.modelio.vcore.smkernel.mapi.MMetamodel;
62 64
import org.modelio.vcore.smkernel.mapi.MObject;
63 65

  
64 66
/**
......
74 76
        IModuleContext moduleContext = SysMLModule.getInstance().getModuleContext();
75 77
        IModelingSession session = moduleContext.getModelingSession();
76 78
        StaticDiagram diagram = null;
79
        String name = I18nMessageService.getString("Ui.Command.InternalBlockDiagramExplorerCommand.Label");
77 80
        
78 81
        try (ITransaction transaction = session.createTransaction(I18nMessageService.getString("Info.Session.Create", "Internal Block Diagram"))) {
79 82
        
80
            MClass mclass = moduleContext.getModelioServices().getMetamodelService().getMetamodel().getMClass(StaticDiagram.class);
83
            MClass mclass = moduleContext.getModelioServices().getMetamodelService().getMetamodel().getMClass(AbstractDiagram.class);
81 84
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.INTERNALBLOCKDIAGRAM, mclass);
82
            diagram = session.getModel().createStaticDiagram(diagramName, element, ster);
83
            Utils.setUMLFreeName(diagram, diagramName);
85
            diagram = session.getModel().createStaticDiagram(name, element, ster);
86
            Utils.setUMLFreeName(diagram, name);
84 87
            session.getModel().createNote("ModelerModule","description", diagram, description);
85 88
            
86 89
            if (diagram != null) {
......
151 154
    public boolean accept(MObject element) {
152 155
        return ((element != null) 
153 156
                                                                                        && (BlockFilter.isABlock(element))
154
                                                                                        && (!ConstraintBlockFilter.isAConstraintBlock(element)));
157
                && (!ConstraintBlockFilter.isAConstraintBlock(element))
158
                && element.getStatus().isModifiable());
155 159
    }
156 160

  
157 161
    @objid ("fef8fb4b-1a58-4875-9ce1-2726dee41c8d")
158 162
    @Override
159 163
    public ElementDescriptor getCreatedElementType() {
160
        return null;
164
        IModuleContext moduleContext = getModule().getModuleContext();
165
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
166
        MClass mClass = metamodel.getMClass(StaticDiagram.class);
167
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
168
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.INTERNALBLOCKDIAGRAM, mClass);
169
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
161 170
    }
162 171

  
163 172
}
branches/modelio3.8.x/src/main/java/org/modelio/module/sysml/commands/explorer/diagram/wizard/ParametricDiagramWizard.java
39 39
import org.modelio.api.modelio.diagram.IDiagramService;
40 40
import org.modelio.api.modelio.diagram.dg.IDiagramDG;
41 41
import org.modelio.api.modelio.diagram.style.IStyleHandle;
42
import org.modelio.api.modelio.model.IMetamodelExtensions;
42 43
import org.modelio.api.modelio.model.IModelingSession;
43 44
import org.modelio.api.modelio.model.ITransaction;
44 45
import org.modelio.api.module.context.IModuleContext;
......
52 53
import org.modelio.metamodel.uml.infrastructure.Stereotype;
53 54
import org.modelio.module.sysml.api.ISysMLPeerModule;
54 55
import org.modelio.module.sysml.api.SysMLStereotypes;
55
import org.modelio.module.sysml.filters.BlockFilter;
56 56
import org.modelio.module.sysml.filters.ConstraintBlockFilter;
57 57
import org.modelio.module.sysml.i18n.I18nMessageService;
58 58
import org.modelio.module.sysml.impl.SysMLModule;
59 59
import org.modelio.module.sysml.utils.SysMLResourcesManager;
60 60
import org.modelio.module.sysml.utils.Utils;
61 61
import org.modelio.vcore.smkernel.mapi.MClass;
62
import org.modelio.vcore.smkernel.mapi.MMetamodel;
62 63
import org.modelio.vcore.smkernel.mapi.MObject;
63 64

  
64 65
/**
......
72 73
    public AbstractDiagram actionPerformed(ModelElement element, String diagramName, String description) {
73 74
        IModuleContext moduleContext = SysMLModule.getInstance().getModuleContext();
74 75
        IModelingSession session = moduleContext.getModelingSession();
76
        String name = I18nMessageService.getString ("Ui.Command.ParametricDiagramExplorerCommand.Label");
75 77
        StaticDiagram diagram = null;
76 78
        
77 79
        try( ITransaction transaction = session.createTransaction (I18nMessageService.getString ("Info.Session.Create", "Parametric Diagram"))){
78 80
        
79 81
            MClass mclass = moduleContext.getModelioServices().getMetamodelService().getMetamodel().getMClass(StaticDiagram.class);
80 82
            Stereotype ster = session.getMetamodelExtensions().getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.PARAMETRICDIAGRAM, mclass);
81
            diagram = session.getModel().createStaticDiagram(diagramName, element, ster);
82
            Utils.setUMLFreeName(diagram, diagramName);
83
            diagram = session.getModel().createStaticDiagram(name, element, ster);
84
            Utils.setUMLFreeName(diagram,name);
83 85
            session.getModel().createNote("ModelerModule","description", diagram, description);
84 86
        
85 87
            if (diagram != null) {
......
151 153
    @objid ("24d46d75-2235-494a-9476-96dab09beaeb")
152 154
    @Override
153 155
    public boolean accept(MObject element) {
154
        return ((element != null) &&
155
                                                                                        ((BlockFilter.isABlock (element)
156
                                                                                                || ConstraintBlockFilter.isAConstraintBlock (element))));
156
        return ((element != null) 
157
                && (ConstraintBlockFilter.isAConstraintBlock (element))
158
                && element.getStatus().isModifiable());
157 159
    }
158 160

  
159 161
    @objid ("4e9da8fb-8ab5-4aa6-b860-a659e12e27c3")
160 162
    @Override
161 163
    public ElementDescriptor getCreatedElementType() {
162
        return null;
164
        IModuleContext moduleContext = getModule().getModuleContext();
165
        MMetamodel metamodel = moduleContext.getModelioServices().getMetamodelService().getMetamodel();
166
        MClass mClass = metamodel.getMClass(StaticDiagram.class);
167
        IMetamodelExtensions extensions = moduleContext.getModelingSession().getMetamodelExtensions();
168
        Stereotype stereotype = extensions.getStereotype(ISysMLPeerModule.MODULE_NAME, SysMLStereotypes.PARAMETRICDIAGRAM, mClass);
169
        return stereotype != null ? new ElementDescriptor(mClass, stereotype) : null;
163 170
    }
164 171

  
165 172
}
branches/modelio3.8.x/pom.xml
5 5
  <!-- definition -->
6 6
  <groupId>org.modelio.module</groupId>
7 7
  <artifactId>sysmlarchitect</artifactId>
8
  <version>3.8.01</version>
8
  <version>3.8.02</version>
9 9
  <name>SysMLArchitect</name>
10 10
  <repositories>
11 11
      <repository>

Also available in: Unified diff