Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Highlight edges when selecting a node
Highlight edges when selecting a node [message #1735204] Thu, 16 June 2016 10:18 Go to next message
Martin Jedlicka is currently offline Martin JedlickaFriend
Messages: 122
Registered: January 2016
Senior Member
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 13:07 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or 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 13:07 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo Canada
Need training or 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 09:47 Go to previous message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
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


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Create Menu Items (Operation Action) Based On Semantics at Runtime
Next Topic:Findings node in the path edges
Goto Forum:
  


Current Time: Fri Mar 29 00:53:26 GMT 2024

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

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

Back to the top