| Summary: | NPE in logo example on shift-drag | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Frank Benoit <frank.rene.benoit> |
| Component: | GEF MVC | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.wienand, nyssen |
| Version: | unspecified | ||
| Target Milestone: | 4.0.0 / 3.11.0 (Neon) M4 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Frank Benoit
I can reproduce this with the current HEAD revision. The NPE originates from a selection change in-between the #press(), #drag(), and #release() calls within the FXTranslateSelectedOnDragPolicy. Within #press() an initialization is performed for each target part. The information that is saved for the target parts is then later evaluated within #drag() and #release(). However, if the selection changes in-between (due to cloning of the host part), the translation is not correctly initialized for the new target parts. To resolve the issue, cloning could be implemented via a CloneOnClickPolicy that exclusively selects the clone. As dragging is processed after clicking, the clone's *OnDrag policies would receive #press(), #drag(), and #release() while the original host would not receive any of these events. Additionally, we should consider implementing a generic mechanism to determine and save the target parts for all interaction policies. This could be done in the context of bug #481810. I ensured that cloning solely selects the cloned content part instead of appending it to the current selection. Moreover, I combined the FXFocusAndSelectOnClickPolicy and the FXCloneOnClickPolicy to one FXCloneOrFocusAndSelectOnClickPolicy, so that either cloning or focusing and selecting is performed on click, but not both. Furthermore, I ensured that content anchorages are only detached/attached if necessary to prevent an exception when cloning a connection. The code is published on the master branch. Therefore, I resolve this ticket as fixed for 3.11.0M4. |