Bug 338587 - GraphicalViewerImpl.findObjectAtExcluding() exclusionSet tested for IFigures instead of EditParts
Summary: GraphicalViewerImpl.findObjectAtExcluding() exclusionSet tested for IFigures ...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Alexander Nyßen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 348358 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-01 16:16 EST by Bryan Mising name CLA
Modified: 2013-10-29 11:58 EDT (History)
4 users (show)

See Also:


Attachments
Patch with proposed changes (6.42 KB, application/octet-stream)
2012-03-12 17:06 EDT, Alexander Nyßen CLA
nyssen: review?
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Mising name CLA 2011-03-01 16:16:12 EST
According to the documentation for "EditPartViewer.findObjectAtExcluding(location, exclusionSet)", the exclusionSet parameter is a set of EditParts to be excluded from the search.

However, the implementation of this method in GraphicalViewerImpl uses the ExclusionSearch class which incorrectly tests the exclusionSet collection for the presence of IFigures instead of EditParts.

The implementation of this method in TreeViewer correctly tests the exclusionSet parameter against EditParts.
Comment 1 Alexander Nyßen CLA 2011-03-03 13:06:32 EST
You are right, this is indeed inconsistent. GraphicalViewerImpl should test for EditParts as well. 

There is GEF code depending on the current functionality, which could be changed quite easily: ConnectionEndpointTracker and DragEditPartsTracker (indirectly via TargetingTool#getExclusionSet()) seem to be the only GEF clients that pass in figures to be excluded from the search. However, there may be third-party code that depends on the current implementation. So we will at least have to announce the change.
Comment 2 Alexander Nyßen CLA 2011-06-06 03:01:42 EDT
*** Bug 348358 has been marked as a duplicate of this bug. ***
Comment 3 Alexander Nyßen CLA 2012-03-12 13:07:52 EDT
What will have to be investigated in terms of client code are subclasses of TargetingTool, overwriting getExlusionSet(), as well as subclasses of AbstractTransferDropTargetListener, overwriting getExlusionSet() there. All other implementations seem to pass in an empty collection.
Comment 4 Alexander Nyßen CLA 2012-03-12 13:09:24 EDT
(In reply to comment #3)
> What will have to be investigated in terms of client code are subclasses of
> TargetingTool, overwriting getExlusionSet(), as well as subclasses of
> AbstractTransferDropTargetListener, overwriting getExlusionSet() there. All
> other implementations seem to pass in an empty collection.

AbstractTransferDropTargetListener will be no problem, as the only subclass overwriting getExclusionSet() returns a list of edit parts, which is the correct contract.
Comment 5 Alexander Nyßen CLA 2012-03-12 13:12:34 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > What will have to be investigated in terms of client code are subclasses of
> > TargetingTool, overwriting getExlusionSet(), as well as subclasses of
> > AbstractTransferDropTargetListener, overwriting getExlusionSet() there. All
> > other implementations seem to pass in an empty collection.
> 
> AbstractTransferDropTargetListener will be no problem, as the only subclass
> overwriting getExclusionSet() returns a list of edit parts, which is the
> correct contract.

Regarding the subclasses of TargetingTool, the implementation within ConnectionEndpointTracker may be easily migrated to provide a list of edit parts rather than their figures, while the other overwriting subclass, i.e. DragEditPartsTracker is a bit more problematic, as it puts the connection layer into the exclusion set.
Comment 6 Alexander Nyßen CLA 2012-03-12 17:06:00 EDT
Created attachment 212504 [details]
Patch with proposed changes

I have create a patch that demonstrates how the current implementations could be adopted to restore the EditPartViewer#findObjectAtExcluding contract within GrahicalViewerImpl and its clients. I have the fear that restoring the contract will have to be paid with a decrease in performance (because the implementation within DragEditPartsTracker has to be adopted to traverse all edit parts with figures in the connection layer; at least this is how I currently see it), so I have not changed the code base yet but uploaded it as a patch for review.
Comment 7 Alexander Nyßen CLA 2012-05-21 04:24:52 EDT
Unassigning this and removing target milestone. This will not make it into 3.8.0, as we are past RC1 now.