Use screen coordinates since we can have lots of components for the same target.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1670 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -432,8 +432,6 @@ public class DnDManager
|
||||
return;
|
||||
}
|
||||
|
||||
Component lastComp = _lastComp;
|
||||
|
||||
// reset cursors
|
||||
clearComponentCursor(); // _lastComp cleared here
|
||||
_topComp.setCursor(_topCursor);
|
||||
@@ -441,8 +439,8 @@ public class DnDManager
|
||||
// get the last target seen...
|
||||
if (_lastTarget != null) {
|
||||
// determine drop location
|
||||
Point pos = SwingUtilities.convertPoint(event.getComponent(),
|
||||
event.getPoint(), lastComp);
|
||||
Point pos = event.getPoint();
|
||||
SwingUtilities.convertPointToScreen(pos, event.getComponent());
|
||||
_lastTarget.dropCompleted(_source, _data[0], pos);
|
||||
_source.dragCompleted(_lastTarget);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public interface DropTarget
|
||||
|
||||
/**
|
||||
* Called when the drop is actually executed.
|
||||
*
|
||||
* @param pos the location of the drop in screen coordinates
|
||||
*/
|
||||
public void dropCompleted (DragSource source, Object data, Point pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user