Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 211807

Summary: [Tool] MarqueeSelectionTool does not include connections that were previously selected
Product: [Tools] GEF Reporter: Abel Ferreira <aferreira>
Component: GEF-Legacy GEF (MVC)Assignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: 3.7.1 (Indigo) M3   
Hardware: All   
OS: All   
Whiteboard:

Description Abel Ferreira CLA 2007-12-03 15:03:35 EST
Build ID:  M20060629-1905

Steps To Reproduce:
1.Set the MarqueeBehavior to MarqueeSelectionTool.BEHAVIOR_NODES_AND_CONNECTIONS
2.Select a connection that connects two nodes
3.Using the marquee create a selection area that includes the two nodes
4. The two nodes are selected but the connection is deselected (this is not the behavior expected, the connection should had remained selected)
5.Repeat step 3
6.The two nodes and the connection are selected which is the behavior expected


More information:
The problem is in the method calculateConnections, lines 133 and 140, respectively 
if (sourceConn.getSelected() == EditPart.SELECTED_NONE
and
if (targetConn.getSelected() == EditPart.SELECTED_NONE
they should include the condition
getSelectionMode() != TOGGLE_MODE

and therefore the two lines 133 and 140 should be:
if ((sourceConn.getSelected() == EditPart.SELECTED_NONE || getSelectionMode() != TOGGLE_MODE)

and 

if ((targetConn.getSelected() == EditPart.SELECTED_NONE || getSelectionMode() != TOGGLE_MODE)

respectively
This will add selected connections to the connections Collection
Comment 1 Alexander Nyßen CLA 2010-10-27 17:55:19 EDT
Incorporated the proposed changes to MarqueeSelectionTool. Verified using Logic example that the behavior now is as expected. 

All changes committed to cvs HEAD (3.7).