Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DnD with no dragImage



The code we're using is:

anEvent.startDrag(DragSource.DefaultCopyNoDrag,
createDragImage(transferable), // which can return null sometimes, causing no image
new Point(2, 2),
transferable,
listener);


I suspect there's probably something internal which checks for some arguments being null and hands execution off to different methods. The likely culprit is the point, so try changing the third argument to be a new Point(0, 0).

Thanks,
 Sam

On Thursday, September 30, 2004, at 06:04  PM, Ian Cheyne wrote:

I tried changing:

anEvent.startDrag(null, dragImage, hotSpot, aTransferrable, dragSourceListener);

to

anEvent.startDrag(null, null, null, aTransferrable, dragSourceListener);

but this still results in an outline of the Panel being dragged in addition to my dragBox. I'm using java 1.4.2_05 with OS X 10.3.5.

Ian Cheyne

On 30 Sep 2004, at 22:02, Sam Berlin wrote:

You can also pass null as the image, which will stop the outline from being displayed.

Thanks,
 Sam

On Thursday, September 30, 2004, at 04:21  PM, Ian Cheyne wrote:

I'm using the Drag and Drop API to implement a drag box in a Panel as well as to drag objects from one frame to another. In the event of the user clicking on "empty space" in a Panel my code identifies that this is a drag to select rather than a drag objects request. I use the dragOver method on the DragSourceListener to paint the drag box. However, because I am not dragging a dragImage the Mac also drags an outline of the Panel from which I am dragging.

I can easily remedy this by setting the dragImage to be an invisible and small image but is there any other way to prevent the drawing of the Panel outline. A preference setting perhaps? or is my "workaround" okay?

Ian Cheyne

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/ email@hidden


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: DnD with no dragImage (From: Ian Cheyne <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.