Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Show selection when a connection is selected
Show selection when a connection is selected [message #661373] Thu, 24 March 2011 08:47 Go to next message
JeTBLaCK  is currently offline JeTBLaCK
Messages: 41
Registered: March 2011
Member
Hi!

I need to show a selection when a connection is selected. I use "ConnectionEditPolicy" but it understands only Delete.

Any suggestion?

Re: Show selection when a connection is selected [message #661380 is a reply to message #661373] Thu, 24 March 2011 09:16 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad Bandaru
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

Hi,
Use this editpolicy org.eclipse.gef.editpolicies.SelectionEditPolicy
and implement the hideSeletion() and showSelection() methods.
You can do something like this in the implementaion in showSelection() set the connection color (say blue) to indicate the selection and in hideSelection() set the color back to original color


Re: Show selection when a connection is selected [message #661557 is a reply to message #661380] Fri, 25 March 2011 06:12 Go to previous messageGo to next message
JeTBLaCK  is currently offline JeTBLaCK
Messages: 41
Registered: March 2011
Member
Thank you, Prasad.

If I need a normal selection like a rectangle selected, should I use that policy or another one?
Re: Show selection when a connection is selected [message #661645 is a reply to message #661557] Fri, 25 March 2011 12:56 Go to previous messageGo to next message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad Bandaru
Messages: 98
Registered: March 2010
Location: Hyderabad
Member

Small doubt you said you want to show selection when something is selected . Do you mean to say that you need to show some feed back so that user understands that the connection is selected? And regarding showing selection (feedback) on rectangular figures you can always use the same edit policy irrespective of the type of figures. All you have to do is get the respective figure representing the selection and update it's border thickness or color based on you requirement .


Re: Show selection when a connection is selected [message #661651 is a reply to message #661645] Fri, 25 March 2011 13:38 Go to previous message
JeTBLaCK  is currently offline JeTBLaCK
Messages: 41
Registered: March 2011
Member
Thank you for your help, Prasad.

I have implemented a policy called "BendpointEditPolicy" that it is what I was looking for. Smile
Previous Topic:Multiple connection layers
Next Topic:Change focus
Goto Forum:
  


Current Time: Thu Apr 17 20:57:55 EDT 2014

Powered by FUDForum. Page generated in 0.01700 seconds