Skip to main content



      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 05:20 Go to next message
Eclipse UserFriend
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] Thu, 03 April 2008 23:15 Go to previous messageGo to next message
Eclipse UserFriend
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 05:08 Go to previous messageGo to next message
Eclipse UserFriend
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 03:06 Go to previous messageGo to next message
Eclipse UserFriend
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 08:08 Go to previous message
Eclipse UserFriend
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: Thu Jul 10 00:22:59 EDT 2025

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

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

Back to the top