|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejava.awt.dnd
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
TheClass DragSource, constructor DragSource()DragSource
is the entity responsible for the initiation of the Drag and Drop operation and may be used in a number of scenarios:Once the
- 1 default instance per JVM for the lifetime of that JVM.
- 1 instance per class of potential Drag Initiator object (e.g TextField). [implementation dependent]
- 1 per instance of a particular
Component
or application specific object associated with aComponent
instance in the GUI. [implementation dependent]- Some other arbitrary association. [implementation dependent]
DragSource
is obtained aDragGestureRecognizer
should also be obtained to associate theDragSource
with a particularComponent
.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 aDragGestureRecognizer
.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. ADragSource
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 anIllegalDnDOperationException
until such time as the extant operation is complete.The startDrag() method invokes the createDragSourceContext() method to instantiate an appropriate
DragSourceContext
and associate theDragSourceContextPeer
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
. @version 1.37 1240 04/0325/0102 @since 1.2
Class DragSource, void addDragSourceListener(DragSourceListener)ConstructCreates a newDragSource
. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DragSource, void addDragSourceMotionListener(DragSourceMotionListener)AddAdds the specifiedDragSourceListener
to thisDragSource
to receive drag source events during drag operations intiated with thisDragSource
. If anull
listener is specified no action is taken and no exception is thrown. @param dsl theDragSourceListener
to add.@see #removeDragSourceListener @see #getDragSourceListeners @since 1.4
Class DragSource, DragGestureRecognizer createDefaultDragGestureRecognizer(Component, int, DragGestureListener)AddAdds the specifiedDragSourceMotionListener
to thisDragSource
to receive drag motion events during drag operations intiated with thisDragSource
. If anull
listener is specified no action is taken and no exception is thrown. @param dsl theDragSourceMotionListener
to add.@see #removeDragSourceMotionListener @see #getDragSourceMotionListeners @since 1.4
Creates a newClass DragSource, DragGestureRecognizer createDragGestureRecognizer(Class, Component, int, DragGestureListener)that implements the default abstract subclass of
DragSourceRecognizerDragGestureRecognizerDragGestureRecognizer
for thisDragSource
and sets the specifiedComponent
andDragGestureListener
on the newly created object. For thisDragSource
the default isMouseDragGestureRecognizer
.@param c
ThetheComponent
target for the recognizer @param actionsThethe permitted source actions @param dglThetheDragGestureListener
to notify@return the new
DragGestureRecognizer
ornull
if theToolkit.createDragGestureRecognizer
method has no implementation available for the requested()DragGestureRecognizer
subclass and returnsnull
.
Creates a newClass DragSource, DragSourceContext createDragSourceContext(DragSourceContextPeer, DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)DragGestureRecognizer
that implements the specified abstract subclass ofDragGestureRecognizer
and sets the specifiedComponent
andDragGestureListener
on the newly created object.@param recognizerAbstractClass
Thethe requested abstract type @param actionsThethe permitted source drag actions @param cThetheComponent
target @param dglThetheDragGestureListener
to notify@return the new
DragGestureRecognizer
ornull
if theToolkit.createDragGestureRecognizer
method has no implementation available for the requested()DragGestureRecognizer
subclass and returnsnull
.
Class DragSource, DragSource getDefaultDragSource()CreateCreates theDragSourceContext
to handle this drag.To incorporate a new
DragSourceContext
subclass subclassDragSource
and override this method.If
dragImage
isnull
no image is used to represent the drag over feedback for this drag operation butNullPointerException
is not thrown.If
dsl
isnull
no drag source listener is registered with the createdDragSourceContext
butNullPointerException
is not thrown.If
@param dscp ThedragCursor
isnull
the default drag cursors are used for this drag operation.NullPointerException
is not thrown.DragSourceContextPeer
for this drag @paramtriggerdgl TheDragGestureEvent
that triggered the drag @param dragCursor The initialCursor
to display @param dragImage TheImage
to drag ornull
@param imageOffset The offset of theImage
origin from the hotspot of the cursor at the instant of the trigger @paramtransferablet The subject data of the drag @param dsl TheDragSourceListener
@return theDragSourceContext
@throws NullPointerException ifdscp
isnull
@throws NullPointerException ifdgl
isnull
@throws NullPointerException ifdragImage
is notnull
andimageOffset
isnull
@throws NullPointerException ift
isnull
@throws IllegalArgumentException if theComponent
associated with the trigger event isnull
. @throws IllegalArgumentException if theDragSource
for the trigger event isnull
. @throws IllegalArgumentException if the drag action for the trigger event isDnDConstants.ACTION_NONE
. @throws IllegalArgumentException if the source actions for theDragGestureRecognizer
associated with the trigger event are equal toDnDConstants.ACTION_NONE
.
Class DragSource, DragSourceListener[] getDragSourceListeners()ThisGetsmethod returnstheDragSource
object associated with the underlying platform. @return the platform DragSource @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DragSource, DragSourceMotionListener[] getDragSourceMotionListeners()ReturnsGetsan array ofall theDragSourceListener
s registered with thisDragSource
. @return all of thisDragSource
'sDragSourceListener
s or an empty array if no such listeners are currently registered @see #addDragSourceListener @see #removeDragSourceListener @since 1.4
Class DragSource, EventListener[] getListeners(Class)ReturnsGetsan arrayall ofalltheDragSourceMotionListener
s registered with thisDragSource
. @return all of thisDragSource
'sDragSourceMotionListener
s or an empty array if no such listeners are currently registered @see #addDragSourceMotionListener @see #removeDragSourceMotionListener @since 1.4
Class DragSource, boolean isDragImageSupported()ReturnsGetsan array ofall the objects currently registered asFooListener
s upon thisDragSource
.FooListener
s are registered using theaddFooListener
method. @param listenerType the type of listeners requested; this parameter should specify an interface that descends fromjava.util.EventListener
@return an array of all objects registered asFooListener
s on thisDragSource
or an empty array if no such listeners have been added @exceptionClassCastException
iflistenerType
doesn't specify a class or interface that implementsjava.util.EventListener
@see #getDragSourceListeners @see #getDragSourceMotionListeners @since 1.4
Class DragSource, void removeDragSourceListener(DragSourceListener)ThisReportsmethod returns a boolean indicatingwhether or not dragImage
support is available on the underlying platform.@return if the Drag Image support is available on this platform
Class DragSource, void removeDragSourceMotionListener(DragSourceMotionListener)RemoveRemoves the specifiedDragSourceListener
from thisDragSource
. If anull
listener is specified no action is taken and no exception is thrown. If the listener specified by the argument was not previously added to thisDragSource
no action is taken and no exception is thrown. @param dsl theDragSourceListener
to remove.@see #addDragSourceListener @see #getDragSourceListeners @since 1.4
Class DragSource, void startDrag(DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)RemoveRemoves the specifiedDragSourceMotionListener
from thisDragSource
. If anull
listener is specified no action is taken and no exception is thrown. If the listener specified by the argument was not previously added to thisDragSource
no action is taken and no exception is thrown. @param dsml theDragSourceMotionListener
to remove.@see #addDragSourceMotionListener @see #getDragSourceMotionListeners @since 1.4
Start a drag given theClass DragSource, void startDrag(DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener, FlavorMap)DragGestureEvent
that initiated the drag the initialCursor
to use theImage
to drag the offset of theImage
origin from the hotspot of theCursor
at the instant of the trigger the subject data of the drag and theDragSourceListener
.@param trigger
ThetheDragGestureEvent
that initiated the drag @param dragCursorThethe initialCursor
ornull
for defaults @param dragImageThetheImage
to drag ornull
@param imageOffsetThethe offset of theImage
origin from the hotspot of theCursor
at the instant of the trigger @param transferableThethe subject data of the drag @param dslThetheDragSourceListener
@throws
java.awt.dnd.InvalidDnDOperationException
if the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing.
Start a drag given theClass DragSource, void startDrag(DragGestureEvent, Cursor, Transferable, DragSourceListener)DragGestureEvent
that initiated the drag the initialCursor
to use theImage
to drag the offset of theImage
origin from the hotspot of theCursor
at the instant of the trigger theTransferable
subject data of the drag theDragSourceListener
and theFlavorMap
.@param trigger
ThetheDragGestureEvent
that initiated the drag @param dragCursorThethe initialCursor
ornull
for defaults @param dragImageThethe image to drag or null @param imageOffsetThethe offset of theImage
origin from the hotspot of theCursor
at the instant of the trigger @param transferableThethe subject data of the drag @param dslThetheDragSourceListener
@param flavorMapThetheFlavorMap
to use ornull
@throws
java.awt.dnd.InvalidDnDOperationException
if the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing.
Start a drag given theClass DragSource, void startDrag(DragGestureEvent, Cursor, Transferable, DragSourceListener, FlavorMap)DragGestureEvent
that initiated the drag the initialCursor
to use theTransferable
subject data of the drag and theDragSourceListener
.@param trigger
ThetheDragGestureEvent
that initiated the drag @param dragCursorThethe initialCursor
ornull
for defaults @param transferableThethe subject data of the drag @param dslThetheDragSourceListener
@throws
java.awt.dnd.InvalidDnDOperationException
if the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing.
Start a drag given theDragGestureEvent
that initiated the drag the initialCursor
to use theTransferable
subject data of the drag theDragSourceListener
and theFlavorMap
.@param trigger
ThetheDragGestureEvent
that initiated the drag @param dragCursorThethe initialCursor
ornull
for defaults @param transferableThethe subject data of the drag @param dslThetheDragSourceListener
@param flavorMapThetheFlavorMap to use or
null
@throws
java.awt.dnd.InvalidDnDOperationException
if the Drag and Drop system is unable to initiate a drag operation or if the user attempts to start a drag while an existing drag operation is still executing.
TheClass DragSourceContext, constructor DragSourceContext(DragSourceContextPeer, DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)DragSourceContext
class is responsible for managing the initiator side of the Drag and Drop protocol. In particular it is responsible for managing drag event notifications to theDragSourceListener
s andDragSourceMotionListener
s and providing theTransferable
representing the source data for the drag operation.Note that the
DragSourceContext
itself implements theDragSourceListener
andDragSourceMotionListener
interfaces. This is to allow the platform peer (theDragSourceContextPeer
instance) created by theDragSource
to notify theDragSourceContext
of state changes in the ongoing operation. This allows theDragSourceContext
to interpose itself between the platform and the listeners provided by the initiator of the drag operation. @see DragSourceListener @see DragSourceMotionListener @version 1.474812/03/0118/02 @since 1.2
Called fromClass DragSourceContext, void dragDropEnd(DragSourceDropEvent)DragSource
this constructor creates a newDragSourceContext
given theDragSourceContextPeer
for this Drag theDragGestureEvent
that triggered the Drag the initialCursor
to use for the Drag an (optional)Image
to display while the Drag is taking place the offset of theImage
origin from the hotspot at the instant of the triggering event theTransferable
subject data and theDragSourceListener
to use during the Drag and Drop operation.
IfDragSourceContextPeer
isnull
NullPointerException
is thrown.
IfDragGestureEvent
isnull
NullPointerException
is thrown.
IfCursor
isnull
no exception is thrown and the default dragcursorscursorarebehavior isusedactivated for this drag operation.
IfImage
isnull
no exception is thrown.
IfImage
is notnull
and the offset isnull
NullPointerException
is thrown.
IfTransferable
isnull
NullPointerException
is thrown.
IfDragSourceListener
isnull
no exception is thrown. @param dscp theDragSourceContextPeer
for this drag @param trigger the triggering event @param dragCursor the initialCursor
@param dragImage theImage
to drag (ornull
) @param offset the offset of the image origin from the hotspot at the instant of the triggering event @param t theTransferable
@param dsl theDragSourceListener
@throws IllegalArgumentException if theComponent
associated with the trigger event isnull
. @throws IllegalArgumentException if theDragSource
for the trigger event isnull
. @throws IllegalArgumentException if the drag action for the trigger event isDnDConstants.ACTION_NONE
. @throws IllegalArgumentException if the source actions for theDragGestureRecognizer
associated with the trigger event are equal toDnDConstants.ACTION_NONE
. @throws NullPointerException if dscp trigger or t are null or if dragImage is non-null and offset is null
Class DragSourceContext, void dragEnter(DragSourceDragEvent)ThisCallsmethod callsdragDropEnd
on theDragSourceListener
s registered with thisDragSourceContext
and with the associatedDragSource
and passes them the specifiedDragSourceDropEvent
. @param dsde theDragSourceDropEvent
Class DragSourceContext, void dragExit(DragSourceEvent)ThisCallsmethod callsdragEnter
on theDragSourceListener
s registered with thisDragSourceContext
and with the associatedDragSource
and passes them the specifiedDragSourceDragEvent
. @param dsde theDragSourceDragEvent
Class DragSourceContext, void dragMouseMoved(DragSourceDragEvent)ThisCallsmethod callsdragExit
on theDragSourceListener
s registered with thisDragSourceContext
and with the associatedDragSource
and passes them the specifiedDragSourceEvent
. @param dsde theDragSourceEvent
Class DragSourceContext, void dragOver(DragSourceDragEvent)ThisCallsmethod callsdragMouseMoved
on theDragSourceMotionListener
s registered with theDragSource
associated with thisDragSourceContext
and them passes the specifiedDragSourceDragEvent
. @param dsde theDragSourceDragEvent
@since 1.4
Class DragSourceContext, void dropActionChanged(DragSourceDragEvent)ThisCallsmethod callsdragOver
on theDragSourceListener
s registered with thisDragSourceContext
and with the associatedDragSource
and passes them the specifiedDragSourceDragEvent
. @param dsde theDragSourceDragEvent
Class DragSourceContext, Component getComponent()ThisCallsmethod callsdropActionChanged
on theDragSourceListener
s registered with thisDragSourceContext
and with the associatedDragSource
and passes them the specifiedDragSourceDragEvent
. @param dsde theDragSourceDragEvent
Class DragSourceContext, Cursor getCursor()ThisReturnsmethod returnstheComponent
associated with thisDragSourceContext
.@return theComponent
that started the drag
Class DragSourceContext, DragSource getDragSource()ThisReturnsmethod returnsthe current dragCursor
.@return the current drag
Cursor
Class DragSourceContext, int getSourceActions()ThisReturnsmethod returnstheDragSource
that instantiated thisDragSourceContext
.@return theDragSource
that instantiated thisDragSourceContext
Class DragSourceContext, Transferable getTransferable()ThisReturnsmethod returnsa bitwise mask ofDnDConstants
thatrepresentsrepresent the set of drop actions supported by the drag source for the drag operation associated with thisDragSourceContext
. @return the drop actions supported by the drag source
Class DragSourceContext, DragGestureEvent getTrigger()ThisReturnsmethod returnstheTransferable
associated with thisDragSourceContext
.@return theTransferable
Class DragSourceContext, void removeDragSourceListener(DragSourceListener)ThisReturnsmethod returnstheDragGestureEvent
that initially triggered the drag.@return the Event that triggered the drag
Class DragSourceContext, void setCursor(Cursor)ThisRemovesmethod removesthe specifiedDragSourceListener
from thisDragSourceContext
.@param dsl theDragSourceListener
to remove. Note; note that whilenull
is not prohibited it is not acceptable as a parameter.
Class DragSourceContext, void transferablesFlavorsChanged()This method sets the currentSets the cursor for this drag operation to the specifiedCursor
. If the specifiedCursor
isnull
the default drag cursor behavior is activated for this drag operation otherwise it is deactivated. @param c theCursor
to display.Noteorthat whilenull
is not prohibited it is nottoan acceptable value for thisactivate the default drag cursorparameter.behavior
Class DragSourceContext, void updateCurrentCursor(int, int, int)ThisNotifiesmethod notifiesthe peer that theTransferable
'sDataFlavorsDataFlavor
s have changed.
checkIf the default drag cursor behavior is active this method sets the default drag cursor forupdatesthe specified selected operation supported actions andimplementstatus otherwise this methoddefaultsdoes nothing. @param dropOp the user's currently selected operation @param targetAct the current target's supported actions @param status the constant
TheClass DropTarget, constructor DropTarget()DropTarget
is associated with aComponent
when thatComponent
wishes to accept drops during Drag and Drop operations.Each
DropTarget
is associated with aFlavorMap
. The defaultFlavorMap
hereafter designates theFlavorMap
returned bySystemFlavorMap.getDefaultFlavorMap()
. @version 1.41 1243 04/0309/0102 @since 1.2
Class DropTarget, constructor DropTarget(Component, DropTargetListener)ConstructCreates aDropTarget
. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, constructor DropTarget(Component, int, DropTargetListener)ConstructCreates aDropTarget
given theComponent
to associate itself with and theDropTargetListener
to handle event processing.The Component will receive drops only if it is enabled. @param c The
Component
with which thisDropTarget
is associated @param dtl TheDropTargetListener
for thisDropTarget
@exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean)ConstructCreates aDropTarget
given theComponent
to associate itself with anint
representing the default acceptable action(s) to support and aDropTargetListener
to handle event processing.The Component will receive drops only if it is enabled. @param c The
Component
with which thisDropTarget
is associated @param ops The default acceptable actions for thisDropTarget
@param dtl TheDropTargetListener
for thisDropTarget
@exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean, FlavorMap)ConstructCreates aDropTarget
given theComponent
to associate itself with anint
representing the default acceptable action(s) to support aDropTargetListener
to handle event processing and aboolean
indicating if theDropTarget
is currently accepting drops.The Component will receive drops only if it is enabled. @param c The
Component
with which thisDropTarget
is associated @param ops The default acceptable actions for thisDropTarget
@param dtl TheDropTargetListener
for thisDropTarget
@param act Is theDropTarget
accepting drops. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, void addDropTargetListener(DropTargetListener)ConstructCreates a new DropTarget given theComponent
to associate itself with anint
representing the default acceptable action(s) to support aDropTargetListener
to handle event processing aboolean
indicating if theDropTarget
is currently accepting drops and aFlavorMap
to use (or null for the defaultFlavorMap
).The Component will receive drops only if it is enabled. @param c The
Component
with which thisDropTarget
is associated @param ops The default acceptable actions for thisDropTarget
@param dtl TheDropTargetListener
for thisDropTarget
@param act Is theDropTarget
accepting drops. @param fm TheFlavorMap
to use or null for the defaultFlavorMap
@exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, DropTargetContext createDropTargetContext()AddAdds a newDropTargetListener
(UNICAST SOURCE).@param dtl The new
DropTargetListener
@throws
TooManyListenersException
if aDropTargetListener
is already added to thisDropTarget
.
Class DropTarget, Component getComponent()CreateCreates the DropTargetContext associated with this DropTarget. Subclasses may override this method to instantiate their own DropTargetContext subclass. This call is typically *only* called by the platform's DropTargetContextPeer as a drag operation encounters this DropTarget. Accessing the Context while no Drag is current has undefined results.
Class DropTarget, int getDefaultActions()ThisGetsmethod returnstheComponent
associated with thisDropTarget
.@return the current Component
Class DropTarget, DropTargetContext getDropTargetContext()ThisGetsmethod returnsanint
representing the current action(s) supported by thisDropTarget
.@return the current default actions
Class DropTarget, FlavorMap getFlavorMap()ThisGetsmethod returnstheDropTargetContext
associated with thisDropTarget
.@return the
DropTargetContext
associated with thisDropTarget
.
Class DropTarget, boolean isActive()ThisGetsmethod returnstheFlavorMap
associated with thisDropTarget
. If noFlavorMap
has been set for thisDropTarget
it is associated with the defaultFlavorMap
.@return the FlavorMap for this DropTarget
Class DropTarget, void removeDropTargetListener(DropTargetListener)ThisReportsmethod returns a boolean indicatingwhether or not thisDropTarget
is currently active (ready to accept drops).@return
is thetrue
DropTargetif activefalse
if not
Class DropTarget, void setActive(boolean)RemoveRemoves the currentDropTargetListener
(UNICAST SOURCE).@param dtl the DropTargetListener to deregister.
Class DropTarget, void setFlavorMap(FlavorMap)SetSets the DropTarget active iftrue
inactive iffalse
.@param isActive sets the
DropTarget
(in)active.
ThisSetsmethod setstheFlavorMap
associated with thisDropTarget
.@param fm
setthe newFlavorMap
or nullforto associate the default FlavorMap with this DropTarget.