Skip to main content



      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 06:00 Go to next message
Eclipse UserFriend
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 188 times)
  • Attachment: Image 2.jpg
    (Size: 20.19KB, Downloaded 194 times)
Re: Is Partial Mouse selection possible in GEF? [message #1433948 is a reply to message #1433839] Mon, 29 September 2014 08:56 Go to previous messageGo to next message
Eclipse UserFriend
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 03:42 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Is Partial Mouse selection possible in GEF? [message #1440278 is a reply to message #1434523] Wed, 08 October 2014 02:40 Go to previous message
Eclipse UserFriend
Thanks Alexander & Laurent for the replies Smile
Previous Topic:Looking for an editor to create drawings
Next Topic:Check box to be inserted for each node in the tree
Goto Forum:
  


Current Time: Wed Jul 23 13:47:22 EDT 2025

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

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

Back to the top