Bug 106114 - problem dragging element in DragEditPartsTracker when grid is visible
Summary: problem dragging element in DragEditPartsTracker when grid is visible
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: Pratik Shah CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 71392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-04 18:55 EDT by Thuc CLA
Modified: 2015-03-20 08:15 EDT (History)
3 users (show)

See Also:


Attachments
Patch for DragEditPartsTracker (675 bytes, patch)
2005-08-08 14:34 EDT, Pratik Shah CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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).