Generated by
JDiff

java.awt.dnd Documentation Differences

This file contains all the changes in documentation in the package java.awt.dnd as colored differences. Deletions are shown like 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.

Class DragSource

The DragSource is the entity responsible for the initiation of the Drag and Drop operation and may be used in a number of scenarios: Once the DragSource is obtained a DragGestureRecognizer should also be obtained to associate the DragSource with a particular Component.

The initial interpretation of the user's gesture and the subsequent starting of the drag operation are the responsibility of the implementing Component which is usually implemented by a DragGestureRecognizer.

When a drag gesture occurs the DragSource's startDrag() method shall be invoked in order to cause processing of the user's navigational gestures and delivery of Drag and Drop protocol notifications. A DragSource shall only permit a single Drag and Drop operation to be current at any one time and shall reject any further startDrag() requests by throwing an IllegalDnDOperationException until such time as the extant operation is complete.

The startDrag() method invokes the createDragSourceContext() method to instantiate an appropriate DragSourceContext and associate the DragSourceContextPeer with that.

If the Drag and Drop System is unable to initiate a drag operation for some reason the startDrag() method throws a java.awt.dnd.InvalidDnDOperationException to signal such a condition. Typically this exception is thrown when the underlying platform system is either not in a state to initiate a drag or the parameters specified are invalid.

Note that during the drag the set of operations exposed by the source at the start of the drag operation may not change until the operation is complete. The operation(s) are constant for the duration of the operation with respect to the DragSource. @version 1.37 1240 04/0325/0102 @since 1.2

Class DragSource, constructor DragSource()

ConstructCreates a new DragSource. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DragSource, void addDragSourceListener(DragSourceListener)

AddAdds the specified DragSourceListener to this DragSource to receive drag source events during drag operations intiated with this DragSource. If a null listener is specified no action is taken and no exception is thrown. @param dsl the DragSourceListener to add. @see #removeDragSourceListener @see #getDragSourceListeners @since 1.4
Class DragSource, void addDragSourceMotionListener(DragSourceMotionListener)

AddAdds the specified DragSourceMotionListener to this DragSource to receive drag motion events during drag operations intiated with this DragSource. If a null listener is specified no action is taken and no exception is thrown. @param dsl the DragSourceMotionListener to add. @see #removeDragSourceMotionListener @see #getDragSourceMotionListeners @since 1.4
Class DragSource, DragGestureRecognizer createDefaultDragGestureRecognizer(Component, int, DragGestureListener)

Creates a new DragSourceRecognizerDragGestureRecognizer that implements the default abstract subclass of DragGestureRecognizer for this DragSource and sets the specified Component and DragGestureListener on the newly created object. For this DragSource the default is MouseDragGestureRecognizer.

@param c Thethe Component target for the recognizer @param actions Thethe permitted source actions @param dgl Thethe DragGestureListener to notify

@return the new DragGestureRecognizer or null if the Toolkit.createDragGestureRecognizer() method has no implementation available for the requested DragGestureRecognizer subclass and returns null.

Class DragSource, DragGestureRecognizer createDragGestureRecognizer(Class, Component, int, DragGestureListener)

Creates a new DragGestureRecognizer that implements the specified abstract subclass of DragGestureRecognizer and sets the specified Component and DragGestureListener on the newly created object.

@param recognizerAbstractClass Thethe requested abstract type @param actions Thethe permitted source drag actions @param c Thethe Component target @param dgl Thethe DragGestureListener to notify

@return the new DragGestureRecognizer or null if the Toolkit.createDragGestureRecognizer() method has no implementation available for the requested DragGestureRecognizer subclass and returns null.

Class DragSource, DragSourceContext createDragSourceContext(DragSourceContextPeer, DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)

CreateCreates the DragSourceContext to handle this drag.

To incorporate a new DragSourceContext subclass subclass DragSource and override this method.

If dragImage is null no image is used to represent the drag over feedback for this drag operation but NullPointerException is not thrown.

If dsl is null no drag source listener is registered with the created DragSourceContext but NullPointerException is not thrown.

If dragCursor is null the default drag cursors are used for this drag operation. NullPointerException is not thrown. @param dscp The DragSourceContextPeer for this drag @param triggerdgl The DragGestureEvent that triggered the drag @param dragCursor The initial Cursor to display @param dragImage The Image to drag or null @param imageOffset The offset of the Image origin from the hotspot of the cursor at the instant of the trigger @param transferablet The subject data of the drag @param dsl The DragSourceListener @return the DragSourceContext @throws NullPointerException if dscp is null @throws NullPointerException if dgl is null @throws NullPointerException if dragImage is not null and imageOffset is null @throws NullPointerException if t is null @throws IllegalArgumentException if the Component associated with the trigger event is null. @throws IllegalArgumentException if the DragSource for the trigger event is null. @throws IllegalArgumentException if the drag action for the trigger event is DnDConstants.ACTION_NONE. @throws IllegalArgumentException if the source actions for the DragGestureRecognizer associated with the trigger event are equal to DnDConstants.ACTION_NONE.

Class DragSource, DragSource getDefaultDragSource()

ThisGets method returns the DragSource object associated with the underlying platform. @return the platform DragSource @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DragSource, DragSourceListener[] getDragSourceListeners()

ReturnsGets an array of all the DragSourceListeners registered with this DragSource. @return all of this DragSource's DragSourceListeners or an empty array if no such listeners are currently registered @see #addDragSourceListener @see #removeDragSourceListener @since 1.4
Class DragSource, DragSourceMotionListener[] getDragSourceMotionListeners()

ReturnsGets an arrayall of all the DragSourceMotionListeners registered with this DragSource. @return all of this DragSource's DragSourceMotionListeners or an empty array if no such listeners are currently registered @see #addDragSourceMotionListener @see #removeDragSourceMotionListener @since 1.4
Class DragSource, EventListener[] getListeners(Class)

ReturnsGets an array of all the objects currently registered as FooListeners upon this DragSource. FooListeners are registered using the addFooListener method. @param listenerType the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener @return an array of all objects registered as FooListeners on this DragSource or an empty array if no such listeners have been added @exception ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener @see #getDragSourceListeners @see #getDragSourceMotionListeners @since 1.4
Class DragSource, boolean isDragImageSupported()

ThisReports method returns a boolean indicating whether or not drag Image support is available on the underlying platform.

@return if the Drag Image support is available on this platform

Class DragSource, void removeDragSourceListener(DragSourceListener)

RemoveRemoves the specified DragSourceListener from this DragSource. If a null listener is specified no action is taken and no exception is thrown. If the listener specified by the argument was not previously added to this DragSource no action is taken and no exception is thrown. @param dsl the DragSourceListener to remove. @see #addDragSourceListener @see #getDragSourceListeners @since 1.4
Class DragSource, void removeDragSourceMotionListener(DragSourceMotionListener)

RemoveRemoves the specified DragSourceMotionListener from this DragSource. If a null listener is specified no action is taken and no exception is thrown. If the listener specified by the argument was not previously added to this DragSource no action is taken and no exception is thrown. @param dsml the DragSourceMotionListener to remove. @see #addDragSourceMotionListener @see #getDragSourceMotionListeners @since 1.4
Class DragSource, void startDrag(DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)

Start a drag given the DragGestureEvent that initiated the drag the initial Cursor to use the Image to drag the offset of the Image origin from the hotspot of the Cursor at the instant of the trigger the subject data of the drag and the DragSourceListener.

@param trigger Thethe DragGestureEvent that initiated the drag @param dragCursor Thethe initial Cursor or null for defaults @param dragImage Thethe Image to drag or null @param imageOffset Thethe offset of the Image origin from the hotspot of the Cursor at the instant of the trigger @param transferable Thethe subject data of the drag @param dsl Thethe DragSourceListener

@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.

Class DragSource, void startDrag(DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener, FlavorMap)

Start a drag given the DragGestureEvent that initiated the drag the initial Cursor to use the Image to drag the offset of the Image origin from the hotspot of the Cursor at the instant of the trigger the Transferable subject data of the drag the DragSourceListener and the FlavorMap.

@param trigger Thethe DragGestureEvent that initiated the drag @param dragCursor Thethe initial Cursor or null for defaults @param dragImage Thethe image to drag or null @param imageOffset Thethe offset of the Image origin from the hotspot of the Cursor at the instant of the trigger @param transferable Thethe subject data of the drag @param dsl Thethe DragSourceListener @param flavorMap Thethe FlavorMap 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.

Class DragSource, void startDrag(DragGestureEvent, Cursor, Transferable, DragSourceListener)

Start a drag given the DragGestureEvent that initiated the drag the initial Cursor to use the Transferable subject data of the drag and the DragSourceListener.

@param trigger Thethe DragGestureEvent that initiated the drag @param dragCursor Thethe initial Cursor or null for defaults @param transferable Thethe subject data of the drag @param dsl Thethe DragSourceListener

@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.

Class DragSource, void startDrag(DragGestureEvent, Cursor, Transferable, DragSourceListener, FlavorMap)

Start a drag given the DragGestureEvent that initiated the drag the initial Cursor to use the Transferable subject data of the drag the DragSourceListener and the FlavorMap.

@param trigger Thethe DragGestureEvent that initiated the drag @param dragCursor Thethe initial Cursor or null for defaults @param transferable Thethe subject data of the drag @param dsl Thethe DragSourceListener @param flavorMap Thethe FlavorMap 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.


Class DragSourceContext

The 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 the DragSourceListeners and DragSourceMotionListeners and providing the Transferable representing the source data for the drag operation.

Note that the DragSourceContext itself implements the DragSourceListener and DragSourceMotionListener interfaces. This is to allow the platform peer (the DragSourceContextPeer instance) created by the DragSource to notify the DragSourceContext of state changes in the ongoing operation. This allows the DragSourceContext to interpose itself between the platform and the listeners provided by the initiator of the drag operation. @see DragSourceListener @see DragSourceMotionListener @version 1.4748 12/03/0118/02 @since 1.2

Class DragSourceContext, constructor DragSourceContext(DragSourceContextPeer, DragGestureEvent, Cursor, Image, Point, Transferable, DragSourceListener)

Called from DragSource this constructor creates a new DragSourceContext given the DragSourceContextPeer for this Drag the DragGestureEvent that triggered the Drag the initial Cursor to use for the Drag an (optional) Image to display while the Drag is taking place the offset of the Image origin from the hotspot at the instant of the triggering event the Transferable subject data and the DragSourceListener to use during the Drag and Drop operation.
If DragSourceContextPeer is null NullPointerException is thrown.
If DragGestureEvent is null NullPointerException is thrown.
If Cursor is null no exception is thrown and the default drag cursorscursor arebehavior is usedactivated for this drag operation.
If Image is null no exception is thrown.
If Image is not null and the offset is null NullPointerException is thrown.
If Transferable is null NullPointerException is thrown.
If DragSourceListener is null no exception is thrown. @param dscp the DragSourceContextPeer for this drag @param trigger the triggering event @param dragCursor the initial Cursor @param dragImage the Image to drag (or null) @param offset the offset of the image origin from the hotspot at the instant of the triggering event @param t the Transferable @param dsl the DragSourceListener @throws IllegalArgumentException if the Component associated with the trigger event is null. @throws IllegalArgumentException if the DragSource for the trigger event is null. @throws IllegalArgumentException if the drag action for the trigger event is DnDConstants.ACTION_NONE. @throws IllegalArgumentException if the source actions for the DragGestureRecognizer associated with the trigger event are equal to DnDConstants.ACTION_NONE. @throws NullPointerException if dscp trigger or t are null or if dragImage is non-null and offset is null
Class DragSourceContext, void dragDropEnd(DragSourceDropEvent)

ThisCalls method calls dragDropEnd on the DragSourceListeners registered with this DragSourceContext and with the associated DragSource and passes them the specified DragSourceDropEvent. @param dsde the DragSourceDropEvent
Class DragSourceContext, void dragEnter(DragSourceDragEvent)

ThisCalls method calls dragEnter on the DragSourceListeners registered with this DragSourceContext and with the associated DragSource and passes them the specified DragSourceDragEvent. @param dsde the DragSourceDragEvent
Class DragSourceContext, void dragExit(DragSourceEvent)

ThisCalls method calls dragExit on the DragSourceListeners registered with this DragSourceContext and with the associated DragSource and passes them the specified DragSourceEvent. @param dsde the DragSourceEvent
Class DragSourceContext, void dragMouseMoved(DragSourceDragEvent)

ThisCalls method calls dragMouseMoved on the DragSourceMotionListeners registered with the DragSource associated with this DragSourceContext and them passes the specified DragSourceDragEvent. @param dsde the DragSourceDragEvent @since 1.4
Class DragSourceContext, void dragOver(DragSourceDragEvent)

ThisCalls method calls dragOver on the DragSourceListeners registered with this DragSourceContext and with the associated DragSource and passes them the specified DragSourceDragEvent. @param dsde the DragSourceDragEvent
Class DragSourceContext, void dropActionChanged(DragSourceDragEvent)

ThisCalls method calls dropActionChanged on the DragSourceListeners registered with this DragSourceContext and with the associated DragSource and passes them the specified DragSourceDragEvent. @param dsde the DragSourceDragEvent
Class DragSourceContext, Component getComponent()

ThisReturns method returns the Component associated with this DragSourceContext. @return the Component that started the drag
Class DragSourceContext, Cursor getCursor()

ThisReturns method returns the current drag Cursor.

@return the current drag Cursor

Class DragSourceContext, DragSource getDragSource()

ThisReturns method returns the DragSource that instantiated this DragSourceContext. @return the DragSource that instantiated this DragSourceContext
Class DragSourceContext, int getSourceActions()

ThisReturns method returns a bitwise mask of DnDConstants that representsrepresent the set of drop actions supported by the drag source for the drag operation associated with this DragSourceContext. @return the drop actions supported by the drag source
Class DragSourceContext, Transferable getTransferable()

ThisReturns method returns the Transferable associated with this DragSourceContext. @return the Transferable
Class DragSourceContext, DragGestureEvent getTrigger()

ThisReturns method returns the DragGestureEvent that initially triggered the drag. @return the Event that triggered the drag
Class DragSourceContext, void removeDragSourceListener(DragSourceListener)

ThisRemoves method removes the specified DragSourceListener from this DragSourceContext. @param dsl the DragSourceListener to remove. Note; note that while null is not prohibited it is not acceptable as a parameter.
Class DragSourceContext, void setCursor(Cursor)

This method sets the currentSets the cursor for this drag operation to the specified Cursor. If the specified Cursor is null the default drag cursor behavior is activated for this drag operation otherwise it is deactivated. @param c the Cursor to display. Noteor that while null is not prohibited it is notto an acceptable value for thisactivate the default drag cursor parameter.behavior
Class DragSourceContext, void transferablesFlavorsChanged()

ThisNotifies method notifies the peer that the Transferable's DataFlavorsDataFlavors have changed.
Class DragSourceContext, void updateCurrentCursor(int, int, int)

checkIf the default drag cursor behavior is active this method sets the default drag cursor for updatesthe specified selected operation supported actions and implementstatus otherwise this method defaultsdoes nothing. @param dropOp the user's currently selected operation @param targetAct the current target's supported actions @param status the constant

Class DropTarget

The DropTarget is associated with a Component when that Component wishes to accept drops during Drag and Drop operations.

Each DropTarget is associated with a FlavorMap. The default FlavorMap hereafter designates the FlavorMap returned by SystemFlavorMap.getDefaultFlavorMap(). @version 1.41 1243 04/0309/0102 @since 1.2

Class DropTarget, constructor DropTarget()

ConstructCreates a DropTarget. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless
Class DropTarget, constructor DropTarget(Component, DropTargetListener)

ConstructCreates a DropTarget given the Component to associate itself with and the DropTargetListener to handle event processing.

The Component will receive drops only if it is enabled. @param c The Component with which this DropTarget is associated @param dtl The DropTargetListener for this DropTarget @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless

Class DropTarget, constructor DropTarget(Component, int, DropTargetListener)

ConstructCreates a DropTarget given the Component to associate itself with an int representing the default acceptable action(s) to support and a DropTargetListener to handle event processing.

The Component will receive drops only if it is enabled. @param c The Component with which this DropTarget is associated @param ops The default acceptable actions for this DropTarget @param dtl The DropTargetListener for this DropTarget @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless

Class DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean)

ConstructCreates a DropTarget given the Component to associate itself with an int representing the default acceptable action(s) to support a DropTargetListener to handle event processing and a boolean indicating if the DropTarget is currently accepting drops.

The Component will receive drops only if it is enabled. @param c The Component with which this DropTarget is associated @param ops The default acceptable actions for this DropTarget @param dtl The DropTargetListener for this DropTarget @param act Is the DropTarget accepting drops. @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless

Class DropTarget, constructor DropTarget(Component, int, DropTargetListener, boolean, FlavorMap)

ConstructCreates a new DropTarget given the Component to associate itself with an int representing the default acceptable action(s) to support a DropTargetListener to handle event processing a boolean indicating if the DropTarget is currently accepting drops and a FlavorMap to use (or null for the default FlavorMap).

The Component will receive drops only if it is enabled. @param c The Component with which this DropTarget is associated @param ops The default acceptable actions for this DropTarget @param dtl The DropTargetListener for this DropTarget @param act Is the DropTarget accepting drops. @param fm The FlavorMap to use or null for the default FlavorMap @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true @see java.awt.GraphicsEnvironment#isHeadless

Class DropTarget, void addDropTargetListener(DropTargetListener)

AddAdds a new DropTargetListener (UNICAST SOURCE).

@param dtl The new DropTargetListener

@throws TooManyListenersException if a DropTargetListener is already added to this DropTarget.

Class DropTarget, DropTargetContext createDropTargetContext()

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, Component getComponent()

ThisGets method returns the Component associated with this DropTarget.

@return the current Component

Class DropTarget, int getDefaultActions()

ThisGets method returns an int representing the current action(s) supported by this DropTarget.

@return the current default actions

Class DropTarget, DropTargetContext getDropTargetContext()

ThisGets method returns the DropTargetContext associated with this DropTarget.

@return the DropTargetContext associated with this DropTarget.

Class DropTarget, FlavorMap getFlavorMap()

ThisGets method returns the FlavorMap associated with this DropTarget. If no FlavorMap has been set for this DropTarget it is associated with the default FlavorMap.

@return the FlavorMap for this DropTarget

Class DropTarget, boolean isActive()

ThisReports method returns a boolean indicating whether or not this DropTarget is currently active (ready to accept drops).

@return is thetrue DropTargetif active false if not

Class DropTarget, void removeDropTargetListener(DropTargetListener)

RemoveRemoves the current DropTargetListener (UNICAST SOURCE).

@param dtl the DropTargetListener to deregister.

Class DropTarget, void setActive(boolean)

SetSets the DropTarget active if true inactive if false.

@param isActive sets the DropTarget (in)active.

Class DropTarget, void setFlavorMap(FlavorMap)

ThisSets method sets the FlavorMap associated with this DropTarget.

@param fm set the new FlavorMap or null forto associate the default FlavorMap with this DropTarget.