Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Sequence Diagram Editor in GMF(Sequence Diagram Editor in GMF)
Sequence Diagram Editor in GMF [message #1721579] Thu, 28 January 2016 12:57 Go to next message
Klementina Josifovska is currently offline Klementina JosifovskaFriend
Messages: 8
Registered: December 2015
Junior Member
Hi,

Does someone have experience with creating Sequence Diagram Editor in GMF? It would be very helpful if you can give me some guidelines!

Thanks!

[Updated on: Thu, 28 January 2016 12:58]

Report message to a moderator

Re: Sequence Diagram Editor in GMF [message #1721791 is a reply to message #1721579] Sat, 30 January 2016 17:31 Go to previous messageGo to next message
Ángel Moreno is currently offline Ángel MorenoFriend
Messages: 13
Registered: November 2013
Location: Madrid
Junior Member
Klementina do you have the metamodel for your Sequence Diagram? Could you post what idea do you have?

Greatings,


Ángel M.
Researcher @ Kybele Research Group
Rey Juan Carlos University, Madrid, Spain
Re: Sequence Diagram Editor in GMF [message #1725756 is a reply to message #1721791] Mon, 07 March 2016 12:53 Go to previous messageGo to next message
Klementina Josifovska is currently offline Klementina JosifovskaFriend
Messages: 8
Registered: December 2015
Junior Member
Hi,

I have managed to create Sequence Diagram Editor. Is there any tutorial which can show me how to export it/ in which form in order to be able to have it within Eclipse workspace without Run as -> Eclipse Application?

Thanks!
Re: Sequence Diagram Editor in GMF [message #1745850 is a reply to message #1725756] Tue, 18 October 2016 11:30 Go to previous messageGo to next message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
Messages: 39
Registered: February 2016
Member
Hello Klementina, good to hear you managed to create the Sequence Diagram editor for your project.

I have a similar project where I have to extend the UML2 meta-model specifically for Sequence Diagrams. I have to add some new edge types (messages) with their respective graphical notation, some labels and 3 new lifeline types with their respective notation as well.

As you have managed to create your editor, could you provide me with any insight you gained from that activity?


Any help is appreciated Smile


Regards Vetle VF.
Re: Sequence Diagram Editor in GMF [message #1746121 is a reply to message #1725756] Sat, 22 October 2016 12:39 Go to previous messageGo to next message
Niklas Klipphahn is currently offline Niklas KlipphahnFriend
Messages: 7
Registered: July 2016
Junior Member
You can export your diagram as a standalone RCP application. You need to re-generate the code with the RCP option enabled first. I'd advise to not overwrite your current files, as there a re some programmatic difference in the generated classes.
RCP has never worked for me and it doesn't have a project explorer.

Alternatively you can export your Diagram Editor as an Eclipse Plugin. To do this create a new 'Feature Project' in your workspace and edit the feature.xml (included Plug-Ins and Dependencies tabs are important).
Then you can export a 'Deployable Feature' under File->Export. You can export it in a folder structure or a zip file. I recommend the latter.
After it has been exported you can install it in eclipse with Help->Install New Software. Click 'add' and choose your archive. Make sure you disable 'group items by category' so your plugin appears.

Your diagram can then be directly created in your main eclipse applications workspace.
Re: Sequence Diagram Editor in GMF [message #1747133 is a reply to message #1746121] Wed, 09 November 2016 21:17 Go to previous message
Klementina Josifovska is currently offline Klementina JosifovskaFriend
Messages: 8
Registered: December 2015
Junior Member
Thanks a lot for your reply! I have now another problem:

I am creating EMF model with code and I want to initialize the corresponding GMF diagram for the model, but still I can't succeed to create it.

Here is one example where I am trying to create two Instance Roles and two messages between them.

public class CreateModel {

public static void main(String[] args) {

Resource.Factory.Registry registry = Resource.Factory.Registry.INSTANCE;
Map<String, Object> map = registry.getExtensionToFactoryMap();
map.put("*", new XMIResourceFactoryImpl());
SequencePackage.eINSTANCE.eClass();
ResourceSet sequenceSet = new ResourceSetImpl();

sequenceSet
.getResourceFactoryRegistry()
.getExtensionToFactoryMap()
.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
URI fileURIProtocol = URI.createFileURI(new File(
"SeqTest.sequence_diagram").getAbsolutePath());

Resource sequenceResource = sequenceSet.createResource(fileURIProtocol);
sequence.SequenceModel sequenceModel = SequenceFactory.eINSTANCE
.createSequenceModel();
sequenceResource.getContents().add(sequenceModel);



InstanceRole instance1 = SequenceFactory.eINSTANCE.createInstanceRole();
InstanceRole instance2 = SequenceFactory.eINSTANCE.createInstanceRole();

instance1.setInstanceName("User");
instance2.setInstanceName("System");

sequenceModel.getInstance().add(instance1);
sequenceModel.getInstance().add(instance2);

Message message1 = SequenceFactory.eINSTANCE.createMessage();
message1.setSource(instance1);
message1.setTarget(instance2);
message1.setOperationName("login");
sequenceModel.getMessage().add(message1);

ResponseMessage resp = SequenceFactory.eINSTANCE
.createResponseMessage();
resp.setSource(instance2);
resp.setTarget(instance1);
resp.setOperationName("success");
sequenceModel.getResponse().add(resp);

sequenceResource.getContents().add(sequenceModel);

Diagram diagram = ViewService.createDiagram(sequenceModel,
SequenceModelEditPart.MODEL_ID,
SequenceDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);

sequenceResource.getContents().add(diagram);

try {

sequenceResource.save(Collections.EMPTY_MAP);
} catch (IOException e) {
/* error handling */
}
;
}

}


I get the following error message, caused by creating the diagram. Is there other way that I can use in order to create the GMF diagram?

Exception in thread "main" java.lang.ExceptionInInitializerError
at sequenceSynthesis.SequenceModel.main(SequenceModel.java:80)
Caused by: java.lang.NullPointerException
at org.eclipse.gmf.runtime.diagram.core.internal.DiagramPlugin.getPluginId(DiagramPlugin.java:48)
at org.eclipse.gmf.runtime.diagram.core.services.ViewService.<clinit>(ViewService.java:136)
... 1 more


Thanks!
Previous Topic:'diagramLabel' of 'Feature Label Mapping false'
Next Topic:Modelling Childs on Border of Parent
Goto Forum:
  


Current Time: Sun Aug 20 08:27:58 GMT 2017

Powered by FUDForum. Page generated in 0.02295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software