JavaTM 2 Platform
Std. Ed. v1.3.1

com.apple.mrj.dnd
Interface DragInitiatorListener

All Superinterfaces:
EventListener, MouseListener
All Known Implementing Classes:
DragInitiatorAdapter

Deprecated. As of MacOSX 10.2, replaced by Java2 DnD.

public interface DragInitiatorListener
extends MouseListener

A listener for outgoing drag/drop operations -- to make a Component or part of its display draggable, add such a listener to it and in response to a dragGesture call, add items/flavors to the drag. The dragCompleted method will then be called after the drag completes.

There's obviously no addDragInitiatorListener method on Component, so use addMouseListener and removeMouseListener instead.

See Also:
DragInitiatorEvent, DragInitiatorAdapter, Component.addMouseListener(java.awt.event.MouseListener), Component.removeMouseListener(java.awt.event.MouseListener)

Method Summary
 void dragCompleted(DragInitiatorEvent e)
          Deprecated. Called after a drag initiated by the dragGesture method has been completed successfully, with the data accepted by a receiver.
 void dragFailed(DragInitiatorEvent e)
          Deprecated. Called after a drag initiated by the dragGesture method has ended without the data being accepted -- either it was dropped someplace that's not drag sensitive (i.e.
 void dragGesture(DragInitiatorEvent e)
          Deprecated. Called when the user begins a dragging gesture -- i.e.
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
 

Method Detail

dragGesture

public void dragGesture(DragInitiatorEvent e)
Deprecated. 
Called when the user begins a dragging gesture -- i.e. after the mouse has been pressed and moved 4 pixels. If the listener decides to initiate a drag-n-drop, it should then call getDrag on the DragInitiatorEvent and add one or more items to the OutgoingDrag before returning. (If getDrag is not called, or no items are added to the OutgoingDrag, no drag will be initiated.)

dragCompleted

public void dragCompleted(DragInitiatorEvent e)
Deprecated. 
Called after a drag initiated by the dragGesture method has been completed successfully, with the data accepted by a receiver. The listener can check the OutgoingDrag in the DragInitiatorEvent to see where the data was dropped and what the drag modifiers are.
See Also:
Drag.getDestination(), Drag#getDropLocation, Drag#getModifiers

dragFailed

public void dragFailed(DragInitiatorEvent e)
Deprecated. 
Called after a drag initiated by the dragGesture method has ended without the data being accepted -- either it was dropped someplace that's not drag sensitive (i.e. the menubar) or the target of the drag couldn't accept any of the data.

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.