Customising Edge styles [message #1775211] |
Thu, 26 October 2017 07:13  |
Eclipse User |
|
|
|
Hi,
We are currently trying to customise the style of edges in our editor. Instead of the three line styles (Straight/Tree/Manhattan) provided by Sirius/GMF. We want to implement a edge what is actually a cubic curve. Is there anyway that we could provide an edit part for the edges? Any pointer to that direction is hugely appreciated.
Cheers,
Will
|
|
|
|
|
|
|
|
|
|
Re: Customising Edge styles [message #1776355 is a reply to message #1776353] |
Wed, 15 November 2017 10:37   |
Eclipse User |
|
|
|
Hi Pierre,
In TreeEditPartProvider, when getEdgeEditPartClass() is called, I provide EdgeEditPart, which in turn creates an EdgePipeConnection.
When EdgePipeConnection extends PolylineConnection, the edge can be drawn, just it is now allowed by Sirius.
When EdgePipeConnection extends PolylineConnectionEx , I had the previous exception.
By when creating an edge, i meant when using a tool from the palette to create an edge between two nodes, that is correct.
Thank you very much for your help.
Cheers,
Will
|
|
|
|
|
|
Re: Customising Edge styles [message #1776462 is a reply to message #1776440] |
Thu, 16 November 2017 10:24  |
Eclipse User |
|
|
|
Hi,
AbstractExtendableEdgeEditPart extends DEdgeEditPart that is internal that is why you have warnings.
So it does not change anything. You should keep DEdgeEditPart
Internal means we can do some changes that will break your code if you use the internal code.
If this is ok for your project you can use it. If you want to industrialize it then you should extend AbstractDiagramEdgeEditPart and add the code that was missing and causing exception and that I gave you in previous message.
In both case you must change the method getPrimaryShape() to return your figure type.
Your figure must also provide label figures like ViewEdgeFigure with methods called by your addFixedChild(EditPart) method (getFigureViewEdgeNameFigure,getFigureViewEndEdgeNameFigure,getFigureViewBeginEdgeNameFigure).
You can just copy the code handling these labels in your figure.
Anyway there is no guarantee that you will not be blocked completely at some point because Sirius architecture does not allow you to do what you seek.
What you are doing is out of the box and can lead to nothing.
Regards,
Pierre
[Updated on: Thu, 16 November 2017 10:26] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.25576 seconds