[Solved] Edge Routing Style [message #1770010] |
Mon, 07 August 2017 13:50 |
|
Hi there,
Is it possible to change the routing style (either from Sirius design file or programatically or changing the source code) of edges? Right now we have straight, manhattan and tree, I want the edges to bend and have curvy corners. Are all these possible, please?
Cheers,
Will
Research Associate
Department of Computer Science
University of York
[Updated on: Tue, 15 August 2017 13:46] Report message to a moderator
|
|
|
Re: Edge Routing Style [message #1770024 is a reply to message #1770010] |
Mon, 07 August 2017 15:00 |
|
Hi William,
You can adjust the smoothness value of the routing style once the edge is created - from the appearance view or programmatically: org.eclipse.gmf.runtime.notation.RoutingStyle.setSmoothness(Smoothness) - but this property cannot be specified from the odesign file
Regards,
Florian
|
|
|
Re: Edge Routing Style [message #1770098 is a reply to message #1770024] |
Tue, 08 August 2017 10:20 |
|
Hi Florian,
Many thanks for your response. Could you be more specific and point me to the point where an edge is created?
Cheers,
Will
Research Associate
Department of Computer Science
University of York
|
|
|
Re: Edge Routing Style [message #1770138 is a reply to message #1770098] |
Tue, 08 August 2017 15:07 |
|
Hi William,
Sirius relies on the GMF metamodel. The Edge routing style is held by the GMF model serialized in the aird file. You can modify the Edge routing style by retrieving the RoutingStyle of the Edge and edit the smoothness value. The way Sirius creates the GMF Edge is not intended to be extended. The GMF Edges are instantiated in this method: org.eclipse.sirius.diagram.ui.internal.refresh.diagram.DDiagramCanonicalSynchronizer.createConnections(Collection<SiriusLinkDescriptor>, Map<EObject, View>, Diagram).
I can suggest you two way to modify the smoothness of an Edge at the creation time:
* Provide your own org.eclipse.emf.transaction.ResourceSetListener (since Sirius executes all model changes in transactional commands) and implement the Edge modification in a command that will be returned by org.eclipse.emf.transaction.ResourceSetListener.transactionAboutToCommit(ResourceSetChangeEvent).
* Register a new org.eclipse.sirius.business.api.session.ModelChangeTrigger. You can take a look in the ecoreTools project - org.eclipse.emf.ecoretools.design.service.AutosizeTrigger for instance - to have an example of modelChangeTrigger and the way it is provided.
Regards,
Florian
|
|
|
Re: Edge Routing Style [message #1770634 is a reply to message #1770138] |
Tue, 15 August 2017 11:08 |
|
Hi Florian,
I have been at this for several days and still no progress. I planned to go with ModelChangeTrigger, which can be added to SessionEventBroker. However, I have problems with how to get the SessionEventBroker and how this can be integrated in a plug-in that registers a ModelChangeTrigger when I fire up an Eclipse instance.
Any suggestions are much appreciated.
Cheers,
William
Research Associate
Department of Computer Science
University of York
|
|
|
Re: Edge Routing Style [message #1770639 is a reply to message #1770634] |
Tue, 15 August 2017 13:37 |
|
Hi,
Sorry, the problem is solved. My apologies if my last post confused you.
Thank you very much.
Cheers,
Will
Research Associate
Department of Computer Science
University of York
|
|
|
Powered by
FUDForum. Page generated in 0.05863 seconds