diff --git a/projects/samskivert/src/java/com/samskivert/swing/dnd/DnDManager.java b/projects/samskivert/src/java/com/samskivert/swing/dnd/DnDManager.java index 7cd56814..4ee4464e 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/dnd/DnDManager.java +++ b/projects/samskivert/src/java/com/samskivert/swing/dnd/DnDManager.java @@ -1,5 +1,5 @@ // -// $Id: DnDManager.java,v 1.2 2002/08/20 21:05:10 ray Exp $ +// $Id: DnDManager.java,v 1.3 2002/08/20 22:38:42 ray Exp $ package com.samskivert.swing.dnd; @@ -104,7 +104,7 @@ public class DnDManager _source = (DragSource) _draggers.get(_sourceComp); // make sure the source wants to start a drag. - if (!_source.startDrag(_cursors, _data)) { + if ((_source == null) || (!_source.startDrag(_cursors, _data))) { // if not, reset our start conditions and bail reset(); return; @@ -166,10 +166,13 @@ public class DnDManager */ protected void mouseExited (MouseEvent event) { - _lastTarget = null; if (_lastComp != null) { _lastComp.setCursor(_oldCursor); } + if (_lastTarget != null) { + _lastTarget.noDrop(); + _lastTarget = null; + } } /** diff --git a/projects/samskivert/src/java/com/samskivert/swing/dnd/DropTarget.java b/projects/samskivert/src/java/com/samskivert/swing/dnd/DropTarget.java index 82832d31..4c29bbc3 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/dnd/DropTarget.java +++ b/projects/samskivert/src/java/com/samskivert/swing/dnd/DropTarget.java @@ -1,5 +1,5 @@ // -// $Id: DropTarget.java,v 1.1 2002/08/20 02:49:19 ray Exp $ +// $Id: DropTarget.java,v 1.2 2002/08/20 22:38:42 ray Exp $ package com.samskivert.swing.dnd; @@ -11,9 +11,20 @@ public interface DropTarget { /** * Return true if the specified drop should be allowed on this target. + * Also indicates that a hover has started in case the drop target would + * like to create dragover feedback aside from the cursor feedback. + * + * If this method returns true then either dropCompleted or hoverEnd + * will be called next. */ public boolean checkDrop (DragSource source, Object peekdata); + /** + * Called to let the DropTarget know that we've stopped hovering over + * but did not actually drop. + */ + public void noDrop (); + /** * Called when the drop is actually executed. */