Custom diagram type for DSML: plugin/extension [message #1719426] |
Thu, 07 January 2016 14:28  |
Eclipse User |
|
|
|
Hello!
The past couple of days I've been actively working with Papyrus to create a DSML for railway systems. I've created my UML profile, added icons and I'm now in the process of creating an eclipse plugin that will register my UML profile and more importantly: to add a new type of diagram. A "railway diagram" if you will.
I've found the "org.eclipse.papyrus.infra.core.papyrusDiagram" extension point which has some documentation together with an example. I've tried implementing it and was able to create a new diagram category but my new diagram wouldn't show.
I decided to take a step back and copy the example (that creates a sysml requirement diagram) but just put it in my new diagram category.
This is what I currently have:
<extension point="org.eclipse.papyrus.infra.core.papyrusDiagram">
<diagramCategory
id="railway"
class="org.eclipse.papyrus.sysml.diagram.common.commands.CreateSysMLModelCommand"
label="Railway"
description="Railway diagrams"
>
</diagramCategory>
<editorDiagram
actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
factoryClass="org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramEditorFactory"
>
</editorDiagram>
<creationCommand
id="org.eclipse.papyrus.sysml.diagram.requirement.CreateCommand"
creationCommandClass="org.eclipse.papyrus.sysml.diagram.requirement.RequirementDiagramCreateCommand"
label="Railway Diagram"
language="railway">
</creationCommand>
</extension>
I thought that the language in the creationCommand was the category the new diagram should go in? Why doesn't this work? Do I need more in order for the new diagram type to show and be used?
Kind regards,
Kristof
|
|
|
|
|
|
Re: Custom diagram type for DSML: plugin/extension [message #1719512 is a reply to message #1719485] |
Fri, 08 January 2016 09:16   |
Eclipse User |
|
|
|
Camille Letavernier wrote on Fri, 08 January 2016 10:24Hi Kristof,
The SysML (1.1) diagrams rely on a different, deprecated code generator. They are a programmatic extension of UML Diagrams, with a very thin CSS customization.
We don't recommend this approach anymore (Especially since the code generator is not publicly available nor maintained)
It would be better to rely on the SysML 1.4 approach [1] [2], as it requires much less code and is the one we want to promote in Papyrus Mars and further versions
Using a Viewpoint model will avoid the manual declaration for several extension points (Including Wizards integration, Diagram creation commands/menus, and others). You can check the embedded documentation to get more information about what Viewpoints do, and how you define them (Help > Help Contents > Papyrus Guide > User Guide > Viewpoints in Papyrus)
[1] Update site: http://download.eclipse.org/modeling/mdt/papyrus/components/sysml14
[2] Sources: https://git.eclipse.org/r/papyrus/org.eclipse.papyrus-sysml
Hello Camille,
This looks amazing! I've been playing around with it and it looks a lot easier than what I was doing before! Good that there's documentation about it too.
The thing I'm figuring out now is how to create a diagram category so that it stands next to SysML and SysML1.4 in the new project/new diagram wizard. I'll have a look at the SysML1.4 files. I was hoping the 'View Category' in the viewpoint .configuration file was going to take care of this but it looks like it doesn't. It doesn't show up anywhere.
I chose the configuration element in the viewpoints.policy.custom but in the model rule and owning rule of my diagram I've selected the UML package. Maybe this is why it is not showing up? (As the configuration element gets rid of all the UML/SysML diagrams etc.)
Thanks again, I really appreciate your replies!
Kristof
|
|
|
|
|
|
|
Re: Custom diagram type for DSML: plugin/extension [message #1757798 is a reply to message #1719513] |
Sun, 19 March 2017 20:34  |
Eclipse User |
|
|
|
Hi Camille,
I am running into some problems with my custom diagram for DSML. How do I display my custom diagram in the "Select a Diagram Kind" editor? I have implemented a viewpoint extension with a Diagram and a View Category but when I try to create a papyrus project, my custom diagram is not listed in the editor.
|
|
|
Powered by
FUDForum. Page generated in 0.26691 seconds