Added drop location to dropCompleted method.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1668 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -20,6 +20,7 @@ import java.awt.event.MouseEvent;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
|
|
||||||
import javax.swing.event.AncestorEvent;
|
import javax.swing.event.AncestorEvent;
|
||||||
@@ -431,13 +432,17 @@ public class DnDManager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// determine drop location
|
||||||
|
Point pos = SwingUtilities.convertPoint(event.getComponent(),
|
||||||
|
event.getPoint(), _lastComp);
|
||||||
|
|
||||||
// reset cursors
|
// reset cursors
|
||||||
clearComponentCursor();
|
clearComponentCursor();
|
||||||
_topComp.setCursor(_topCursor);
|
_topComp.setCursor(_topCursor);
|
||||||
|
|
||||||
// get the last target seen...
|
// get the last target seen...
|
||||||
if (_lastTarget != null) {
|
if (_lastTarget != null) {
|
||||||
_lastTarget.dropCompleted(_source, _data[0]);
|
_lastTarget.dropCompleted(_source, _data[0], pos);
|
||||||
_source.dragCompleted(_lastTarget);
|
_source.dragCompleted(_lastTarget);
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
package com.samskivert.swing.dnd;
|
package com.samskivert.swing.dnd;
|
||||||
|
|
||||||
|
import java.awt.Point;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A drop target is associated with a component and represents a valid
|
* A drop target is associated with a component and represents a valid
|
||||||
* place to end a drag and drop.
|
* place to end a drag and drop.
|
||||||
@@ -29,5 +31,5 @@ public interface DropTarget
|
|||||||
/**
|
/**
|
||||||
* Called when the drop is actually executed.
|
* Called when the drop is actually executed.
|
||||||
*/
|
*/
|
||||||
public void dropCompleted (DragSource source, Object data);
|
public void dropCompleted (DragSource source, Object data, Point pos);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user