Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Is Partial Mouse selection possible in GEF?(I want to select part of a Diagram when choosing an area with mouse selection)
Is Partial Mouse selection possible in GEF? [message #1433839] Mon, 29 September 2014 10:00 Go to next message
Abhishek SA is currently offline Abhishek SAFriend
Messages: 7
Registered: September 2014
Junior Member
I am attaching 2 images for explaining my situation. I have a diagram which I want to select using mouse. Image 1 shows the default behaviour, which selects both Category 1 & 2 along with its children(choice 1, choice 2, value 1, value 2 respectively). But, I want to select only the outline diagrams(namely, class, category 1 , category 2) using mouse selection.(As it looks in Image 2). From the code perspective, I want to fetch only the outline diagrams selected(As in Image 2)

I am using getSelection() method of ISelection org.eclipse.gef.ui.actions.SelectionAction.getSelection() to get access to selected elements from diagram. But, it returns all elements (namely category 1+choice1+choice2).

Is there any other method which can help me out?
  • Attachment: Image 1.jpg
    (Size: 22.75KB, Downloaded 132 times)
  • Attachment: Image 2.jpg
    (Size: 20.19KB, Downloaded 138 times)
Re: Is Partial Mouse selection possible in GEF? [message #1433948 is a reply to message #1433839] Mon, 29 September 2014 12:56 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 235
Registered: July 2009
Location: Lünen
Senior Member
You could make the non-outline edit parts unelectable (see EditPart#isSelectable()) or forward the selection to its parent (see SelectionEditPolicy#getTargetEditParts()).
Re: Is Partial Mouse selection possible in GEF? [message #1434523 is a reply to message #1433839] Tue, 30 September 2014 07:42 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 238
Registered: July 2009
Senior Member
Hi,

Le 29/09/2014 14:50, Abhishek SA a écrit :
> I am attaching 2 images for explaining my situation. I have a diagram which I want to select using mouse. Image 1 shows the default behaviour, which selects both Category 1 & 2 along with its children(choice 1, choice 2, value 1, value 2 respectively). But, I want to select only the outline diagrams(namely, class, category 1 , category 2) using mouse selection.(As it looks in Image 2). From the code perspective, I want to fetch only the outline diagrams selected(As in Image 2)
>
> I am using getSelection() method of ISelection org.eclipse.gef.ui.actions.SelectionAction.getSelection() to get access to selected elements from diagram. But, it returns all elements (namely category 1+choice1+choice2).
>
> Is there any other method which can help me out?
>

You can use
org.eclipse.gef.tools.ToolUtilities.getSelectionWithoutDependants(List)

Best regards,

--
Laurent Redor


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Is Partial Mouse selection possible in GEF? [message #1440278 is a reply to message #1434523] Wed, 08 October 2014 06:40 Go to previous message
Abhishek SA is currently offline Abhishek SAFriend
Messages: 7
Registered: September 2014
Junior Member
Thanks Alexander & Laurent for the replies Smile
Previous Topic: Synchronize a diagram with a model GMF
Next Topic:Catch editor being "ready"
Goto Forum:
  


Current Time: Fri Oct 19 14:12:21 GMT 2018

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

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

Back to the top