PATH  Documentation > Mac OS X > Application Kit Reference: Java

Table of Contents

NSDraggingInfo


Package:
com.apple.yellow.application

Interface Description


The NSDraggingInfo protocol declares methods that supply information about a dragging session (see the NSDraggingDestination protocol for definitions of dragging terms). NSDraggingInfo methods are designed to be invoked from within a class's implementation of NSDraggingDestination informal protocol methods. The Application Kit automatically passes an object that conforms to the NSDraggingInfo protocol as the argument to each of the methods defined by NSDraggingDestination. NSDraggingInfo messages should be sent to this object; you never need to create a class that implements the NSDraggingInfo protocol.



Method Types


Dragging-session information
draggingSource
draggingSourceOperationMask
draggingDestinationWindow
draggingPasteboard
draggingSequenceNumber
draggingLocation
Image information
draggedImage
draggedImageLocation
Sliding the image
slideDraggedImageTo


Instance Methods



draggedImage

public abstract NSImage draggedImage()

Returns the image being dragged. This image object visually represents the data put on the pasteboard during the drag operation; however, it is the pasteboard data and not this image that are ultimately utilized in the dragging operation.

See Also: draggedImageLocation



draggedImageLocation

public abstract NSPoint draggedImageLocation()

Returns the current location of the dragged image's origin in the base coordinate system of the destination object's window. The image moves along with the mouse pointer (the position of which is given by draggingLocation) but may be positioned at some offset.

See Also: draggedImage



draggingDestinationWindow

public abstract NSWindow draggingDestinationWindow()

Returns the destination window for the dragging operation. Either this window is the destination itself, or it contains the view object that is the destination.

draggingLocation

public abstract NSPoint draggingLocation()

Returns the current location of the mouse pointer in the base coordinate system of the destination object's window.

See Also: draggedImageLocation



draggingPasteboard

public abstract NSPasteboard draggingPasteboard()

Returns the pasteboard object that holds the data being dragged. The dragging operation that is ultimately performed utilizes this pasteboard data and not the image returned by the draggedImage method.

draggingSequenceNumber

public abstract int draggingSequenceNumber()

Returns a number that uniquely identifies the dragging session.

draggingSource

public abstract Object draggingSource()

Returns the source, or owner, of the dragged data or null if the source isn't in the same application as the destination. The dragging source implements methods from the NSDraggingSource informal protocol.

draggingSourceOperationMask

public abstract int draggingSourceOperationMask()

Returns the dragging operation mask declared by the dragging source (through its draggingSourceOperationMaskForLocal method). If the source permits dragging operations, the elements in the mask will be one or more of the following, combined using the C bitwise OR operator:
OptionMeaning
DragOperationCopyThe data represented by the image can be copied.
DragOperationLinkThe data can be shared.
DragOperationGenericThe operation can be defined by the destination.
DragOperationPrivateThe operation is negotiated privately between the source and the destination.
DragOperationAllCombines all the above.

If the source does not permit any dragging operations, this method should return DragOperationNone.

If the user is holding down a modifier key during the dragging session and the source doesn't prohibit modifier keys from affecting the drag operation (through its ignoreModifierKeysWhileDragging method), then the operating system combines the dragging operation value that corresponds to the modifier key (see the descriptions below) with the source's mask using the C bitwise AND operator.

The modifier keys are associated with the dragging operation options shown below:


Modifier KeyDragging Option
ControlDragOperationLink
AlternateDragOperationCopy
CommandDragOperationGeneric



slideDraggedImageTo

public abstract void slideDraggedImageTo(NSPoint aPoint)

Slides the image to aPoint, a specified location in the screen coordinate system. This method can be used to snap the image down to a particular location. It should only be invoked from within the destination's implementation of prepareForDragOperation-in other words, after the user has released the image but before it's removed from the screen.


Table of Contents