| 
 | JavaTM 2 Platform Std. Ed. v1.3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--java.awt.dnd.DragSource
The DragSource is the entity responsible 
 for the initiation of the Drag
 and Drop operation, and may be used in a number of scenarios: 
 
Component, or application specific
 object associated with a Component 
 instance in the GUI. [implementation dependent] 
 DragSource is 
 obtained, a DragGestureRecognizer should
 also be obtained to associate the DragSource
 with a particular
 Component. 
 
 The initial interpretation of the user's gesture, 
 and the subsequent starting of the drag operation 
 are the responsibility of the implementing
 Component, which is usually 
 implemented by a DragGestureRecognizer. 
 When a drag gesture occurs, the 
 DragSource's 
 startDrag() method shall be
 invoked in order to cause processing 
 of the user's navigational
 gestures and delivery of Drag and Drop 
 protocol notifications. A
 DragSource shall only 
 permit a single Drag and Drop operation to be
 current at any one time, and shall 
 reject any further startDrag() requests
 by throwing an IllegalDnDOperationException 
 until such time as the extant operation is complete. 
 
 The startDrag() method invokes the 
 createDragSourceContext() method to
 instantiate an appropriate 
 DragSourceContext 
 and associate the DragSourceContextPeer
 with that. 
 
 If the Drag and Drop System is 
 unable to initiate a drag operation for
 some reason, the startDrag() method throws 
 a java.awt.dnd.InvalidDnDOperationException
 to signal such a condition. Typically this 
 exception is thrown when the underlying platform
 system is either not in a state to 
 initiate a drag, or the parameters specified are invalid. 
 
 Note that during the drag, the 
 set of operations exposed by the source
 at the start of the drag operation may not change 
 until the operation is complete. 
 The operation(s) are constant for the
 duration of the operation with respect to the 
 DragSource.
| Field Summary | |
| static Cursor | DefaultCopyDropThe default Cursorto use with a copy operation 
 indicating that a drop is currently allowed. | 
| static Cursor | DefaultCopyNoDropThe default Cursorto use with 
 a copy operation indicating that a drop is currently not allowed. | 
| static Cursor | DefaultLinkDropThe default Cursorto use with a 
 link operation indicating that a 
 drop is currently allowed. | 
| static Cursor | DefaultLinkNoDropThe default Cursorto use 
 with a link operation indicating 
 that a drop is currently not allowed. | 
| static Cursor | DefaultMoveDropThe default Cursorto use 
 with a move operation indicating that 
 a drop is currently allowed. | 
| static Cursor | DefaultMoveNoDropThe default Cursorto use with a move 
 operation indicating that a drop is currently not allowed. | 
| Constructor Summary | |
| DragSource()Construct a new DragSource. | |
| Method Summary | |
|  DragGestureRecognizer | createDefaultDragGestureRecognizer(Component c,
                                   int actions,
                                   DragGestureListener dgl)Creates a new DragSourceRecognizerthat implements the default
 abstract subclass ofDragGestureRecognizerfor thisDragSource,
 and sets the specifiedComponentandDragGestureListeneron the
 newly created object. | 
|  DragGestureRecognizer | createDragGestureRecognizer(Class recognizerAbstractClass,
                            Component c,
                            int actions,
                            DragGestureListener dgl)Creates a new DragGestureRecognizerthat implements the specified
 abstract subclass ofDragGestureRecognizer, and 
 sets the specifiedComponentandDragGestureListeneron 
 the newly created object. | 
| protected  DragSourceContext | createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp,
                        DragGestureEvent dgl,
                        Cursor dragCursor,
                        Image dragImage,
                        Point imageOffset,
                        Transferable t,
                        DragSourceListener dsl)Create the DragSourceContextto handle this drag. | 
| static DragSource | getDefaultDragSource()This method returns the DragSourceobject associated with the underlying platform. | 
|  FlavorMap | getFlavorMap()This method returns the FlavorMapfor thisDragSource. | 
| static boolean | isDragImageSupported()This method returns a booleanindicating whether or not dragImagesupport 
 is available on the underlying platform. | 
|  void | startDrag(DragGestureEvent trigger,
          Cursor dragCursor,
          Image dragImage,
          Point dragOffset,
          Transferable transferable,
          DragSourceListener dsl)Start a drag, given the DragGestureEventthat initiated the drag, the initialCursorto use,
 theImageto drag, 
 the offset of theImageorigin 
 from the hotspot of theCursorat the instant of the trigger,
 the subject data of the drag, and 
 theDragSourceListener. | 
|  void | startDrag(DragGestureEvent trigger,
          Cursor dragCursor,
          Image dragImage,
          Point imageOffset,
          Transferable transferable,
          DragSourceListener dsl,
          FlavorMap flavorMap)Start a drag, given the DragGestureEventthat initiated the drag, the initialCursorto use,
 theImageto drag, 
 the offset of theImageorigin 
 from the hotspot of theCursorat 
 the instant of the trigger,
 theTransferablesubject data 
 of the drag, theDragSourceListener, 
 and theFlavorMap. | 
|  void | startDrag(DragGestureEvent trigger,
          Cursor dragCursor,
          Transferable transferable,
          DragSourceListener dsl)Start a drag, given the DragGestureEventthat initiated the drag, the initialCursorto 
 use, 
 theTransferablesubject data 
 of the drag, and theDragSourceListener. | 
|  void | startDrag(DragGestureEvent trigger,
          Cursor dragCursor,
          Transferable transferable,
          DragSourceListener dsl,
          FlavorMap flavorMap)Start a drag, given the DragGestureEventthat initiated the drag, the initialCursorto use,
 theTransferablesubject data 
 of the drag, theDragSourceListener, 
 and theFlavorMap. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final Cursor DefaultCopyDrop
Cursor to use with a copy operation 
 indicating that a drop is currently allowed.public static final Cursor DefaultMoveDrop
Cursor to use 
 with a move operation indicating that 
 a drop is currently allowed.public static final Cursor DefaultLinkDrop
Cursor to use with a 
 link operation indicating that a 
 drop is currently allowed.public static final Cursor DefaultCopyNoDrop
Cursor to use with 
 a copy operation indicating that a drop is currently not allowed.public static final Cursor DefaultMoveNoDrop
Cursor to use with a move 
 operation indicating that a drop is currently not allowed.public static final Cursor DefaultLinkNoDrop
Cursor to use 
 with a link operation indicating 
 that a drop is currently not allowed.| Constructor Detail | 
public DragSource()
DragSource.| Method Detail | 
public static DragSource getDefaultDragSource()
DragSource 
 object associated with the underlying platform.
 public static boolean isDragImageSupported()
boolean 
 indicating whether or not drag 
 Image support 
 is available on the underlying platform.
 public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable transferable, DragSourceListener dsl, FlavorMap flavorMap) throws InvalidDnDOperationException
DragGestureEvent 
 that initiated the drag, the initial 
 Cursor to use,
 the Image to drag, 
 the offset of the Image origin 
 from the hotspot of the Cursor at 
 the instant of the trigger,
 the Transferable subject data 
 of the drag, the DragSourceListener, 
 and the FlavorMap. 
 trigger - The DragGestureEvent that initiated the dragdragCursor - The initial Cursor or null for defaultsdragImage - The image to drag or null,imageOffset - The offset of the Image origin from the hotspot
			     of the Cursor at the instant of the triggertransferable - The subject data of the dragdsl - The DragSourceListenerflavorMap - The FlavorMap to use, or null
 java.awt.dnd.InvalidDnDOperationExceptionpublic void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable transferable, DragSourceListener dsl, FlavorMap flavorMap) throws InvalidDnDOperationException
DragGestureEvent 
 that initiated the drag, the initial 
 Cursor to use,
 the Transferable subject data 
 of the drag, the DragSourceListener, 
 and the FlavorMap. 
 trigger - The DragGestureEvent that 
 initiated the dragdragCursor - The initial Cursor or 
 null for defaultstransferable - The subject data of the dragdsl - The DragSourceListenerflavorMap - The FlavorMap to use or null
 - Throws:
- java.awt.dnd.InvalidDnDOperationException
public void startDrag(DragGestureEvent trigger, Cursor dragCursor, Image dragImage, Point dragOffset, Transferable transferable, DragSourceListener dsl) throws InvalidDnDOperationException
DragGestureEvent 
 that initiated the drag, the initial Cursor 
 to use,
 the Image to drag, 
 the offset of the Image origin 
 from the hotspot of the Cursor
 at the instant of the trigger,
 the subject data of the drag, and 
 the DragSourceListener. 
 trigger - The DragGestureEvent that initiated the dragdragCursor - The initial Cursor or null for defaultsdragImage - The Image to drag or nullimageOffset - The offset of the Image origin from the hotspot
				of the Cursor at the instant of the triggertransferable - The subject data of the dragdsl - The DragSourceListener
 java.awt.dnd.InvalidDnDOperationExceptionpublic void startDrag(DragGestureEvent trigger, Cursor dragCursor, Transferable transferable, DragSourceListener dsl) throws InvalidDnDOperationException
DragGestureEvent 
 that initiated the drag, the initial 
 Cursor to 
 use, 
 the Transferable subject data 
 of the drag, and the DragSourceListener. 
 trigger - The DragGestureEvent that initiated the dragdragCursor - The initial Cursor or null for defaultstransferable - The subject data of the dragdsl - The DragSourceListener
 java.awt.dnd.InvalidDnDOperationExceptionprotected DragSourceContext createDragSourceContext(java.awt.dnd.peer.DragSourceContextPeer dscp, DragGestureEvent dgl, Cursor dragCursor, Image dragImage, Point imageOffset, Transferable t, DragSourceListener dsl)
DragSourceContext to handle this drag.
 
 To incorporate a new DragSourceContext 
 subclass, subclass DragSource and
 override this method.
 dscp - The DragSourceContextPeer for this dragtrigger - The DragGestureEvent that triggered the dragdragCursor - The initial Cursor to displaydragImage - The Image to drag or nullimageOffset - The offset of the Image origin from the hotspot
				of the cursor at the instant of the triggertransferable - The subject data of the dragdsl - The DragSourceListener
 DragSourceContextpublic FlavorMap getFlavorMap()
FlavorMap for this DragSource.
 FlavorMap for this DragSourcepublic DragGestureRecognizer createDragGestureRecognizer(Class recognizerAbstractClass, Component c, int actions, DragGestureListener dgl)
DragGestureRecognizer 
 that implements the specified
 abstract subclass of 
 DragGestureRecognizer, and 
 sets the specified Component 
 and DragGestureListener on 
 the newly created object.
 recognizerAbstractClass - The requested abstract typeactions - The permitted source drag actionsc - The Component targetdgl - The DragGestureListener to notify
 DragGestureRecognizer or null
 if the Toolkit.createDragGestureRecognizer() method
 has no implementation available for 
 the requested DragGestureRecognizer
 subclass and returns null.public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl)
DragSourceRecognizer 
 that implements the default
 abstract subclass of DragGestureRecognizer
 for this DragSource,
 and sets the specified Component 
 and DragGestureListener on the
 newly created object. 
 For this DragSource 
 the default is MouseDragGestureRecognizer.
 c - The Component target for the recognizeractions - The permitted source actionsdgl - The DragGestureListener to notify
 DragGestureRecognizer or null
 if the Toolkit.createDragGestureRecognizer() method
 has no implementation available for 
 the requested DragGestureRecognizer
 subclass and returns null.| 
 | JavaTM 2 Platform Std. Ed. v1.3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.