jdk/src/java.desktop/share/classes/java/awt/dnd/package.html
author chegar
Sun, 17 Aug 2014 15:54:13 +0100
changeset 25859 3317bb8137f4
parent 23010 jdk/src/share/classes/java/awt/dnd/package.html@6dadb192ad81
permissions -rw-r--r--
8054834: Modular Source Code Reviewed-by: alanb, chegar, ihse, mduigou Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, chris.hegarty@oracle.com, erik.joelsson@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, magnus.ihse.bursie@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, paul.sandoz@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
<!--
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 21254
diff changeset
     2
 Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
<html>
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    28
<head><title></title></head>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
<body bgcolor="white">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
Drag and Drop is a direct manipulation gesture found in many Graphical
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
User Interface systems that provides a mechanism to transfer
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
information between two entities logically associated with presentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
elements in the GUI. Normally driven by a physical gesture of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
human user using an appropriate input device, Drag and Drop provides both
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
a mechanism to enable continuous feedback regarding the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
possible outcome of any subsequent data transfer to the user during
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
navigation over the presentation elements in the GUI, and the facilities
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
to provide for any subsequent data negotiation and transfer. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
This package defines the classes and interfaces necessary to perform Drag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
and Drop operations in Java. It
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
defines classes for the drag-source and the drop-target, as well as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
events for transferring the data being dragged. This package also provides
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
a means for giving visual feedback to the user throughout the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
duration of the Drag and Drop operation. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
A typical Drag and Drop operation can be decomposed into the following
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
states (not entirely sequentially): 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
<LI>A <code>DragSource</code> comes into existence, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
associated with some presentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
element (<code>Component</code>) in the GUI, to initiate a Drag and Drop of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
some potentially <code>Transferable</code> data. 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    55
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
<LI>1 or more <code>DropTarget</code>(s) come into/go out of 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
existence, associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
with presentation elements in the GUI (Components), potentially
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
capable of consuming <code>Transferable</code> data types. 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    60
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
<LI> A <code>DragGestureRecognizer</code> is 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
obtained from the <code>DragSource</code> and is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
associated with a <code>Component</code> in order 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
to track and identify any Drag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
initiating gesture by the user over the <code>Component</code>. 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    66
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
<LI> A user makes a Drag gesture over the <code>Component</code>, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
which the registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
<code>DragGestureRecognizer</code> detects, and notifies its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
<code>DragGestureListener</code> of. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
Note: Although this API consistently refers to the stimulus for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
drag and drop operation being a physical gesture by a human user, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
does not preclude a programmatically driven DnD operation given the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
appropriate implementation of a <code>DragSource</code>. This package
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
contains the abstract class <code>MouseDragGestureRecognizer</code> for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
recognizing mouse device gestures. Other abstract subclasses may be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
provided by the platform to support other input devices or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
particular <code>Component</code> class semantics. 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    80
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
<LI> The <code>DragGestureListener</code> causes the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
<code>DragSource</code> to initiate the Drag
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
and Drop operation on behalf of the user, perhaps animating the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
GUI Cursor and/or rendering an <code>Image</code> of the item(s) that are the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
subject of the operation.
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
    86
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
<LI> As the user gestures navigate over <code>Component</code>(s) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
in the GUI with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
associated <code>DropTarget</code>(s), the <code>DragSource</code> 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
receives notifications in order
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
to provide "Drag Over" feedback effects, and the <code>DropTarget</code>(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
receive notifications in order to provide "Drag Under" feedback effects
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
based upon the operation(s) supported and the data type(s) involved. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
The gesture itself moves a logical cursor across the GUI hierarchy,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
intersecting the geometry of GUI Component(s), possibly resulting in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
the logical "Drag" cursor entering, crossing, and subsequently
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
leaving <code>Component</code>(s) and associated <code>DropTarget</code>(s). 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
The <code>DragSource</code> object manifests "Drag Over" feedback to the user, in the typical case by animating the GUI <code>Cursor</code> associated with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
logical cursor. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
<code>DropTarget</code> objects manifest "Drag Under" feedback to the user, in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
the typical case, by rendering animations into their associated GUI
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
<code>Component</code>(s) under the GUI Cursor. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
<P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
The determination of the feedback effects, and the ultimate success
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
or failure of the data transfer, should one occur, is parameterized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
as follows: 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
<UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
<LI> By the transfer "operation" selected by the user, and supported by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
both the <code>DragSource</code> and <code>DropTarget</code>: Copy, Move or Reference(link). 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
   115
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
<LI> By the intersection of the set of data types provided by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
<code>DragSource</code> and the set of data types comprehensible by the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
<code>DropTarget</code>. 
21254
f6d36ee3f269 8025824: [cleanup] Fix tidy errors and warnings in preformatted HTML files related to 2d/awt/swing
yan
parents: 5506
diff changeset
   119
<br><br>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
<LI>When the user terminates the drag operation, normally resulting in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
successful Drop, both the <code>DragSource</code> and <code>DropTarget</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
receive
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
notifications that include, and result in the type negotiation and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
transfer of, the information associated with the <code>DragSource</code> via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
<code>Transferable</code> object. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
</UL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
<!--
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
<h2>Package Specification</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
<ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
  <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
<h2>Related Documentation</h2>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
For overviews, tutorials, examples, guides, and tool documentation, please see:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
<ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
</ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
-->
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
@since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
</body>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
</html>