|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejava.awt.dndas 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.
During DnD operations it is possible that a user may wish to drop the subject of the operation on a region of a scrollable GUI control that is not currently visible to the user.In such situations it is desirable that the GUI control detect this and institute a scroll operation in order to make obscured region(s) visible to the user. This feature is known as autoscrolling.
If a GUI control is both an active
DropTargetand is also scrollable it can receive notifications of autoscrolling gestures by the user from the DnD system by implementing this interface.An autoscrolling gesture is initiated by the user by keeping the drag cursor motionless with a border region of the
Componentreferred to as the "autoscrolling region" for a predefined period of time this will result in repeated scroll requests to theComponentuntil the dragCursorresumes its motion. @version 1.10 0211 12/0203/0001 @since 1.2
This class contains constant values representing the type of action(s) to be performed by a Drag and Drop operation. @version 1.16 0217 12/0203/0001 @since 1.2
AClass DragGestureEvent, Component getComponent()DragGestureEventis passed toDragGestureListener's dragGestureRecognized() method when a particularDragGestureRecognizerdetects that a platform dependent drag initiating gesture has occurred on theComponentthat it is tracking. @version 1.1520 @see java.awt.dnd.DragGestureRecognizer @see java.awt.dnd.DragGestureListener @see java.awt.dnd.DragSource
Class DragGestureEvent, int getDragAction()ThisReturnsmethod returnstheComponentassociated with thisDragGestureEvent.@return the Component
Class DragGestureEvent, Point getDragOrigin()ThisReturnsmethod returnsanintrepresenting the action selected by the user.@return the action selected by the user
Class DragGestureEvent, DragSource getDragSource()ThisReturnsmethod returnsaPointin the coordinates of theComponentover which the drag originated.@return the Point where the drag originated in Component coords.
Class DragGestureEvent, DragGestureRecognizer getSourceAsDragGestureRecognizer()ThisReturnsmethod returnstheDragSource.@return the
DragSource
Class DragGestureEvent, InputEvent getTriggerEvent()ThisReturnsmethod returnsthe source as aDragGestureRecognizer.@return the source as a
DragGestureRecognizer
Class DragGestureEvent, Iterator iterator()ThisReturnsmethod returnsthe initial event that triggered the gesture.@
returnsreturn the first "triggering" event in the sequence of the gesture
Class DragGestureEvent, Object[] toArray()ThisReturnsmethod returnsanIteratorfor the events comprising the gesture.@return an Iterator for the events comprising the gesture
Class DragGestureEvent, Object[] toArray(Object[])ThisReturnsmethod returnsanObjectarray of the events comprising the drag gesture.@return an array of the events comprising the gesture
ThisReturnsmethod returnsan array of the events comprising the drag gesture.@param array the array of
EventObjectsub(types)@return an array of the events comprising the gesture
TheClass DragGestureRecognizer, Component componentDragGestureRecognizeris an abstract base class for the specification of a platform-dependent listener that can be associated with a particularComponentin order to identify platform-dependent drag initiating gestures.The appropriate
DragGestureRecognizersubclass is obtained from theDragSourceasssociated with a particularComponentor from theToolkitobject via its createDragGestureRecognizer() method.Once the
DragGestureRecognizeris associated with a particularComponentit will register the appropriate listener interfaces on thatComponentin order to track the input events delivered to theComponent.Once the
DragGestureRecognizeridentifies a sequence of events on theComponentas a drag initiating gesture it will notify its unicastDragGestureListenerby invoking its gestureRecognized() method.When a concrete
DragGestureRecognizerinstance detects a drag initiating gesture on theComponentit is associated with it will fire aDragGestureEventto theDragGestureListenerregistered on its unicast event source forDragGestureListenerevents. ThisDragGestureListeneris responsible for causing the associatedDragSourceto start the Drag and Drop operation (if appropriate).@author Laurence P. G. Cable @version 1.
1317 @see java.awt.dnd.DragGestureListener @see java.awt.dnd.DragGestureEvent @see java.awt.dnd.DragSource
TheClass DragGestureRecognizer, DragSource dragSourceComponentassociated with thisDragGestureRecognizer. @serial
TheClass DragGestureRecognizer, ArrayList eventsDragSourceassociated with thisDragGestureRecognizer. @serial
The list of events (in order) that the DragGestureRecognizer "recognized" as a "gesture" that triggers a drag. @serial
Class DragGestureRecognizer, int sourceActionsAn int representing the type(s) of action(s) used in this Drag and Drop operation. @serial
TheClass DragSource, constructor DragSource()DragSourceis 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
Componentor application specific object associated with aComponentinstance in the GUI. [implementation dependent]- Some other arbitrary association. [implementation dependent]
DragSourceis obtained aDragGestureRecognizershould also be obtained to associate theDragSourcewith a particularComponent.The initial interpretation of the user's gesture and the subsequent starting of the drag operation are the responsibility of the implementing
Componentwhich 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. ADragSourceshall only permit a single Drag and Drop operation to be current at any one time and shall reject any further startDrag() requests by throwing anIllegalDnDOperationExceptionuntil such time as the extant operation is complete.The startDrag() method invokes the createDragSourceContext() method to instantiate an appropriate
DragSourceContextand associate theDragSourceContextPeerwith 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.InvalidDnDOperationExceptionto 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.30 0237 12/0203/0001 @since 1.2
Construct a new DragSource. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DragSource, DragSource getDefaultDragSource()This method returns theClass DragSource, Cursor DefaultCopyDropDragSourceobject associated with the underlying platform.@return the platform DragSource @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
The defaultClass DragSource, Cursor DefaultCopyNoDropCursorto use with a copy operation indicating that a drop is currently allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
The defaultClass DragSource, Cursor DefaultLinkDropCursorto use with a copy operation indicating that a drop is currently not allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
The defaultClass DragSource, Cursor DefaultLinkNoDropCursorto use with a link operation indicating that a drop is currently allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
The defaultClass DragSource, Cursor DefaultMoveDropCursorto use with a link operation indicating that a drop is currently not allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
The defaultClass DragSource, Cursor DefaultMoveNoDropCursorto use with a move operation indicating that a drop is currently allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
The defaultCursorto use with a move operation indicating that a drop is currently not allowed.nullifGraphicsEnvironment.isHeadless()returnstrue. @see java.awt.GraphicsEnvironment#isHeadless
TheClass DragSourceContext, constructor DragSourceContext(DragSourceContextPeer, DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)DragSourceContextclass is responsible for managing the initiator side of the Drag and Drop protocol. In particular it is responsible for managing drag event notifications to theDragSourceListeners andproviding the Transferable stateDragSourceMotionListenersto enableand providing thedata transfer. An instance of this class is created as a result of aDragSource'sTransferablestartDrag() method beingrepresentingsuccessfully invoked. This instancetheis responsiblesource data fortrackingthestate of thedrag operationon behalf of the DragSource and dispatching state changes to the DragSourceListener.Note that the
DragSourceContextitself implements theDragSourceListenerinterfaceandDragSourceMotionListenerinterfaces. This is to allow the platform peer (theDragSourceContextPeerinstance) created by theDragSourceto notify theDragSourceContextofchanges instate changes in theongiongongoing operation. This allows theDragSourceContextto interpose itself between the platform and theDragSourceListenerlisteners provided by the initiator of the drag operation. @see DragSourceListener @see DragSourceMotionListener @version 1.42 0447 12/3003/01 @since 1.2
Called fromClass DragSourceContext, void dragDropEnd(DragSourceDropEvent)DragSourcethis constructor creates a newDragSourceContextgiven theDragSourceContextPeerfor this Drag theDragGestureEventthat triggered the Drag the initialCursorto use for the Drag an (optional)Imageto display while the Drag is taking place the offset of theImageorigin from the hotspot at the instant of the triggering event theTransferablesubject data and theDragSourceListenerto use during the Drag and Drop operation.
IfDragSourceContextPeerisnullNullPointerExceptionis thrown.
IfDragGestureEventisnullNullPointerExceptionis thrown.
IfCursorisnullno exception is thrown and default drag cursors are used for this drag operation.
IfImageisnullno exception is thrown.
IfImageis notnulland the offset isnullNullPointerExceptionis thrown.
IfTransferableisnullNullPointerExceptionis thrown.
IfDragSourceListenerisnullno exception is thrown. @param dscp theDragSourceContextPeerfor this drag @param trigger the triggering event @param dragCursor the initialCursor@param dragImage theImageto 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 theComponentassociated with the trigger event isnull. @throws IllegalArgumentException if theDragSourcefor the trigger event isnull. @throws IllegalArgumentException if the drag action for the triggerinstanceevent isincompleteDnDConstants.ACTION_NONE. @throws IllegalArgumentException if the source actions for theDragGestureRecognizerassociated with the trigger event are equal toDnDConstants.ACTION_NONE. @throws NullPointerException if dscpdsltrigger or t are null or if dragImage is non-null and offset is null
This methodClass DragSourceContext, void dragEnter(DragSourceDragEvent)interceptscallstheDragSourceDropEvent associated withdragDropEnd()fromon thepeer. Note: This method isDragSourceListenerscalled by theregistered with thispeerDragSourceContextimplementation notand with theuser. The value ofassociatednullDragSourceis notandacceptable aspasses thema parameter tothethisspecifiedmethodDragSourceDropEvent.@param dsde theinterceptedDragSourceDropEvent
This methodClass DragSourceContext, void dragExit(DragSourceEvent)interceptscallsdragEnteron thesDragSourceDragEventDragSourceListenerassociatedregistered withdragEnter() fromthistheDragSourceContextpeer.and withNote:theThisassociatedmethodDragSourceis called byand passes them thepeer implementation notspecifiedthe userDragSourceDragEvent.@param dsde theinterceptedDragSourceDragEvent
This methodClass DragSourceContext, void dragOver(DragSourceDragEvent)interceptscallsdragExiton thesDragSourceEventDragSourceListenerassociatedregistered withdragExit() fromthistheDragSourceContextpeer.and withNote:theThisassociatedmethodDragSourceis called byand passes them thepeer implementation notspecifiedthe userDragSourceEvent.@paramdsedsde theinterceptedDragSourceEvent
This methodClass DragSourceContext, void dropActionChanged(DragSourceDragEvent)interceptscallsdragOveron thesDragSourceDragEventDragSourceListenerassociatedregistered withdragOver() fromthistheDragSourceContextpeer.and withNote:theThisassociatedmethodDragSourceis called byand passes them thepeer implementation notspecifiedthe userDragSourceDragEvent.@param dsde theinterceptedDragSourceDragEvent
This methodClass DragSourceContext, int getSourceActions()interceptscallsdropActionChangedon thesDragSourceDragEventDragSourceListenerassociatedregistered withdropActionChanged() fromthistheDragSourceContextpeer.and withNote:theThisassociatedmethodDragSourceis called byand passes them thepeer implementation notspecifiedthe userDragSourceDragEvent.@param dsde theinterceptedDragSourceDragEvent
This method returnsClass DragSourceContext, Transferable getTransferable()ana bitwise mask ofintDnDConstantsrepresentingthat represents the set of drop actions supported by the drag source for thecurrentdragaction(s)operation associated with thisDragSourceContext.. @return thecurrentdrop actions supported by the drag source
This method returns theTransferableassociated with thisDragSourceContext..@return the
Transferable
TheClass DragSourceDragEvent, constructor DragSourceDragEvent(DragSourceContext, int, int, int)DragSourceDragEventis delivered from theDragSourceContextPeervia theDragSourceContextto thecurrentlyDragSourceListenerregistered with thatand with its associatedDragSourceListenerDragSourceContextDragSource.It containsThe
stateDragSourceDragEventreports the target drop action andregardingthe user drop action that reflect the current state of the drag operation.toTarget drop action is one of
DnDConstantsthatenablerepresents theoperationsdropinitiatoractiontoselected by the current drop target if this drop action is supported by the drag source orprovideDnDConstants.ACTION_NONEif this drop action is not supported by the drag source.User drop action depends on the drop actions supported by the drag source and the drop action selected by the
enduser. The userwithcan select a drop action by pressing modifier keys during the drag operation:Ctrl + Shift -> ACTION_LINK Ctrl -> ACTION_COPY Shift ->ACTION_MOVE If the user selects a drop action the user drop action is one ofDnDConstantsthat represents the selected drop action if this drop action is supported by the drag source orDnDConstants.ACTION_NONEif this drop action is not supported by the drag source.If the user doesn't select a drop action the set of
theDnDConstantsthat representsappropriateset of drop actions supported by the dragoversource is searched forDnDConstants.ACTION_MOVEthen forDnDConstants.ACTION_COPYthen forfeedbackDnDConstants.ACTION_LINKand the user drop action is the first constant found. If no constant is found the user drop action isDnDConstants.ACTION_NONE. @version 1.20 0225 12/0203/0001 @since 1.2
Constructs aClass DragSourceDragEvent, int getDropAction()DragSourceDragEvent. This class is typically instantiated by theDragSourceContextPeerrather than directly by client code. The coordinates for thisDragSourceDragEventare not specified sogetLocationwill returnnullfor this event. @param dsc theDragSourceContextthat is to manage notifications for this event. @param dropAction thevalue of one of the staticuserfieldsdropfromaction.DNDConstants@paramindicatingactions thetype of usertarget drop actionthis event represents. @paramactionsmodifiers thevaluemodifierof one of thekeys down during eventstatic(shiftfields fromctrl altDNDConstantsmeta)indicating theEither extendedtype_DOWN_MASKof targetor olddrop_MASKaction supported by and returned from the current dropmodifiers should be used but both models should nottarget.be@parammixedmodifiers specifiesin onetheevent.stateUse of theinput deviceextended modifiersassociated withisthepreferred.user@seegesturejava.awt.event.InputEvent @see DragSourceEvent#getLocation
This method returnsClass DragSourceDragEvent, int getTargetActions()anthe logicalintintersectionrepresentingof theeffectiveuser drop actionwhich istheintersection of the user'stargetselecteddrop action and thesourcesetand targetof drop actions.supported@returnby theeffective drop actiondragwhichsource.is@return the logical intersection of the user'sdrop action the targetselecteddrop action and thesourcesetand targetof drop actions supported by the drag source.
This method returns theClass DragSourceDragEvent, int getUserAction()logical intersection of the currenttargetsource anddropuser actionsaction.@return thelogical intersection of the currenttargetsource anddropuser actionsaction.
This method returnsan int representingthe user's currently selecteddrop action.@return the user's currentlyselecteddrop action.
TheClass DragSourceDropEvent, constructor DragSourceDropEvent(DragSourceContext)DragSourceDropEventis delivered from theDragSourceContextPeervia theDragSourceContexttoitsthecurrentlydragDropEndregisteredmethod ofDragSourceListener'sdragDropEnd()registeredmethodwith thatDragSourceContextand with its associatedDragSource. It contains sufficient information for the originator of the operation to provide appropriate feedback to the end user when the operation completes.@version 1.
12 0216 12/0203/0001@since 1.2
Construct aClass DragSourceDropEvent, constructor DragSourceDropEvent(DragSourceContext, int, boolean)DragSourceDropEventfor a drag that does not result in a drop. The coordinates for thisDragSourceDropEventare not specified sogetLocationwill returnnullfor this event. @param dsc theDragSourceContext@see DragSourceEvent#getLocation
Construct aClass DragSourceDropEvent, int getDropAction()DragSourceDropEventfor a drop given theDragSourceContextthe drop action and abooleanindicating if the drop was successful. The coordinates for thisDragSourceDropEventare not specified sogetLocationwill returnnullfor this event. @param dsc theDragSourceContextassociated with thisDragSourceDropEvent@param action the drop action @param success a boolean indicating if the drop was successful @see DragSourceEvent#getLocation
This method returns anClass DragSourceDropEvent, boolean getDropSuccess()intrepresenting the action performed by the target on the subject of the drop.@return the action performed by the target on the subject of the drop if the drop target accepted the drop and the target drop action is supported by the drag source; otherwiseDnDConstants.ACTION_NONE.
This method returns abooleanindicating if the drop wasa successsuccessful.@returntrueif the dropwastargetsuccessfulaccepted the drop and successfully performed a drop action;falseif the drop target rejected the drop or if the drop target accepted the drop but failed to perform a drop action.
This class is the base class forClass DragSourceEvent, constructor DragSourceEvent(DragSourceContext)DragSourceDragEventandDragSourceDropEvent.
DragSourceEvents are generated whenever the drag enters moves over or exits a drop site when the drop action changes and when the drag ends. The location for the generatedDragSourceEventspecifies the mouse cursor location in screen coordinates at the moment this event occured.In a multi-screen environment without a virtual device the cursor location is specified in the coordinate system of the initiator
GraphicsConfiguration. The initiatorGraphicsConfigurationis theGraphicsConfigurationof theComponenton which the drag gesture for the current drag operation was recognized. If the cursor location is outside the bounds of the initiatorGraphicsConfigurationthe reported coordinates are clipped to fit within the bounds of thatGraphicsConfiguration.In a multi-screen environment with a virtual device the location is specified in the corresponding virtual coordinate system. If the cursor location is outside the bounds of the virtual device the reported coordinates are clipped to fit within the bounds of the virtual device.
@since 1.2
Construct aDragSourceEventgiven a specifiedDragSourceContext. The coordinates for thisDragSourceEventare not specified sogetLocationwill returnnullfor this event. @param dsc theDragSourceContext@see #getLocation
TheClass DragSourceListener, void dragDropEnd(DragSourceDropEvent)DragSourceListenerdefines the event interface for originators of Drag and Drop operations to track the state of the user's gesture and to provide appropriate "drag over" feedback to the user throughout the Drag and Drop operation. @version 1.15 0217 12/0203/0001 @since 1.2
This method is invoked to signify that the Drag and Drop operation is complete. The getDropSuccess() method of theClass DragSourceListener, void dragEnter(DragSourceDragEvent)DragSourceDropEventcan be used to determine the termination state. The getDropAction() method returns the operation that theDropTarget selected (via the DropTargetDropEventdropacceptDrop()siteparameter)selected to apply to the Drop operation. Once this method is complete the currentDragSourceContextand associated resources become invalid.@param dsde theDragSourceDropEvent
Called as the cursor's hotspot enters a platformClass DragSourceListener, void dragExit(DragSourceEvent)-dependent drop site. This method is invoked when all the following conditions are true:
- The
logicalcursor's hotspotinitially intersects a GUI Component's visible geometry.entersThattheComponentoperablehas an activepart of aDropTargetplatform-associated with itdependent drop site.- The
DropTarget's registered DropTargetListener dragEnter()dropmethodsite isinvoked and returns successfullyactive.- The
registered DropTargetListener invokes the DropTargetDragEvent's acceptDrag() methoddropto acceptsite accepts the dragbased upon interrogation of the source's potential drop action(s) and available data types (DataFlavors).@param dsde theDragSourceDragEvent
Called as the cursor's hotspot exits a platformClass DragSourceListener, void dragOver(DragSourceDragEvent)-dependent drop site. This method is invoked when any of the following conditions are true:OR
- The cursor's
logicalhotspot no longer intersects thevisible geometryoperable part of theComponentdrop site associated with the previous dragEnter() invocation.OR
- The
Component that the logical cursor's hotspot intersecteddropthat resulted insite associated with the previous dragEnter() invocation is no longerhas anactiveDropTarget or DropTargetListener associated with it.
- The current
DropTarget'sdropDropTargetListenersite hasinvoked rejectDrag() sincerejected thelast dragEnter() or dragOver() invocationdrag.@param dse theDragSourceEvent
Called as the cursor's hotspot moves over a platformClass DragSourceListener, void dropActionChanged(DragSourceDragEvent)-dependent drop site. This method is invoked when all the following conditions are true:
- The cursor's
logicalhotspot has moved but still intersects thevisible geometryoperable part of theComponentdrop site associated with the previous dragEnter() invocation.That Component still has a DropTarget associated with it.TheThatdropDropTargetsite is still active.- The
DropTarget's registered DropTargetListener dragOver() method is invoked and returns successfully. The DropTarget doesdropnot rejectsite accepts the dragvia rejectDrag().@param dsde theDragSourceDragEvent
Called when the user has modified the drop gesture. This method is invoked when the state of the input device(s) that the user is interacting with changes. Such devices are typically the mouse buttons or keyboard modifiers that the user is interacting with.@param dsde theDragSourceDragEvent
TheClass DropTarget, constructor DropTarget()DropTargetis associated with aComponentwhen thatComponentwishes to accept drops during Drag and Drop operations. @version 1.34 0241 12/0203/0001 @since 1.2
Construct a DropTarget. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, constructor DropTarget(Component, DropTargetListener)Construct aClass DropTarget, constructor DropTarget(Component, int, DropTargetListener)DropTargetgiven theComponentto associate itself with and theDropTargetListenerto handle event processing.The Component will receive drops only if it is enabled. @param c The
Componentwith which thisDropTargetis associated @param dtl TheDropTargetListenerfor thisDropTarget@exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Construct aClass DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean)DropTargetgiven theComponentto associate itself with anintrepresenting the default acceptable action(s) to support and aDropTargetListenerto handle event processing.The Component will receive drops only if it is enabled. @param c The
Componentwith which thisDropTargetis associated @param ops The default acceptable actions for thisDropTarget@param dtl TheDropTargetListenerfor thisDropTarget@exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Construct aClass DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean, FlavorMap)DropTargetgiven theComponentto associate itself with anintrepresenting the default acceptable action(s) to support aDropTargetListenerto handle event processing and abooleanindicating if theDropTargetis currently accepting drops.The Component will receive drops only if it is enabled. @param c The
Componentwith which thisDropTargetis associated @param ops The default acceptable actions for thisDropTarget@param dtl TheDropTargetListenerfor thisDropTarget@param act Is theDropTargetaccepting drops. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Construct a new DropTarget given theComponentto associate itself with anintrepresenting the default acceptable action(s) to support aDropTargetListenerto handle event processing abooleanindicating if theDropTargetis currently accepting drops and aFlavorMapto use (or null).The Component will receive drops only if it is enabled. @param c The
Componentwith which thisDropTargetis associated @param ops The default acceptable actions for thisDropTarget@param dtl TheDropTargetListenerfor thisDropTarget@param act Is theDropTargetaccepting drops. @param fm TheFlavorMapto use or null @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
ADropTargetContextis created whenever the logical cursor associated with a Drag and Drop operation coincides with the visible geometry of aComponentassociated with aDropTarget. TheDropTargetContextprovides the mechanism for a potential receiver of a drop operation to both provide the end user with the appropriate drag under feedback but also to effect the subsequent data transfer if appropriate. @version 1.28 0233 12/0203/0001 @since 1.2
Class DropTargetContext.TransferableProxy, Object getTransferData(DataFlavor)TheTransferableProxyis anestedhelper inner class thatsupportsimplementstheTransferableinterface and serves as a proxy for anotherDropTargetContextTransferableinobjectmanaging thewhich represents data transferoffordataa particular drag-n-drop operation.In particular it provides automatic support forThe proxy forwards all requests to the
de-serializationencapsulated transferable and automatically performs additional conversion on the data returned by the encapsulated transferable in case ofapplication/x-java-serialized-objectlocalDatFlavorstransfer.
Class DropTargetContext.TransferableProxy, DataFlavor[] getTransferDataFlavors()getReturns an object which represents thetransferdata provided by the encapsulated transferable for the requested data flavor.@param
dfIn case of local transfer a serialized copy of theDataFlavorobject returned@throwsbyUnsupportedFlavorExceptiontheifencapsulated transferable is provided when the data is requestedDataFlavorinisapplication/x-java-serialized-objectnot supporteddata flavor. @param flavor the requested flavor for the data @throws IOException if the data is no longer available in the requested flavor.@returnthrows UnsupportedFlavorException if theObjectrequested data flavor is not supported.
Class DropTargetContext.TransferableProxy, boolean isDataFlavorSupported(DataFlavor)getReturns an array of DataFlavor objects indicating the flavors the data can be provided in by the encapsulated transferable.@return an array of data flavors in which the
DataFlavordataarraycan be provided by the encapsulated transferable
Class DropTargetContext.TransferableProxy, boolean isLocalcheckReturnsifwhether or not thea particularspecified data flavor is supported by the encapsulated transferable. @param flavor theDataFlavorrequested flavor for the data @returnabooleantrueindicatingif thespecifieddataDataFlavorflavor is supported.falseotherwise
AClass DropTargetContext.TransferableProxy, Transferable transferableindicating if the encapsulatedbooleanDragSourceTransferableisobjectinrepresents thesameresultJVMof local drag-n-dropasoperation (within theDropTargetsame JVM).
The"actual"encapsulatedTransferablethat the Proxy is a Proxy for usually supplied from the underlying systemobject.
subclasses may overrideCreates a TransferableProxythistosupply their own Proxyproxy for the specified Transferable. @param t the Transferable to be proxied @param localbooleantrue if t represents the result of a local drag-n-drop operation. @return theTransferablenew TransferableProxy instance.
TheClass DropTargetDragEvent, constructor DropTargetDragEvent(DropTargetContext, Point, int, int)DropTargetDragEventis delivered to aDropTargetListenervia its dragEnter() and dragOver() methods.The
DropTargetDragEventreports the source drop actions and the user drop action that reflect the current state of the drag operation.Source drop actions is a bitwise mask of
DnDConstantsthat represents the set of drop actions supported by the drag source for this drag operation.User drop action depends on the drop actions supported by the drag source and the drop action selected by the user. The user can select a drop action by pressing modifier keys during the drag operation:
Ctrl + Shift -> ACTION_LINK Ctrl -> ACTION_COPY Shift -> ACTION_MOVEIf the user selects a drop action the user drop action is one ofDnDConstantsthat represents the selected drop action if this drop action is supported by the drag source orDnDConstants.ACTION_NONEif this drop action is not supported by the drag source.If the user doesn't select a drop action the set of
@version 1.DnDConstantsthat represents the set of drop actions supported by the drag source is searched forDnDConstants.ACTION_MOVEthen forDnDConstants.ACTION_COPYthen forDnDConstants.ACTION_LINKand the user drop action is the first constant found. If no constant is found the user drop action isDnDConstants.ACTION_NONE.16 0220 12/0203/0001 @since 1.2
Construct aClass DropTargetDragEvent, void acceptDrag(int)DropTargetDragEventgiven theDropTargetContextfor this operation the location of the "Drag"Cursor's hotspot in theComponent's coordinates thecurrently selecteduser drop action andcurrent set ofthe source drop actionssupported by the source.@param dtc The DropTargetContext for this operation @param cursorLocn The location of the "Drag" Cursor's hotspot in Component coordinates @param dropAction The
currently selecteduser drop action @param srcActions Thecurrent setsourceofdrop actionssupported@throwsby the sourceNullPointerException if cursorLocn is null @throwsNullPointerExceptionIllegalArgumentExceptionifcursorLocndropAction isnullnot one ofDnDConstants. @throwsIllegalArgumentExceptionifthe dropAction orsrcActions is notsrcActionsa bitwise maskareofillegalDnDConstants.values@throwsorIllegalArgumentExceptionif dtc isnull.
Class DropTargetDragEvent, int getDropAction()AcceptAccepts the drag. This method should be called from aDropTargetListenersdragEnter()dragOverand()dragActionChanged()dropActionChangedmethods if the implementation wishes to accept an operation from the srcActions other than the one selected by the user as represented by thedropAction.@param dragOperation the operation accepted by the target
This method returnsClass DropTargetDragEvent, int getSourceActions()an int representingthecurrentlyuserselecteddrop action.@returncurrently selectedthe user drop action
This method returnsClass DropTargetDragEvent, void rejectDrag()an int representingtheset ofsource drop actionssupported by the source.@return the source drop actions
RejectRejects the drag as a result of examining either thedropActionor the availableDataFlavortypes.
TheClass DropTargetDropEvent, constructor DropTargetDropEvent(DropTargetContext, Point, int, int)DropTargetDropEventis delivered via theDropTargetListenerdrop() method.The
DropTargetDropEventreports the source drop actions and the user drop action that reflect the current state of the drag-and-drop operation.Source drop actions is a bitwise mask of
DnDConstantsthat represents the set of drop actions supported by the drag source for this drag-and-drop operation.User drop action depends on the drop actions supported by the drag source and the drop action selected by the user. The user can select a drop action by pressing modifier keys during the drag operation:
Ctrl + Shift -> ACTION_LINK Ctrl -> ACTION_COPY Shift -> ACTION_MOVEIf the user selects a drop action the user drop action is one ofDnDConstantsthat represents the selected drop action if this drop action is supported by the drag source orDnDConstants.ACTION_NONEif this drop action is not supported by the drag source.If the user doesn't select a drop action the set of
@version 1.DnDConstantsthat represents the set of drop actions supported by the drag source is searched forDnDConstants.ACTION_MOVEthen forDnDConstants.ACTION_COPYthen forDnDConstants.ACTION_LINKand the user drop action is the first constant found. If no constant is found the user drop action isDnDConstants.ACTION_NONE.21 0224 12/0203/0001 @since 1.2
Construct aClass DropTargetDropEvent, constructor DropTargetDropEvent(DropTargetContext, Point, int, int, boolean)DropTargetDropEventgiven theDropTargetContextfor this operation the location of the dragCursor's hotspot in theComponent's coordinates the currently selected user drop action and the current set of actions supported by the source. By default this constructor assumes that the target is not in the same virtual machine as the source; that is #isLocalTransfer() will returnfalse.@param dtc The
DropTargetContextfor this operation @param cursorLocn The location of the "Drag" Cursor's hotspot inComponentcoordinates @param dropActionThe currently selectedthe user drop action: COPY MOVE or LINK constants found in DnDConstants. @param srcActionsThe current set of actions supported bythe source: some combinationof COPY MOVEdroporactions.LINK@throwsasNullPointerExceptionexposed by theif cursorLocn isDragSourcenull.@throwsifNullPointerExceptionIllegalArgumentExceptioncursorLocndropAction is not one of. @throwsnullDnDConstantsIllegalArgumentExceptionifthe dropAction orsrcActions is notsrcActionsa bitwise maskareofillegalDnDConstants.values@throwsorIllegalArgumentExceptionif dtc isnull.
Construct aClass DropTargetDropEvent, int getDropAction()DropTargetEventgiven theDropTargetContextfor this operation the location of the dragCursor's hotspot in theComponent's coordinates the currently selected user drop action the current set of actions supported by the source and abooleanindicating if the source is in the same JVM as the target.@param dtc The DropTargetContext for this operation @param cursorLocn The location of the "Drag" Cursor's hotspot in Component's coordinates @param dropAction
The currently selectedthe user drop action: COPY MOVE.or@paramLINK constants found in DnDConstantssrcActions the source drop actions. @paramsrcActionsisLocalTxThe current set of actions supportedTrue if the source is inbythe same JVM as thesource:target @throwsNullPointerExceptionsome combination ofif cursorLocn isCOPYnullMOVE@throwsorIllegalArgumentExceptionLINK as exposed byif dropAction is nottheone of. @DragSourceDnDConstantsparam isLocalTxthrowsTrueIllegalArgumentExceptionifthe sourcesrcActions isin the same JVM asnot a bitwise mask oftheDnDConstants.target@throwsIllegalArgumentExceptionif dtc isnull.
This method returnsClass DropTargetDropEvent, int getSourceActions()an int representingtheaction(s) supported byuserthedropsourceaction.at@return thetime of theuser drop.@return sourceactions.
This method returnsan int representingtheaction(s) supported bysourcethe sourcedrop actions.@return the source drop actions.
TheClass DropTargetEvent, DropTargetContext contextDropTargetEventis the base class for both theDropTargetDragEventand theDropTargetDropEvent. It encapsulates the current state of the Drag and Drop operations in particular the currentDropTargetContext. @version 1.14 0216 12/0203/0001 @since 1.2
Theassociated with thisDropTargetConextDropTargetContextDropTargetEvent. @serial
TheClass DropTargetListener, void dragEnter(DropTargetDragEvent)DropTargetListenerinterface is the callback interface used by theDropTargetclass to provide notification of DnD operations that involve the subjectDropTarget. Methods of this interface may be implemented to provide "drag under" visual feedback to the user throughout the Drag and Drop operation.Create a listener object by implementing the interface and then register it with a
DropTarget. When the drag enters moves over or exits the operable part of the drop site for thatDropTargetwhen the drop action changes and when the drop occurs the relevant method in the listener object is invoked and theDropTargetEventis passed to it.The operable part of the drop site for the
@version 1.DropTargetis the part of the associatedComponent's geometry that is not obscured by an overlapping top-level window or by anotherComponenthigher in the Z-order that has an associated activeDropTarget.16 0219 12/0203/0001 @since 1.2
CalledClass DropTargetListener, void dragExit(DropTargetEvent)whenwhile a drag operationhasis ongoing when the mouse pointer enters the operableencounteredpart of the drop site for theDropTarget.registered with this listener. @param dtde theDropTargetDragEvent
Class DropTargetListener, void dragOver(DropTargetDragEvent)TheCalled while a drag operation is ongoing when the mouse pointer hasdepartedexited the operable part of the drop site for theDropTargetwithoutregistereddropping.with this listener. @param dte theDropTargetEvent
Called when a drag operation is ongoingClass DropTargetListener, void drop(DropTargetDropEvent)onwhile the mouse pointer is still over the operable part of the drop site for theDropTarget.registered with this listener. @param dtde theDropTargetDragEvent
TheCalled when the drag operation has terminated with a drop onthisthe operable part of the drop site for theDropTargetregistered with this listener.This method is responsible for undertaking the transfer of the data associated with the gesture. The
DropTargetDropEventprovides a means to obtain aTransferableobject that represents the data object(s) to be transfered.From this method the
DropTargetListenershall accept or reject the drop via the acceptDrop(int dropAction) or rejectDrop() methods of theDropTargetDropEventparameter.Subsequent to acceptDrop() but not before
DropTargetDropEvent's getTransferable() method may be invoked and data transfer may be performed via the returnedTransferable's getTransferData() method.At the completion of a drop an implementation of this method is required to signal the success/failure of the drop by passing an appropriate
booleanto theDropTargetDropEvent's dropComplete(boolean success) method.Note: The
actualdata transfer should be completed before the call to theDropTargetDropEvent's dropComplete(boolean success) method. After that a call to the getTransferData()processingmethod of theTransferablereturned byDropTargetDropEvent.getTransferable()is guaranteed to succeed only if the data transfer isnot requiredlocal;to finish before thisthat is only ifmethodDropTargetDropEvent.isLocalTransfer()returnstrue.It mayOtherwise thebebehavior of thedeferred untilcall islaterimplementation-dependent.@param dtde the
DropTargetDropEvent
This exception is thrown by various methods in the java.awt.dnd package. It is usually thrown to indicate that the target in question is unable to undertake the requested operation that the present time since the undrelying DnD system is not in the appropriate state. @version 1.9 0210 12/0203/0001 @since 1.2
This abstract subclass ofDragGestureRecognizerdefines aDragGestureRecognizerfor mouse based gestures. Each platform will implement its own concrete subclass of this class available via the Toolkit.createDragGestureRecognizer() method to encapsulate the recognition of the platform dependent mouse gesture(s) that initiate a Drag and Drop operation. @author Laurence P. G. Cable @version 1.911 @see java.awt.dnd.DragGestureListener @see java.awt.dnd.DragGestureEvent @see java.awt.dnd.DragSource