Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [Solved] Edge Routing Style
[Solved] Edge Routing Style [message #1770010] Mon, 07 August 2017 13:50 Go to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
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 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
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 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
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 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
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 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
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 Go to previous message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
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
Previous Topic:URGENT: Edge delete on Element deletion
Next Topic:Representations in model
Goto Forum:
  


Current Time: Thu Mar 28 19:45:01 GMT 2024

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

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

Back to the top