jdk/src/share/classes/java/awt/dnd/DragSource.java
changeset 23588 b0269b21e313
parent 23010 6dadb192ad81
equal deleted inserted replaced
23587:55ccc7b19f84 23588:b0269b21e313
   226     /**
   226     /**
   227      * Reports
   227      * Reports
   228      * whether or not drag
   228      * whether or not drag
   229      * <code>Image</code> support
   229      * <code>Image</code> support
   230      * is available on the underlying platform.
   230      * is available on the underlying platform.
   231      * <P>
   231      *
   232      * @return if the Drag Image support is available on this platform
   232      * @return if the Drag Image support is available on this platform
   233      */
   233      */
   234 
   234 
   235     public static boolean isDragImageSupported() {
   235     public static boolean isDragImageSupported() {
   236         Toolkit t = Toolkit.getDefaultToolkit();
   236         Toolkit t = Toolkit.getDefaultToolkit();
   268      * from the hotspot of the <code>Cursor</code> at
   268      * from the hotspot of the <code>Cursor</code> at
   269      * the instant of the trigger,
   269      * the instant of the trigger,
   270      * the <code>Transferable</code> subject data
   270      * the <code>Transferable</code> subject data
   271      * of the drag, the <code>DragSourceListener</code>,
   271      * of the drag, the <code>DragSourceListener</code>,
   272      * and the <code>FlavorMap</code>.
   272      * and the <code>FlavorMap</code>.
   273      * <P>
   273      *
   274      * @param trigger        the <code>DragGestureEvent</code> that initiated the drag
   274      * @param trigger        the <code>DragGestureEvent</code> that initiated the drag
   275      * @param dragCursor     the initial {@code Cursor} for this drag operation
   275      * @param dragCursor     the initial {@code Cursor} for this drag operation
   276      *                       or {@code null} for the default cursor handling;
   276      *                       or {@code null} for the default cursor handling;
   277      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   277      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   278      *                       for more details on the cursor handling mechanism during drag and drop
   278      *                       for more details on the cursor handling mechanism during drag and drop
   280      * @param imageOffset    the offset of the <code>Image</code> origin from the hotspot
   280      * @param imageOffset    the offset of the <code>Image</code> origin from the hotspot
   281      *                       of the <code>Cursor</code> at the instant of the trigger
   281      *                       of the <code>Cursor</code> at the instant of the trigger
   282      * @param transferable   the subject data of the drag
   282      * @param transferable   the subject data of the drag
   283      * @param dsl            the <code>DragSourceListener</code>
   283      * @param dsl            the <code>DragSourceListener</code>
   284      * @param flavorMap      the <code>FlavorMap</code> to use, or <code>null</code>
   284      * @param flavorMap      the <code>FlavorMap</code> to use, or <code>null</code>
   285      * <P>
   285      *
   286      * @throws java.awt.dnd.InvalidDnDOperationException
   286      * @throws java.awt.dnd.InvalidDnDOperationException
   287      *    if the Drag and Drop
   287      *    if the Drag and Drop
   288      *    system is unable to initiate a drag operation, or if the user
   288      *    system is unable to initiate a drag operation, or if the user
   289      *    attempts to start a drag while an existing drag operation
   289      *    attempts to start a drag while an existing drag operation
   290      *    is still executing
   290      *    is still executing
   330      * that initiated the drag, the initial
   330      * that initiated the drag, the initial
   331      * <code>Cursor</code> to use,
   331      * <code>Cursor</code> to use,
   332      * the <code>Transferable</code> subject data
   332      * the <code>Transferable</code> subject data
   333      * of the drag, the <code>DragSourceListener</code>,
   333      * of the drag, the <code>DragSourceListener</code>,
   334      * and the <code>FlavorMap</code>.
   334      * and the <code>FlavorMap</code>.
   335      * <P>
   335      *
   336      * @param trigger        the <code>DragGestureEvent</code> that
   336      * @param trigger        the <code>DragGestureEvent</code> that
   337      * initiated the drag
   337      * initiated the drag
   338      * @param dragCursor     the initial {@code Cursor} for this drag operation
   338      * @param dragCursor     the initial {@code Cursor} for this drag operation
   339      *                       or {@code null} for the default cursor handling;
   339      *                       or {@code null} for the default cursor handling;
   340      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   340      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   341      *                       for more details on the cursor handling mechanism during drag and drop
   341      *                       for more details on the cursor handling mechanism during drag and drop
   342      * @param transferable   the subject data of the drag
   342      * @param transferable   the subject data of the drag
   343      * @param dsl            the <code>DragSourceListener</code>
   343      * @param dsl            the <code>DragSourceListener</code>
   344      * @param flavorMap      the <code>FlavorMap</code> to use or <code>null</code>
   344      * @param flavorMap      the <code>FlavorMap</code> to use or <code>null</code>
   345      * <P>
   345      *
   346      * @throws java.awt.dnd.InvalidDnDOperationException
   346      * @throws java.awt.dnd.InvalidDnDOperationException
   347      *    if the Drag and Drop
   347      *    if the Drag and Drop
   348      *    system is unable to initiate a drag operation, or if the user
   348      *    system is unable to initiate a drag operation, or if the user
   349      *    attempts to start a drag while an existing drag operation
   349      *    attempts to start a drag while an existing drag operation
   350      *    is still executing
   350      *    is still executing
   366      * the offset of the <code>Image</code> origin
   366      * the offset of the <code>Image</code> origin
   367      * from the hotspot of the <code>Cursor</code>
   367      * from the hotspot of the <code>Cursor</code>
   368      * at the instant of the trigger,
   368      * at the instant of the trigger,
   369      * the subject data of the drag, and
   369      * the subject data of the drag, and
   370      * the <code>DragSourceListener</code>.
   370      * the <code>DragSourceListener</code>.
   371      * <P>
   371      *
   372      * @param trigger           the <code>DragGestureEvent</code> that initiated the drag
   372      * @param trigger           the <code>DragGestureEvent</code> that initiated the drag
   373      * @param dragCursor     the initial {@code Cursor} for this drag operation
   373      * @param dragCursor     the initial {@code Cursor} for this drag operation
   374      *                       or {@code null} for the default cursor handling;
   374      *                       or {@code null} for the default cursor handling;
   375      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   375      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a>
   376      *                       for more details on the cursor handling mechanism during drag and drop
   376      *                       for more details on the cursor handling mechanism during drag and drop
   377      * @param dragImage         the <code>Image</code> to drag or <code>null</code>
   377      * @param dragImage         the <code>Image</code> to drag or <code>null</code>
   378      * @param dragOffset        the offset of the <code>Image</code> origin from the hotspot
   378      * @param dragOffset        the offset of the <code>Image</code> origin from the hotspot
   379      *                          of the <code>Cursor</code> at the instant of the trigger
   379      *                          of the <code>Cursor</code> at the instant of the trigger
   380      * @param transferable      the subject data of the drag
   380      * @param transferable      the subject data of the drag
   381      * @param dsl               the <code>DragSourceListener</code>
   381      * @param dsl               the <code>DragSourceListener</code>
   382      * <P>
   382      *
   383      * @throws java.awt.dnd.InvalidDnDOperationException
   383      * @throws java.awt.dnd.InvalidDnDOperationException
   384      *    if the Drag and Drop
   384      *    if the Drag and Drop
   385      *    system is unable to initiate a drag operation, or if the user
   385      *    system is unable to initiate a drag operation, or if the user
   386      *    attempts to start a drag while an existing drag operation
   386      *    attempts to start a drag while an existing drag operation
   387      *    is still executing
   387      *    is still executing
   401      * that initiated the drag, the initial
   401      * that initiated the drag, the initial
   402      * <code>Cursor</code> to
   402      * <code>Cursor</code> to
   403      * use,
   403      * use,
   404      * the <code>Transferable</code> subject data
   404      * the <code>Transferable</code> subject data
   405      * of the drag, and the <code>DragSourceListener</code>.
   405      * of the drag, and the <code>DragSourceListener</code>.
   406      * <P>
   406      *
   407      * @param trigger           the <code>DragGestureEvent</code> that initiated the drag
   407      * @param trigger        the <code>DragGestureEvent</code> that initiated the drag
   408      * @param dragCursor     the initial {@code Cursor} for this drag operation
   408      * @param dragCursor     the initial {@code Cursor} for this drag operation
   409      *                       or {@code null} for the default cursor handling;
   409      *                       or {@code null} for the default cursor handling;
   410      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a> class
   410      *                       see <a href="DragSourceContext.html#defaultCursor">DragSourceContext</a> class
   411      *                       for more details on the cursor handling mechanism during drag and drop
   411      *                       for more details on the cursor handling mechanism during drag and drop
   412      * @param transferable      the subject data of the drag
   412      * @param transferable      the subject data of the drag
   413      * @param dsl               the <code>DragSourceListener</code>
   413      * @param dsl               the <code>DragSourceListener</code>
   414      * <P>
   414      *
   415      * @throws java.awt.dnd.InvalidDnDOperationException
   415      * @throws java.awt.dnd.InvalidDnDOperationException
   416      *    if the Drag and Drop
   416      *    if the Drag and Drop
   417      *    system is unable to initiate a drag operation, or if the user
   417      *    system is unable to initiate a drag operation, or if the user
   418      *    attempts to start a drag while an existing drag operation
   418      *    attempts to start a drag while an existing drag operation
   419      *    is still executing
   419      *    is still executing
   478     }
   478     }
   479 
   479 
   480     /**
   480     /**
   481      * This method returns the
   481      * This method returns the
   482      * <code>FlavorMap</code> for this <code>DragSource</code>.
   482      * <code>FlavorMap</code> for this <code>DragSource</code>.
   483      * <P>
   483      *
   484      * @return the <code>FlavorMap</code> for this <code>DragSource</code>
   484      * @return the <code>FlavorMap</code> for this <code>DragSource</code>
   485      */
   485      */
   486 
   486 
   487     public FlavorMap getFlavorMap() { return flavorMap; }
   487     public FlavorMap getFlavorMap() { return flavorMap; }
   488 
   488 
   492      * abstract subclass of
   492      * abstract subclass of
   493      * <code>DragGestureRecognizer</code>, and
   493      * <code>DragGestureRecognizer</code>, and
   494      * sets the specified <code>Component</code>
   494      * sets the specified <code>Component</code>
   495      * and <code>DragGestureListener</code> on
   495      * and <code>DragGestureListener</code> on
   496      * the newly created object.
   496      * the newly created object.
   497      * <P>
   497      *
   498      * @param <T> the type of {@code DragGestureRecognizer} to create
   498      * @param <T> the type of {@code DragGestureRecognizer} to create
   499      * @param recognizerAbstractClass the requested abstract type
   499      * @param recognizerAbstractClass the requested abstract type
   500      * @param actions                 the permitted source drag actions
   500      * @param actions                 the permitted source drag actions
   501      * @param c                       the <code>Component</code> target
   501      * @param c                       the <code>Component</code> target
   502      * @param dgl        the <code>DragGestureListener</code> to notify
   502      * @param dgl        the <code>DragGestureListener</code> to notify
   503      * <P>
   503      *
   504      * @return the new <code>DragGestureRecognizer</code> or <code>null</code>
   504      * @return the new <code>DragGestureRecognizer</code> or <code>null</code>
   505      *    if the <code>Toolkit.createDragGestureRecognizer</code> method
   505      *    if the <code>Toolkit.createDragGestureRecognizer</code> method
   506      *    has no implementation available for
   506      *    has no implementation available for
   507      *    the requested <code>DragGestureRecognizer</code>
   507      *    the requested <code>DragGestureRecognizer</code>
   508      *    subclass and returns <code>null</code>
   508      *    subclass and returns <code>null</code>
   526      * and <code>DragGestureListener</code> on the
   526      * and <code>DragGestureListener</code> on the
   527      * newly created object.
   527      * newly created object.
   528      *
   528      *
   529      * For this <code>DragSource</code>
   529      * For this <code>DragSource</code>
   530      * the default is <code>MouseDragGestureRecognizer</code>.
   530      * the default is <code>MouseDragGestureRecognizer</code>.
   531      * <P>
   531      *
   532      * @param c       the <code>Component</code> target for the recognizer
   532      * @param c       the <code>Component</code> target for the recognizer
   533      * @param actions the permitted source actions
   533      * @param actions the permitted source actions
   534      * @param dgl     the <code>DragGestureListener</code> to notify
   534      * @param dgl     the <code>DragGestureListener</code> to notify
   535      * <P>
   535      *
   536      * @return the new <code>DragGestureRecognizer</code> or <code>null</code>
   536      * @return the new <code>DragGestureRecognizer</code> or <code>null</code>
   537      *    if the <code>Toolkit.createDragGestureRecognizer</code> method
   537      *    if the <code>Toolkit.createDragGestureRecognizer</code> method
   538      *    has no implementation available for
   538      *    has no implementation available for
   539      *    the requested <code>DragGestureRecognizer</code>
   539      *    the requested <code>DragGestureRecognizer</code>
   540      *    subclass and returns <code>null</code>
   540      *    subclass and returns <code>null</code>