Bug 106114

Summary: problem dragging element in DragEditPartsTracker when grid is visible
Product: [Tools] GEF Reporter: Thuc <tqnguyen>
Component: GEF-Legacy GEF (MVC)Assignee: Pratik Shah <ppshah>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: melaasar, min123, nyssen
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Patch for DragEditPartsTracker none

Description Thuc CLA 2005-08-04 18:55:10 EDT
Problem in DragEditPartsTracker when the grid is visible.

To reproduce the problem in the Logic example, modify
LogicXYLayoutEditPolicy.createChildEditPolicy(). Right after the policy is
created, add the line
    policy.setDragAllowed(false);

Now try dragging an element in the Logic editor; you should encounter a
NullPointerEx in DragEditPartsTracker.updateTargetRequest().

With the SnapToHelper enabled, the drag tracker tries to use the variable
'compoundSrcRect'. This variable is set based on any selected editparts that
understand the move request. However, the setDragAllowed(false) call means that
the editpolicy doesn't understand the request, so the variable in question is
never set.
Comment 1 Pratik Shah CLA 2005-08-08 14:34:01 EDT
Created attachment 25857 [details]
Patch for DragEditPartsTracker

A simple fix for 3.1.1 is to not get the snapToHelper from the target editpart
if there is nothing to be dragged.  Then the code where the NPE occurs won't be
entered for this case.

The more correct fix would be to not enter into drag state if there's nothing
to be dragged.	We can do that for 3.2, but it's too risky for 3.1.1.  I'll
open another bug for that.

Randy to approve the attached patch.
Comment 2 Randy Hudson CLA 2005-08-08 17:15:59 EDT
+1
Comment 3 Pratik Shah CLA 2005-08-08 17:56:48 EDT
fixed
Comment 4 Pratik Shah CLA 2005-09-28 13:03:24 EDT
*** Bug 110944 has been marked as a duplicate of this bug. ***
Comment 5 Pratik Shah CLA 2005-09-28 13:06:27 EDT
Bug 106411 was opened to consider a better fix for this problem in 3.2.
Comment 6 Steven R. Shaw CLA 2006-05-15 16:48:48 EDT
*** Bug 71392 has been marked as a duplicate of this bug. ***
Comment 7 Alexander Nyßen CLA 2015-03-20 08:15:19 EDT
Comment on attachment 25857 [details]
Patch for DragEditPartsTracker

Remove iplog+ flag as contributor was committer (who applied the change).