< prev index next >

src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTarget.m

Print this page




 646         sDraggingError = TRUE;
 647 
 648     if (sDraggingError == FALSE) {
 649         sDraggingLocation = [sender draggingLocation];
 650         NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
 651         // The y coordinate that comes in the NSDraggingInfo seems to be reversed - probably
 652         // has to do something with the type of view it comes to.
 653         // This is the earliest place where we can correct it.
 654         javaLocation.y = fView.window.frame.size.height - javaLocation.y;
 655 
 656         jint actions = [DnDUtilities mapNSDragOperationMaskToJava:[sender draggingSourceOperationMask]];
 657         jint dropAction = sJavaDropOperation;
 658 
 659         jlongArray formats = sDraggingFormats;
 660 
 661         JNF_MEMBER_CACHE(handleDropMessageMethod, jc_CDropTargetContextPeer, "handleDropMessage", "(Ljava/awt/Component;IIII[JJ)V");
 662 
 663         if (sDraggingError == FALSE) {
 664             JNFCallVoidMethod(env, fDropTargetContextPeer, handleDropMessageMethod, fComponent, (jint) javaLocation.x, (jint) javaLocation.y, dropAction, actions, formats, ptr_to_jlong(self)); // AWT_THREADING Safe (event)
 665         }
 666 
 667         if (sDraggingError == FALSE) {
 668             JNF_MEMBER_CACHE(flushEventsMethod, jc_CDropTargetContextPeer, "flushEvents", "(Ljava/awt/Component;)V");
 669             if (sDraggingError == FALSE) {
 670                 JNFCallVoidMethod(env, fDropTargetContextPeer, flushEventsMethod, fComponent); // AWT_THREADING Safe (AWTRunLoopMode)
 671             }
 672         }
 673     } else {
 674         // 8-19-03 Note: [Radar 3368754]
 675         // draggingExited: is not called after a drop - we must do that here ... but only in case
 676         // of an error, instead of drop(). Otherwise we get twice the cleanup in shared code.
 677         [self draggingExited:sender];
 678     }
 679 
 680 // TODO:BG
 681 //   [(id)sender _setLastDragDestinationOperation:sDragOperation];
 682 
 683 
 684     DLog2(@"[CDropTarget performDragOperation]: returning %@\n", (sDraggingError ? @"NO" : @"YES"));
 685 
 686     return !sDraggingError;
 687 }
 688 
 689 - (void)concludeDragOperation:(id<NSDraggingInfo>)sender
 690 {
 691     sCurrentDropTarget = nil;
 692 




 646         sDraggingError = TRUE;
 647 
 648     if (sDraggingError == FALSE) {
 649         sDraggingLocation = [sender draggingLocation];
 650         NSPoint javaLocation = [fView convertPoint:sDraggingLocation fromView:nil];
 651         // The y coordinate that comes in the NSDraggingInfo seems to be reversed - probably
 652         // has to do something with the type of view it comes to.
 653         // This is the earliest place where we can correct it.
 654         javaLocation.y = fView.window.frame.size.height - javaLocation.y;
 655 
 656         jint actions = [DnDUtilities mapNSDragOperationMaskToJava:[sender draggingSourceOperationMask]];
 657         jint dropAction = sJavaDropOperation;
 658 
 659         jlongArray formats = sDraggingFormats;
 660 
 661         JNF_MEMBER_CACHE(handleDropMessageMethod, jc_CDropTargetContextPeer, "handleDropMessage", "(Ljava/awt/Component;IIII[JJ)V");
 662 
 663         if (sDraggingError == FALSE) {
 664             JNFCallVoidMethod(env, fDropTargetContextPeer, handleDropMessageMethod, fComponent, (jint) javaLocation.x, (jint) javaLocation.y, dropAction, actions, formats, ptr_to_jlong(self)); // AWT_THREADING Safe (event)
 665         }







 666     } else {
 667         // 8-19-03 Note: [Radar 3368754]
 668         // draggingExited: is not called after a drop - we must do that here ... but only in case
 669         // of an error, instead of drop(). Otherwise we get twice the cleanup in shared code.
 670         [self draggingExited:sender];
 671     }
 672 
 673 // TODO:BG
 674 //   [(id)sender _setLastDragDestinationOperation:sDragOperation];
 675 
 676 
 677     DLog2(@"[CDropTarget performDragOperation]: returning %@\n", (sDraggingError ? @"NO" : @"YES"));
 678 
 679     return !sDraggingError;
 680 }
 681 
 682 - (void)concludeDragOperation:(id<NSDraggingInfo>)sender
 683 {
 684     sCurrentDropTarget = nil;
 685 


< prev index next >