src/macosx/classes/sun/lwawt/macosx/CDropTargetContextPeer.java

Print this page




 111             } else {
 112                 return;
 113             }
 114         }
 115         super.processMotionMessage(event, operationChanged);
 116     }
 117 
 118     @Override
 119     protected void processDropMessage(SunDropTargetEvent event) {
 120         Component eventSource = (Component)event.getComponent();
 121         Point screenPoint = event.getPoint();
 122         SwingUtilities.convertPointToScreen(screenPoint, eventSource);
 123         Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
 124                 eventSource.getLocationOnScreen().y,
 125                 eventSource.getWidth(), eventSource.getHeight());
 126         if(screenBounds.contains(screenPoint)) {
 127             super.processDropMessage(event);
 128         }
 129     }
 130 









 131     // Signal drop complete:
 132     protected void doDropDone(boolean success, int dropAction, boolean isLocal) {
 133         long nativeDropTarget = this.getNativeDragContext();
 134 
 135         dropDone(nativeDropTarget, fNativeDropTransfer, isLocal, success, dropAction);
 136     }
 137 
 138     // Notify transfer complete - this is an upcall from getNativeData's native calls:
 139     private void newData(long format, byte[] data) {
 140         fNativeDataAvailable = format;
 141         fNativeData          = data;
 142 
 143         awtLockAccess.notifyAll();
 144     }
 145 
 146     // Notify transfer failed - this is an upcall from getNativeData's native calls:
 147     private void transferFailed(long format) {
 148         fNativeDataAvailable = format;
 149         fNativeData          = null;
 150 


 111             } else {
 112                 return;
 113             }
 114         }
 115         super.processMotionMessage(event, operationChanged);
 116     }
 117 
 118     @Override
 119     protected void processDropMessage(SunDropTargetEvent event) {
 120         Component eventSource = (Component)event.getComponent();
 121         Point screenPoint = event.getPoint();
 122         SwingUtilities.convertPointToScreen(screenPoint, eventSource);
 123         Rectangle screenBounds = new Rectangle(eventSource.getLocationOnScreen().x,
 124                 eventSource.getLocationOnScreen().y,
 125                 eventSource.getWidth(), eventSource.getHeight());
 126         if(screenBounds.contains(screenPoint)) {
 127             super.processDropMessage(event);
 128         }
 129     }
 130 
 131     @Override
 132     protected int postDropTargetEvent(Component component, int x, int y, int dropAction,
 133                                       int actions, long[] formats, long nativeCtxt, int eventID,
 134                                       boolean dispatchType) {
 135         // On MacOS X all the DnD events should be synchronous
 136         return super.postDropTargetEvent(component, x, y, dropAction, actions, formats, nativeCtxt,
 137                 eventID, SunDropTargetContextPeer.DISPATCH_SYNC);
 138     }
 139 
 140     // Signal drop complete:
 141     protected void doDropDone(boolean success, int dropAction, boolean isLocal) {
 142         long nativeDropTarget = this.getNativeDragContext();
 143 
 144         dropDone(nativeDropTarget, fNativeDropTransfer, isLocal, success, dropAction);
 145     }
 146 
 147     // Notify transfer complete - this is an upcall from getNativeData's native calls:
 148     private void newData(long format, byte[] data) {
 149         fNativeDataAvailable = format;
 150         fNativeData          = data;
 151 
 152         awtLockAccess.notifyAll();
 153     }
 154 
 155     // Notify transfer failed - this is an upcall from getNativeData's native calls:
 156     private void transferFailed(long format) {
 157         fNativeDataAvailable = format;
 158         fNativeData          = null;
 159