Highlight edges when selecting a node [message #1735204] |
Thu, 16 June 2016 06:18  |
Eclipse User |
|
|
|
Hello,
I had a question about the highlight of connected edges when selecting the node. If I select a node, so I would like to highlight (selected) all edges that are connected to the node.
On the attached picture you can see that when you select a node TST001_U002 are selected and connected edges. Ideally, still change the color of edges connected (but not necessary).
Can this be done?
Thanks so much for any advice.
Martin
|
|
|
Re: Highlight edges when selecting a node [message #1735223 is a reply to message #1735204] |
Thu, 16 June 2016 09:07   |
Eclipse User |
|
|
|
Hello,
That is a nice idea, especially on big diagrams. The highlighting is
managed by
org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.addHighlight().
You will have to provide your own EditPart[1] in order to install your
own EditPolicy overriding ours. In createDefaultEditPolicies, you should
have something like
self.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new
SuperCoolHighligthingSiriusGraphicalNodeEditPolicy());
Note that in your EditPolicy you will have to override the
showTargetConnectionFeedback method. The method addHighlight is private
but you will have your own implementation anyway.
Regards,
Steve
[1]https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
Le 16/06/2016 à 12:18, Martin Jedlicka a écrit :
> Hello,
>
> I had a question about the highlight of connected edges when selecting the node. If I select a node, so I would like to highlight (selected) all edges that are connected to the node.
>
> On the attached picture you can see that when you select a node TST001_U002 are selected and connected edges. Ideally, still change the color of edges connected (but not necessary).
>
> Can this be done?
>
> Thanks so much for any advice.
>
> Martin
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Highlight edges when selecting a node [message #1735225 is a reply to message #1735204] |
Thu, 16 June 2016 09:07   |
Eclipse User |
|
|
|
Hello,
That is a nice idea, especially on big diagrams. The highlighting is
managed by
org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.addHighlight().
You will have to provide your own EditPart[1] in order to install your
own EditPolicy overriding ours. In createDefaultEditPolicies, you should
have something like
self.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new
SuperCoolHighligthingSiriusGraphicalNodeEditPolicy());
Note that in your EditPolicy you will have to override the
showTargetConnectionFeedback method. The method addHighlight is private
but you will have your own implementation anyway.
Regards,
Steve
[1]https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
Le 16/06/2016 à 12:18, Martin Jedlicka a écrit :
> Hello,
>
> I had a question about the highlight of connected edges when selecting the node. If I select a node, so I would like to highlight (selected) all edges that are connected to the node.
>
> On the attached picture you can see that when you select a node TST001_U002 are selected and connected edges. Ideally, still change the color of edges connected (but not necessary).
>
> Can this be done?
>
> Thanks so much for any advice.
>
> Martin
>
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Highlight edges when selecting a node [message #1735310 is a reply to message #1735223] |
Fri, 17 June 2016 05:47  |
Eclipse User |
|
|
|
Hi,
I think that the policy proposed by Steve is not the only one that can
be used. In Sirius, we already done something smiliar. When you select
an edge, the edge label is "highlighted" (and conversely). This is done
in [1] and [2].
This is another entry point.
[1]
org.eclipse.sirius.diagram.ui.graphical.edit.policies.AbstractEdgeSelectionFeedbackEditPolicy.createSelectionHandles()
[2]
org.eclipse.sirius.diagram.ui.graphical.edit.policies.DEdgeSelectionFeedbackEditPolicy.createSelectionHandles()
Regards,
Laurent
Le 16/06/2016 à 15:07, Steve Monnier a écrit :
> Hello,
>
> That is a nice idea, especially on big diagrams. The highlighting is
> managed by
> org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusGraphicalNodeEditPolicy.addHighlight().
>
>
> You will have to provide your own EditPart[1] in order to install your
> own EditPolicy overriding ours. In createDefaultEditPolicies, you should
> have something like
> self.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new
> SuperCoolHighligthingSiriusGraphicalNodeEditPolicy());
>
> Note that in your EditPolicy you will have to override the
> showTargetConnectionFeedback method. The method addHighlight is private
> but you will have your own implementation anyway.
>
> Regards,
> Steve
>
> [1]https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
>
>
> Le 16/06/2016 à 12:18, Martin Jedlicka a écrit :
>> Hello,
>>
>> I had a question about the highlight of connected edges when selecting
>> the node. If I select a node, so I would like to highlight (selected)
>> all edges that are connected to the node.
>>
>> On the attached picture you can see that when you select a node
>> TST001_U002 are selected and connected edges. Ideally, still change
>> the color of edges connected (but not necessary).
>>
>> Can this be done?
>>
>> Thanks so much for any advice.
>>
>> Martin
>>
>
>
--
Laurent Redor - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.04382 seconds