Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Show/hide connections for a node on selection/unselection
Show/hide connections for a node on selection/unselection [message #180049] Tue, 01 April 2008 09:20 Go to next message
Alexey Semenov is currently offline Alexey SemenovFriend
Messages: 78
Registered: July 2009
Member
Hi All,

I want to show incoming connections for a node on selection and hide them
on unselection. Where should I look at?

I guess I should install EditPolicy.SELECTION_FEEDBACK_ROLE in the node's
edit part, but how do I iterate connections and show/hide them from there?

Any help appreciated.

Thanks in advance,
Alexey
Re: Show/hide connections for a node on selection/unselection [message #180836 is a reply to message #180049] Fri, 04 April 2008 03:15 Go to previous messageGo to next message
Lazar Codrut-Lucian is currently offline Lazar Codrut-LucianFriend
Messages: 91
Registered: July 2009
Member
The behavior you ask for exists if a compartment is collapsed/expanded
(one node is outside, one in the compartment and a relation exists
between the nodes). I guess you can try find your answers there.

Lucian
Re: Show/hide connections for a node on selection/unselection [message #760797 is a reply to message #180836] Mon, 05 December 2011 10:08 Go to previous messageGo to next message
Piotr Trojanek is currently offline Piotr TrojanekFriend
Messages: 7
Registered: October 2010
Junior Member
Unfortunately, collapsing/expanding a compartment does not change visibility of the connections coming from the contained nodes.

Do you have any other idea to manage visibility of the connection links?

--
Piotr.
Re: Show/hide connections for a node on selection/unselection [message #761274 is a reply to message #760797] Tue, 06 December 2011 08:06 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

did you try to manage this from the ediparts contained in the compartment. They store their incomming and outgoing connections. You could somehow listen when the compartment collapses/expands and execute code to show hide the connections. You could try overriding handleNotification in the contained EditParts or their Container to listen for the EditPart becoming visible/invisible or the container to collapse/expand. You could also check if remove/addNotify is called on the contained EditParts and place your code there.

Hope that helps Smile

Ralph
Re: Show/hide connections for a node on selection/unselection [message #761422 is a reply to message #761274] Tue, 06 December 2011 13:08 Go to previous message
Piotr Trojanek is currently offline Piotr TrojanekFriend
Messages: 7
Registered: October 2010
Junior Member
Thanks for the hint! I was trying to find a method of contained EditPart-s to override, but without success. I also tried to breakpoint at handleNotification, but it seems, that the contained EditPart has nothing to do with collapsing/expanding the compartment. I guess, that this action only deals with View-s, not the EditPart-s (?).

However, I just found a workaround/solution inspired by the Logic Diagram Example. Inheriting the compartment's EditPart from ShapeCompartmentEditPart does the job of hiding/unhiding connection links during collapse/expand.

--
Piotr
Previous Topic:GMF Runtime Exception
Next Topic:Tagging model elements using toolbar
Goto Forum:
  


Current Time: Tue Apr 23 07:50:47 GMT 2024

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

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

Back to the top